:root {
    --bg: #f5f6ec;
    --card: rgba(255, 255, 255, 0.92);
    --card-strong: #ffffff;
    --text: #253327;
    --muted: #6b7c6d;
    --primary: #4e9a3d;
    --primary-dark: #326f27;
    --secondary: #f4eed7;
    --warning: #f7b53b;
    --success: #2f9b49;
    --error: #cd4b4b;
    --border: #dbe8d3;
    --shadow: 0 14px 34px rgba(40, 71, 36, 0.1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(255,255,255,0.8), transparent 18%),
        radial-gradient(circle at 90% 15%, rgba(255,255,255,0.7), transparent 20%),
        linear-gradient(180deg, #cdefff 0%, #e9f7ff 18%, #e6f7d6 18%, #f5f6ec 100%);
}

a { color: inherit; }

.container {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(219, 232, 211, 0.85);
}

.topbar-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
}

.brand {
    text-decoration: none;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.subbrand {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.menu {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.menu a {
    text-decoration: none;
    font-weight: 800;
    color: #263527;
}

.main-content { padding: 28px 0 46px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.8);
    color: var(--primary-dark);
    border: 1px solid #d9edd0;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(82, 130, 62, 0.08);
}

.alert {
    padding: 15px 18px;
    border-radius: 18px;
    margin-bottom: 18px;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.alert-success { background: #dff8e5; color: #176736; }
.alert-error { background: #fde3e3; color: #983737; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border: 0;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(46, 74, 36, 0.12);
}

.btn-primary { background: linear-gradient(180deg, #58af43, #408d31); color: #fff; }
.btn-primary:hover { background: linear-gradient(180deg, #4ea33b, #36792a); }
.btn-secondary { background: #fff4d6; color: #664f1a; }
.btn-success { background: linear-gradient(180deg, #3abf62, #2c954b); color: #fff; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.landing-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
    min-height: 72vh;
}

.landing-copy h1,
.farm-banner h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.04;
    margin: 16px 0 14px;
}

.landing-copy p,
.farm-banner p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
    max-width: 720px;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.feature-item,
.stat-card,
.auth-card,
.plot-card,
.shop-card,
.coins-box,
.table-card,
.farm-banner {
    background: var(--card);
    border: 1px solid rgba(219, 232, 211, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.feature-item {
    padding: 14px 16px;
    font-weight: 800;
}

.hero-illustration {
    position: relative;
    min-height: 470px;
    border-radius: 34px;
    overflow: hidden;
    background:
        linear-gradient(180deg, #b8ebff 0%, #dff6ff 48%, #9fd47c 48%, #6fb050 100%);
    box-shadow: 0 24px 50px rgba(31, 66, 28, 0.18);
}

.cloud {
    position: absolute;
    background: rgba(255,255,255,0.95);
    border-radius: 999px;
}
.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}
.cloud.c1 { width: 140px; height: 44px; top: 56px; left: 58px; }
.cloud.c1::before { width: 50px; height: 50px; left: 14px; top: -18px; }
.cloud.c1::after { width: 68px; height: 68px; right: 16px; top: -28px; }
.cloud.c2 { width: 120px; height: 40px; top: 102px; right: 64px; }
.cloud.c2::before { width: 44px; height: 44px; left: 20px; top: -14px; }
.cloud.c2::after { width: 58px; height: 58px; right: 12px; top: -22px; }

.hero-sun {
    position: absolute;
    top: 34px;
    right: 32px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff8ae, #ffc93d 70%);
    box-shadow: 0 0 0 12px rgba(255, 222, 90, 0.16);
}

.hero-house,
.scene-house {
    position: absolute;
}

.hero-house { left: 68px; bottom: 118px; width: 160px; height: 140px; }
.hero-house .roof,
.scene-house .roof {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 85px solid transparent;
    border-right: 85px solid transparent;
    border-bottom: 70px solid #d95b43;
    left: -5px;
    top: 0;
}
.hero-house .body,
.scene-house .wall {
    position: absolute;
    left: 18px;
    bottom: 0;
    width: 124px;
    height: 90px;
    background: #fff3d0;
    border-radius: 8px;
}
.hero-house .door,
.scene-house .door {
    position: absolute;
    left: 66px;
    bottom: 0;
    width: 30px;
    height: 50px;
    background: #7c4a24;
    border-radius: 8px 8px 0 0;
}

.hero-tree,
.scene-tree {
    position: absolute;
    width: 36px;
    height: 100px;
    bottom: 128px;
    background: transparent;
}
.hero-tree::before,
.hero-tree::after,
.scene-tree::before,
.scene-tree::after {
    content: '';
    position: absolute;
}
.hero-tree::before,
.scene-tree::before {
    width: 16px;
    height: 50px;
    background: #7b4b24;
    left: 10px;
    bottom: 0;
    border-radius: 10px;
}
.hero-tree::after,
.scene-tree::after {
    width: 74px;
    height: 74px;
    background: radial-gradient(circle at 35% 35%, #89df6b, #40953b 75%);
    left: -20px;
    bottom: 34px;
    border-radius: 50%;
    box-shadow: -18px 18px 0 -4px rgba(95, 184, 77, 0.94), 20px 16px 0 -8px rgba(63, 151, 58, 0.94);
}
.hero-tree.t1 { left: 270px; }
.hero-tree.t2 { right: 72px; bottom: 142px; transform: scale(1.08); }

.hero-plots {
    position: absolute;
    left: 46px;
    right: 42px;
    bottom: 36px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.hero-plots span {
    height: 58px;
    border-radius: 22px;
    background:
        repeating-linear-gradient(135deg, rgba(107, 63, 36, 0.85) 0 12px, rgba(131, 79, 46, 0.95) 12px 24px),
        linear-gradient(180deg, #99572f, #6d3f24);
    border: 4px solid rgba(242, 211, 148, 0.95);
    box-shadow: inset 0 8px 14px rgba(255,255,255,0.12);
}

.auth-card {
    max-width: 540px;
    margin: 34px auto 0;
    padding: 28px;
}

.form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-weight: 800; }
input, select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid #d4e3cb;
    background: #fff;
    outline: none;
    font: inherit;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}
.page-head h1,
.page-head h2 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.dashboard {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    padding: 18px;
    display: grid;
    gap: 10px;
}
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card strong { font-size: 28px; }
.stat-coin { background: linear-gradient(180deg, rgba(255,249,220,0.95), rgba(255,255,255,0.95)); }
.stat-xp { background: linear-gradient(180deg, rgba(234,246,255,0.95), rgba(255,255,255,0.95)); }
.stat-level { background: linear-gradient(180deg, rgba(245,239,255,0.95), rgba(255,255,255,0.95)); }
.stat-plots { background: linear-gradient(180deg, rgba(232,255,235,0.95), rgba(255,255,255,0.95)); }

.farm-banner {
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}
.farm-banner h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); }
.farm-banner-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.legend-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.legend-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.legend-pill.empty { background: #fff5dd; color: #8a5e16; }
.legend-pill.grow { background: #eef7d7; color: #527723; }
.legend-pill.ready { background: #dff8e6; color: #197441; }

.farm-scene {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 130px 18px 22px;
    background:
        linear-gradient(180deg, #bfeeff 0%, #dff7ff 26%, #9fd677 26%, #77b755 62%, #5ca03f 100%);
    box-shadow: 0 22px 44px rgba(34, 73, 29, 0.16);
}
.scene-sky { position: absolute; inset: 0; pointer-events: none; }
.scene-hills {
    position: absolute;
    left: -10%; right: -10%;
    top: 88px;
    height: 170px;
    background:
        radial-gradient(circle at 20% 100%, #93cc70 0 27%, transparent 27%),
        radial-gradient(circle at 48% 100%, #84c663 0 30%, transparent 30%),
        radial-gradient(circle at 74% 100%, #7dbe5d 0 28%, transparent 28%),
        radial-gradient(circle at 98% 100%, #90cb73 0 25%, transparent 25%);
    opacity: 0.95;
}
.scene-house { left: 36px; top: 58px; width: 170px; height: 140px; }
.scene-house .wall { width: 132px; height: 88px; left: 19px; }
.scene-house .door { left: 70px; }
.scene-house .window {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #9ed6ff;
    bottom: 34px;
    border: 4px solid #84592c;
}
.scene-house .window.left { left: 36px; }
.scene-house .window.right { right: 36px; }

.scene-barn {
    position: absolute;
    right: 44px;
    top: 72px;
    width: 170px;
    height: 138px;
}
.barn-roof {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 0;
    height: 42px;
    background: #ad352f;
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.barn-wall {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 34px;
    bottom: 0;
    background: #c24239;
    border-radius: 10px;
}
.barn-door {
    position: absolute;
    left: 58px;
    right: 58px;
    bottom: 0;
    height: 58px;
    background: #782721;
    border-radius: 16px 16px 0 0;
}

.farm-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.plot-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 355px;
    background: rgba(255,255,255,0.9);
}
.plot-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.plot-number { font-size: 18px; font-weight: 900; }
.plot-state {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef5ea;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}

.plot-visual {
    position: relative;
    height: 150px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(188,234,255,0.88) 0%, rgba(214,243,255,0.9) 44%, rgba(146,206,99,0.9) 44%, rgba(105,170,68,0.96) 100%);
    overflow: hidden;
}
.plot-visual .soil {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 58px;
    border-radius: 22px;
    background:
        repeating-linear-gradient(135deg, rgba(109, 66, 36, 0.92) 0 11px, rgba(133, 80, 45, 0.97) 11px 22px),
        linear-gradient(180deg, #97613a, #6e4126);
    border: 4px solid rgba(249, 222, 160, 0.92);
}
.seed-sign {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    font-weight: 900;
    color: #6b5a20;
}

.crop {
    position: absolute;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    display: flex;
    align-items: end;
    justify-content: center;
}
.crop::before,
.crop::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 18px;
    height: 42px;
    background: linear-gradient(180deg, #85e55d, #2e9636);
    border-radius: 30px 30px 4px 30px;
    opacity: 0.92;
}
.crop::before { left: -18px; transform: rotate(-28deg); }
.crop::after { right: -18px; transform: rotate(28deg) scaleX(-1); }
.crop-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.16));
}
.crop.stage-1 .crop-icon { font-size: 22px; opacity: 0.45; }
.crop.stage-2 .crop-icon { font-size: 34px; opacity: 0.78; }
.crop.stage-3 .crop-icon { font-size: 50px; opacity: 1; }
.crop.stage-1::before,
.crop.stage-1::after { height: 26px; width: 12px; }
.crop.stage-2::before,
.crop.stage-2::after { height: 36px; width: 16px; }
.crop-generic .crop-icon { font-size: 40px; }
.crop-corn::before,
.crop-corn::after { background: linear-gradient(180deg, #7ce65c, #2e9636); }
.crop-strawberry::before,
.crop-strawberry::after { background: linear-gradient(180deg, #79d95c, #2e9234); }
.crop-tomato::before,
.crop-tomato::after { background: linear-gradient(180deg, #78dc5c, #2e9435); }
.crop-carrot::before,
.crop-carrot::after { background: linear-gradient(180deg, #8de864, #37a03d); }

.plot-progress-row { display: grid; gap: 8px; }
.progress-label { font-weight: 800; color: #537255; font-size: 13px; }
.progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e9f0de;
    overflow: hidden;
}
.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7bc84c, #3b9d38);
}

.crop-box { display: grid; gap: 8px; }
.crop-box strong { font-size: 18px; }
.timer { font-weight: 900; color: #966200; }
.compact-form { margin-top: auto; }

.coins-box { padding: 16px 18px; margin-bottom: 18px; }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.shop-card {
    padding: 22px 18px;
    display: grid;
    gap: 10px;
}
.seed-emoji {
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,249,236,0.95));
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.8);
}
.shop-card.seed-carrot { background: linear-gradient(180deg, rgba(255,248,239,0.95), rgba(255,255,255,0.95)); }
.shop-card.seed-corn { background: linear-gradient(180deg, rgba(255,252,234,0.95), rgba(255,255,255,0.95)); }
.shop-card.seed-strawberry { background: linear-gradient(180deg, rgba(255,241,244,0.95), rgba(255,255,255,0.95)); }
.shop-card.seed-tomato { background: linear-gradient(180deg, rgba(255,242,239,0.95), rgba(255,255,255,0.95)); }

.table-card { padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th { background: #f7fbf3; }
.mb-24 { margin-bottom: 24px; }
.admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }

@media (max-width: 1024px) {
    .landing-hero,
    .dashboard,
    .shop-grid,
    .farm-grid,
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }
    .landing-hero { min-height: auto; }
}

@media (max-width: 780px) {
    .landing-hero,
    .dashboard,
    .shop-grid,
    .farm-grid,
    .admin-grid,
    .feature-list {
        grid-template-columns: 1fr;
    }

    .topbar-wrap,
    .farm-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-illustration { min-height: 360px; }
    .scene-house,
    .scene-barn { transform: scale(0.82); transform-origin: top left; }
    .scene-barn { right: 8px; }
    .farm-scene { padding-top: 120px; }
}
