/* =========================
   Chicado Valley UI
========================= */

:root {

    --green-dark: #2e7d32;
    --green-mid:  #43a047;
    --green-light:#81c784;

    --cream: #fffaf0;
    --brown-dark: #5b3213;
    --brown-mid: #8d5524;

    --gold: #f4b400;

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --shadow-soft: 0 10px 30px rgba(0,0,0,.12);
    --shadow-pop: 0 6px 18px rgba(0,0,0,.18);
}


* {
    box-sizing: border-box;
}


body {

    margin: 0;
    min-height: 100vh;

    font-family: "Segoe UI", Inter, Arial, sans-serif;

    background:
        radial-gradient(circle at 15% 10%, #fff6da 0%, transparent 45%),
        radial-gradient(circle at 85% 0%, #ffe0e0 0%, transparent 40%),
        linear-gradient(160deg, #d9f7be 0%, #a8e6cf 55%, #8fd9c4 100%);

    background-attachment: fixed;

    color: #223;
}


img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}


a {
    color: inherit;
    text-decoration: none;
}


h1, h2, h3 {
    margin-top: 0;
}




/* =========================
   DASHBOARD / HOME
========================= */

.dash-body {
    display: flex;
    justify-content: center;
}


.container {

    max-width: 780px;
    width: 100%;

    margin: 30px auto 60px;
    padding: 30px 30px 40px;

    background: rgba(255,255,255,.75);
    backdrop-filter: blur(14px);

    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);

    text-align: center;
}


.dash-topline {

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
}


.container h1 {

    font-size: 34px;
    color: var(--green-dark);
    text-shadow: 0 2px 0 #fff8;
}


.logout-link {

    font-size: 14px;
    font-weight: 700;
    color: #b53434;

    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;

    box-shadow: 0 3px 10px rgba(0,0,0,.08);

    transition: .2s;
}

.logout-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop);
}


.stat-pills {

    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;

    margin: 18px 0 8px;
}


.pill {

    background: #222;
    color: #fff;

    padding: 10px 20px;
    border-radius: 30px;

    font-weight: 700;
    font-size: 15px;

    box-shadow: var(--shadow-pop);
}


.pill.coins { background: linear-gradient(135deg, #ffb300, #e08e00); }
.pill.pats  { background: linear-gradient(135deg, #ff8a80, #e35555); }
.pill.achieve { background: linear-gradient(135deg, #7e57c2, #5e35b1); }
.pill.achieve a { color: #fff; }


/* coins-only stat used on sub-pages */
.coins {
    background: #222;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
}




/* MASCOT / PAT AREA */

.mascot-stage {

    position: relative;

    margin: 25px auto 10px;

    display: flex;
    flex-direction: column;
    align-items: center;

    user-select: none;
}


.chicado {

    width: 160px;
    height: 160px;

    cursor: pointer;

    filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));

    transition: transform .15s ease;
}


.chicado:hover {
    transform: scale(1.06) rotate(-2deg);
}


.chicado:active {
    transform: scale(.94);
}


@keyframes patBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(.88) rotate(-6deg); }
    55%  { transform: scale(1.14) rotate(4deg); }
    100% { transform: scale(1); }
}


.pat-bounce {
    animation: patBounce .4s ease;
}


.mascot-hint {

    margin-top: 10px;
    font-size: 13px;
    color: #456;
    font-weight: 600;

    opacity: .8;
}


@keyframes floatUp {

    0%   { transform: translate(-50%,-50%) scale(.7); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(-50%,-220%) scale(1.2); opacity: 0; }

}


.float-text {

    position: absolute;
    left: 50%;
    top: 50%;

    font-size: 22px;
    font-weight: 800;

    pointer-events: none;

    animation: floatUp .9s ease-out forwards;
}




/* MAP GRID */

.map {

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;

    margin-top: 25px;
}


.location-card {

    background: linear-gradient(160deg, #fff, #f3f8ee);

    border: 3px solid #ffffffaa;
    border-radius: var(--radius-md);

    padding: 20px 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    font-weight: 700;
    color: var(--green-dark);

    box-shadow: var(--shadow-pop);

    transition: .2s;
}


.location-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 24px rgba(0,0,0,.2);
    background: linear-gradient(160deg, #fff, #e8f5e0);
}


.location-emoji {
    font-size: 34px;
}




/* =========================
   TOP BAR (sub pages)
========================= */

.topbar {

    height: 70px;

    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 35px;

    box-shadow: 0 4px 20px rgba(0,0,0,.08);

    position: sticky;
    top: 0;
    z-index: 10;
}


.brand {
    font-size: 26px;
    font-weight: 800;
    color: var(--green-dark);
}




/* =========================
   MAIN LAYOUT
========================= */

.layout {

    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;

    max-width: 1400px;
    margin: auto;
    padding: 30px;
}


.layout.single {
    grid-template-columns: 1fr;
    max-width: 950px;
}


.panel {

    background: rgba(255,255,255,.92);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-soft);
}


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}


h2 {
    color: var(--green-dark);
}


h3 {
    color: #333;
}


.selected-box {
    background: #f1f8e9;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
}




/* =========================
   BUTTONS
========================= */

.btn {

    border: none;

    background: linear-gradient(135deg, var(--green-mid), var(--green-dark));

    color: white;

    padding: 12px 18px;

    border-radius: 12px;

    cursor: pointer;

    font-weight: bold;
    font-size: 14px;

    transition: .2s;
}


.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop);
}


