    :root {
      --ink: #3e3529;
      --muted: #746755;
      --cream: #fff8e9;
      --green: #2f8f55;
      --green-dark: #246c42;
      --gold: #f2ad22;
      --red: #d34b4b;
      --shadow: 0 10px 24px rgba(82, 59, 27, .13);
    }
    * { box-sizing: border-box; }
    html, body { width: 100%; height: 100%; }
    body {
      margin: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
      transition: opacity .2s ease;
      color: var(--ink);
      font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #dff2d1;
    }
    body.language-switching { opacity: 0; }
    body:not(.game-started) > .topbar,
    body:not(.game-started) > .main { opacity: 0; pointer-events: none; }
    body.game-started > .topbar,
    body.game-started > .main { animation: game-fade-in .5s ease both; }
    @keyframes game-fade-in { from { opacity: 0; } to { opacity: 1; } }
    .landing {
      position: fixed;
      inset: 0;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      isolation: isolate;
      background: #537c45;
      transition: opacity .5s ease, visibility .5s ease;
    }
    .landing::before,
    .landing::after { position: absolute; inset: 0; content: ""; pointer-events: none; }
    .landing::before {
      z-index: -2;
      background: url("background.jpg") center center / cover no-repeat;
      animation: landing-breathe 10s ease-in-out infinite;
      transform-origin: center;
    }
    .landing::after { z-index: -1; background: rgba(0, 0, 0, .2); }
    .landing.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
    @keyframes landing-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
    .landing-card { position: relative; z-index: 1; width: min(560px, calc(100% - 40px)); padding: 48px 36px; border: 1px solid rgba(255,255,255,.7); border-radius: 28px; text-align: center; background: rgba(255,253,246,.88); box-shadow: 0 24px 70px rgba(49, 90, 43, .24); animation: landing-content-in .5s ease both; }
    @keyframes landing-content-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    .landing-card h1 { margin-bottom: 12px; color: var(--green-dark); font-size: clamp(32px, 5vw, 52px); }
    .landing-card p { color: var(--muted); font-size: 17px; }
    .landing-start { margin-top: 18px; padding: 14px 34px; font-size: 18px; box-shadow: 0 0 0 0 rgba(47,143,85,.45); transition: transform .2s, filter .2s, box-shadow .2s; }
    .landing-start:hover { transform: scale(1.06); filter: brightness(1.12); box-shadow: 0 0 0 9px rgba(47,143,85,.15), 0 8px 25px rgba(47,143,85,.35); }
    .landing-toolbar { position: absolute; top: 20px; right: 112px; z-index: 2; }
    #musicBtn { position: fixed; top: 10px; right: 10px; z-index: 99; padding: 9px 12px; font-size: 14px; background: rgba(31, 83, 48, .82); backdrop-filter: blur(6px); }
    .language-switcher { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #d9cfba; border-radius: 9px; background: #fffdf6; }
    .language-switcher button { min-width: 31px; padding: 5px 7px; color: var(--ink); background: transparent; font-size: 12px; }
    .language-switcher button.active { color: #fff; background: var(--green); }
    .landing-toolbar .language-switcher button { padding: 7px 10px; font-size: 13px; }
    button {
      border: 0;
      border-radius: 9px;
      padding: 9px 13px;
      color: #fff;
      background: var(--green);
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: transform .15s, filter .15s, opacity .15s;
    }
    button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
    button:disabled { cursor: not-allowed; opacity: .48; }
    .topbar {
      background: #fffdf6;
      border-bottom: 1px solid #e8dfcb;
      box-shadow: 0 2px 8px rgba(65, 50, 23, .08);
      position: sticky;
      top: 0;
      z-index: 4;
    }
    .top-inner, .main { width: 100%; max-width: 1280px; margin: auto; min-width: 0; }
    .top-inner { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; align-items: center; gap: 10px; height: 68px; min-height: 0; padding: 5px 18px; overflow: hidden; }
    .brand { min-width: 0; font-size: 22px; font-weight: 900; color: var(--green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .stats { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
    .stat { min-width: 0; }
    .stat strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
    .stat small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
    .progress { height: 9px; border-radius: 99px; overflow: hidden; background: #e7e2d5; }
    .progress i { display: block; height: 100%; background: linear-gradient(90deg, #71c65b, #f3c33d); transition: width .3s; }
    #growth-bar { width: 0%; }
    .nav { display: flex; gap: 5px; min-width: 0; }
    @media (min-width: 769px) { .nav { margin-right: 105px; } }
    .nav button { max-width: 118px; min-width: 0; padding: 8px 9px; background: #eee8d8; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .toolbar { display: flex; align-items: center; gap: 6px; min-width: 0; }
    .toolbar .language-switcher { min-width: 0; }
    .toolbar .danger { padding-left: 9px; padding-right: 9px; white-space: nowrap; }
    .nav button.active { background: var(--green); color: white; }
    .main { height: calc(100vh - 69px); padding: 14px 18px 18px; overflow: hidden; }
    .page { display: none; }
    .page.active { display: block; }
    .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; min-width: 0; margin-bottom: 10px; }
    .page-heading > div { min-width: 0; }
    .page-heading .note { max-width: 48%; text-align: right; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { margin-bottom: 2px; font-size: 25px; }
    h2 { font-size: 18px; margin-bottom: 9px; }
    .subtitle { color: var(--muted); margin: 0; }
    .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 300px); gap: 14px; align-items: start; min-width: 0; }
    .farm-layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 14px; align-items: start; min-width: 0; }
    .layout > *, .farm-layout > * { min-width: 0; }
    .panel, .plot, .animal, .gift { background: rgba(255, 253, 246, .95); border: 1px solid #e8dfcb; border-radius: 16px; box-shadow: var(--shadow); }
    .panel { padding: 13px; }
    .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
    .panel-head > * { min-width: 0; overflow-wrap: anywhere; }
    .farm-shop-heading { margin-top: 10px; }
    .note { color: var(--muted); font-size: 13px; }
    .plots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .plot { min-height: 155px; padding: 11px; position: relative; overflow: hidden; }
    .plot::before { content: ""; position: absolute; inset: auto -20px -35px; height: 92px; background: #b6df80; border-radius: 50%; opacity: .65; }
    .plot > * { position: relative; }
    .plot.empty { background: #f5efd9; }
    .plot.mature { border: 3px solid #f1ad25; animation: glow 1.2s ease-in-out infinite alternate; }
    @keyframes glow { to { box-shadow: 0 0 0 4px rgba(241, 173, 37, .25), var(--shadow); } }
    .plot-title { display: flex; justify-content: space-between; font-weight: 800; }
    .crop-icon { font-size: 30px; margin: 4px 0 2px; }
    .status { display: inline-block; border-radius: 99px; padding: 3px 8px; background: #eee8d8; color: var(--muted); font-size: 12px; font-weight: 800; }
    .status.ready { background: #ffdf79; color: #78500a; }
    .bar { height: 10px; margin: 8px 0; border-radius: 99px; overflow: hidden; background: #e9e3d4; }
    .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7dca54, #f2b32d); }
    #mood-bar { width: 100%; background: #e6a932; }
    .actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
    .secondary { background: #e9e3d4; color: var(--ink); }
    .danger { background: var(--red); }
    .shop-item, .demand { padding: 8px 0; border-bottom: 1px dashed #ded4bf; }
    .shop-item:last-child, .demand:last-child { border-bottom: 0; }
    .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
    .row > :first-child { min-width: 0; overflow-wrap: anywhere; }
    .shop-item strong { overflow-wrap: anywhere; }
    .price { color: #a46113; font-weight: 900; white-space: nowrap; }
    .inventory-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
    .inventory-card { padding: 10px; border-radius: 11px; background: #f6f0df; }
    .inventory-section-heading { margin-top: 18px; }
    .inventory-card strong { display: block; font-size: 20px; }
    .seed { border-left: 5px solid #8ccf55; }
    .produce { border-left: 5px solid #e39b37; }
    .animal-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .animal { padding: 10px; position: relative; min-height: 155px; }
    .animal.ready { border: 3px solid #f1ad25; animation: glow 1.2s ease-in-out infinite alternate; }
    .animal.dead { filter: grayscale(.85); background: #eeeae2; }
    .animal-icon { font-size: 32px; float: left; margin: -4px 8px 5px 0; }
    .animal h3 { margin-bottom: 2px; }
    .animal .meta { color: var(--muted); font-size: 13px; }
    .shop-list { max-height: 350px; overflow: hidden; }
    .mood { font-size: 24px; font-weight: 900; color: #d07b24; }
    .merchant-box { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #e8dfcb; }
    .quantity-control { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
    .quantity-control button { padding: 4px 9px; }
    .quantity-control input { width: 52px; padding: 5px; text-align: center; border: 1px solid #d9cfba; border-radius: 6px; }
    .estimate { color: #a46113; font-size: 12px; font-weight: 700; }
    .gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .gift { padding: 18px; text-align: center; }
    .gift-icon { font-size: 58px; margin: 5px 0; }
    .gift .real { color: var(--muted); }
    .empty-note { color: var(--muted); text-align: center; padding: 18px 4px; }
    .modal-backdrop { display: none; position: fixed; inset: 0; z-index: 10; background: rgba(41, 32, 19, .45); align-items: center; justify-content: center; padding: 20px; }
    .modal-backdrop.show { display: flex; }
    .modal { width: min(560px, 100%); max-height: 80vh; overflow: auto; padding: 22px; border-radius: 16px; background: var(--cream); box-shadow: 0 25px 70px rgba(0,0,0,.25); }
    .modal-header { display: flex; justify-content: space-between; align-items: center; }
    .modal-close { background: transparent; color: var(--ink); font-size: 22px; padding: 2px 7px; }
    .toast { position: fixed; right: 24px; bottom: 24px; z-index: 12; max-width: 360px; padding: 13px 17px; border-radius: 10px; color: white; background: #3c3327; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
    .toast.show { opacity: 1; transform: translateY(0); }
    @media (max-width: 1050px) {
      .farm-layout { grid-template-columns: 230px minmax(0, 1fr); }
      .farm-layout > .right-column { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
    }
    @media (max-width: 760px) {
      .top-inner, .stats, .nav { flex-wrap: wrap; }
      .brand { width: 100%; }
      .layout, .farm-layout, .gift-grid { grid-template-columns: 1fr; }
      .plots { grid-template-columns: repeat(2, 1fr); }
      .farm-layout > .right-column { display: block; }
    }
    @media (max-width: 768px) {
      html, body { width: 100%; min-width: 0; min-height: 100%; }
      body { height: auto; overflow-x: auto; overflow-y: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
      .landing { width: 100%; min-width: 100%; height: 100dvh; min-height: 100dvh; }
      .landing::before { min-width: 100%; min-height: 100%; }
      .topbar { position: sticky; }
      .top-inner { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; height: auto; min-height: 68px; padding: 8px 12px; overflow: visible; }
      .brand { width: 100%; max-width: 100%; padding-right: 105px; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
      .stats { flex-wrap: wrap; min-width: 0; max-width: 100%; overflow-x: visible; white-space: normal; }
      .stats::-webkit-scrollbar { display: none; }
      .stat { flex: 1 1 110px; }
      .toolbar { flex-wrap: wrap; width: 100%; }
      .toolbar .language-switcher { flex: 0 0 auto; }
      .toolbar .danger { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
      .nav { flex-wrap: wrap; width: 100%; }
      .nav button { flex: 1 1 110px; max-width: none; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
      .main { width: 100%; min-width: 0; height: auto; min-height: calc(100dvh - 69px); padding: 12px; overflow-x: auto; overflow-y: visible; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
      .page-heading { align-items: flex-start; flex-wrap: wrap; }
      .page-heading .note { max-width: 100%; text-align: left; }
      h1, h2, h3, .page-heading, .panel-head, .plot-title { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
      .plots, .animal-list, .gift-grid, .inventory-grid { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
      .panel { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
      .shop-item .row, .demand .row { align-items: flex-start; flex-wrap: wrap; }
      .shop-item .row > :last-child, .demand .row > :last-child { max-width: 100%; overflow-wrap: anywhere; }
      .shop-item strong, .price, .note, .meta, .estimate { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
      .actions { width: 100%; }
      .actions button { max-width: 100%; overflow-wrap: anywhere; }
      .shop-list { max-height: none; overflow: visible; }
      .landing-toolbar { top: max(12px, env(safe-area-inset-top)); right: 112px; }
      .landing-card { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 100px); overflow: auto; padding: 32px 22px; }
      .landing-card h1 { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
    }