.btn:active {
    transform: translateY(0);
}


.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.btn.small {
    font-size: 13px;
    padding: 9px 14px;
}


.equipped-btn {
    background: linear-gradient(135deg, #9e9e9e, #616161);
}




/* BULK ACTIONS */

.bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}




/* =========================
   FARM GRID
========================= */

.plot-grid {

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    justify-content: center;
}


.plot {

    aspect-ratio: 1 / 1;

    background: linear-gradient(145deg, var(--brown-mid), var(--brown-dark));

    border: 4px solid #3e220d;
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    cursor: pointer;

    color: white;
    font-size: 32px;

    transition: .18s;
}


.plot:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-pop);
}


.plot.empty {
    opacity: .6;
    font-size: 40px;
}


.plot.ready {

    background: linear-gradient(145deg, var(--green-light), #388e3c);

    animation: readyPulse 1.4s infinite;
}


@keyframes readyPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(129,199,132,.55); }
    50%     { box-shadow: 0 0 0 10px rgba(129,199,132,0); }
}


.crop-name {
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
}


.timer {
    font-size: 11px;
    background: rgba(0,0,0,.5);
    padding: 3px 8px;
    border-radius: 10px;
    margin-top: 2px;
}




/* =========================
   SIDEBAR
========================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.sidebar-block {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
}


.hint {
    font-size: 13px;
    color: #667;
    line-height: 1.5;
}




/* CROP PICKER */

.crop-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}


.crop-option {

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;

    background: #f1f8e9;
    border-radius: 10px;

    cursor: pointer;

    border: 2px solid transparent;

    transition: .15s;
}


.crop-option:hover {
    background: #dcedc8;
}


.crop-option.selected {
    border-color: var(--green-mid);
    background: #c8e6c9;
}


.crop-icon {
    font-size: 25px;
}




/* =========================
   INVENTORY
========================= */

.inventory-item {

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #f5f5f5;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;

    gap: 10px;
}




/* =========================
   ACHIEVEMENTS
========================= */

.achievement-item {

    padding: 14px 0;
    border-bottom: 1px solid #e2e2e2;
}


.achievement-item.unlocked {
    opacity: .85;
}


.achievement-top {

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 14px;
    margin-bottom: 8px;

    gap: 10px;
}


.ach-progress-bar {
    height: 10px;
    background: #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
}


.ach-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-light), var(--green-dark));
    transition: width .3s ease;
}




/* =========================
   LEADERBOARD
========================= */

.leaderboard-row {

    display: flex;
    justify-content: space-between;

    padding: 12px 16px;

    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 6px;

    font-weight: 600;
}


.leaderboard-row.me {
    background: #c8e6c9;
    font-weight: 800;
    border: 2px solid var(--green-mid);
}




/* =========================
   SHOP
========================= */

.skin-grid {

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;

    margin-top: 18px;
}


.skin-card {

    background: #f8faf6;
    border: 2px solid #e5eee0;
    border-radius: var(--radius-md);

    padding: 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;

    transition: .2s;
}


.skin-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-pop);
}


.skin-card.equipped {
    border-color: var(--green-mid);
    background: #eaf6e6;
}


.skin-thumb {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 6px;
}


.skin-desc {
    font-size: 12px;
    color: #667;
    margin: 0;
    min-height: 32px;
}


.skin-price {
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 4px;
}




/* =========================
   HOUSE / PETS
========================= */

.pet-grid {

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;

    margin-top: 18px;
}


.pet-card {

    background: linear-gradient(160deg, #fff, #f3f8ee);
    border-radius: var(--radius-md);

    padding: 18px 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    box-shadow: var(--shadow-pop);
}


.pet-emoji {

    font-size: 46px;
    cursor: pointer;

    transition: transform .15s ease;
}


.pet-emoji:hover {
    transform: scale(1.1);
}


.pet-level {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
}


.pet-pats {
    font-size: 12px;
    color: #667;
    text-align: center;
}


.pet-name-row {

    display: flex;
    gap: 6px;
    align-items: center;

    width: 100%;
}


.pet-name-input {

    padding: 6px 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;

    border-radius: 8px;
}


.pet-xp-bar {
    width: 100%;
    margin-top: 4px;
}


.pet-actions {

    display: flex;
    flex-direction: column;
    gap: 6px;

    width: 100%;
    margin-top: 8px;
}


.pet-actions .btn {
    width: 100%;
}


.sell-btn {
    background: linear-gradient(135deg, #ffb300, #e08e00);
}


.pet-card {
    padding: 18px 14px;
}




/* =========================
   AUTH PAGES
========================= */

.auth-body {

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}


.auth {

    width: 100%;
    max-width: 380px;

    background: rgba(255,255,255,.9);
    backdrop-filter: blur(12px);

    border-radius: var(--radius-lg);

    padding: 40px 32px;

    text-align: center;

    box-shadow: var(--shadow-soft);
}


.auth-mascot {
    font-size: 56px;
    margin-bottom: 6px;
}


.auth h1 {
    color: var(--green-dark);
    font-size: 30px;
}


.auth h2 {
    font-weight: 500;
    color: #556;
    font-size: 16px;
    margin-bottom: 20px;
}


.auth-error {

    background: #ffe1e1;
    color: #a02222;

    padding: 10px 14px;
    border-radius: 10px;

    font-size: 13px;
    font-weight: 600;

    margin-bottom: 16px;
}


.auth form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.auth-btn {
    margin-top: 6px;
}


.auth-link {

    display: block;
    margin-top: 18px;

    font-size: 13px;
    font-weight: 600;
    color: var(--green-dark);
}


.auth-link:hover {
    text-decoration: underline;
}




/* =========================
   INPUTS
========================= */

input {

    padding: 12px 14px;

    border: 2px solid #ddd;
    border-radius: 10px;

    width: 100%;

    font-size: 14px;

    transition: .15s;
}


input:focus {
    outline: none;
    border-color: var(--green-mid);
}




/* =========================
   TOAST
========================= */

.toast {

    position: fixed;
    bottom: 30px;
    right: 30px;

    background: #222;
    color: white;

    padding: 15px 25px;
    border-radius: 15px;

    display: none;

    font-weight: 600;

    box-shadow: var(--shadow-pop);

    z-index: 100;
}




/* =========================
   MODAL
========================= */

.modal-overlay {

    position: fixed;
    inset: 0;

    background: rgba(20,25,20,.55);
    backdrop-filter: blur(3px);

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 200;

    padding: 20px;
}


.modal-overlay.open {
    display: flex;
}


.modal-box {

    background: #fff;
    border-radius: var(--radius-lg);

    padding: 28px 26px;

    max-width: 360px;
    width: 100%;

    box-shadow: 0 20px 50px rgba(0,0,0,.35);

    text-align: left;
}


.modal-box h3 {
    margin-top: 0;
    color: var(--green-dark);
}


.modal-checkbox-row {

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    color: #556;
    font-weight: 600;

    margin: 16px 0 4px;

    cursor: pointer;
}


.modal-checkbox-row input {
    width: auto;
    accent-color: var(--green-mid);
}


.modal-actions {

    display: flex;
    gap: 10px;
    justify-content: flex-end;

    margin-top: 18px;
}


.modal-cancel {
    background: linear-gradient(135deg, #b0b0b0, #7a7a7a);
}




/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    .layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .container {
        margin: 12px;
        padding: 20px;
    }

    .topbar {
        padding: 0 16px;
        height: auto;
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .layout {
        padding: 16px;
    }

    .plot-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chicado {
        width: 120px;
        height: 120px;
    }

}
