:root {
  color-scheme: light;
  --ink: #24343a;
  --muted: #738082;
  --paper: #fffdf8;
  --cream: #fff6e6;
  --cream-deep: #f5e5ca;
  --salmon: #ef745e;
  --salmon-dark: #d85445;
  --matcha: #5b9477;
  --matcha-dark: #3f755e;
  --gold: #eeb950;
  --navy: #183b46;
  --shadow: 0 18px 50px rgba(57, 55, 42, 0.14);
  --board-size: min(92vw, 590px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Hiragino Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #e8f1e9; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #dceee6 0, #f5e7ca 47%, #ead2aa 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }

.world {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  transition: background 800ms ease;
}

.world::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(231, 208, 164, 0), rgba(178, 153, 111, 0.35));
}

.sun {
  position: absolute;
  top: 8%;
  right: 8%;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 184, 111, 0.7);
  box-shadow: 0 0 60px rgba(255, 190, 113, 0.35);
}

.cloud {
  position: absolute;
  width: 180px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(1px);
}
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 80px; height: 80px; left: 28px; bottom: 3px; }
.cloud::after { width: 110px; height: 65px; right: 15px; bottom: -1px; }
.cloud-one { top: 11%; left: 3%; transform: scale(.8); }
.cloud-two { top: 28%; right: -4%; opacity: .65; transform: scale(.55); }

.mountain {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 0;
  height: 0;
  border-left: 46vw solid transparent;
  border-right: 46vw solid transparent;
  border-bottom: 32vw solid rgba(90, 118, 103, 0.16);
  transform: translateX(-62%);
}
.mountain-front { left: 28%; bottom: 13%; border-left-width: 34vw; border-right-width: 34vw; border-bottom: 24vw solid rgba(72, 105, 86, 0.14); }
.cityline { display: none; }

.petals { position: absolute; inset: 0; }
.petal { position: absolute; top: -30px; width: 10px; height: 6px; background: #f8a7ae; border-radius: 100% 0 100% 0; opacity: .75; animation: petal-fall var(--fall, 9s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes petal-fall { to { transform: translate3d(var(--drift, 80px), 105vh, 0) rotate(720deg); } }

body[data-scene="summer"] { background: linear-gradient(180deg, #b9e5e4, #e8f3d5 50%, #efdaa9); }
body[data-scene="summer"] .sun { background: rgba(255, 196, 76, .82); }
body[data-scene="summer"] .petal { background: #faf2cb; }
body[data-scene="autumn"] { background: linear-gradient(180deg, #f2d9b2, #f4c49b 50%, #d5a47d); }
body[data-scene="autumn"] .petal { background: #c95035; }
body[data-scene="winter"] { background: linear-gradient(180deg, #cadce6, #e8e9e3 53%, #c9d2d5); }
body[data-scene="winter"] .sun { background: rgba(255, 128, 91, .68); }
body[data-scene="winter"] .petal { width: 6px; height: 6px; border-radius: 50%; background: white; }
body[data-scene="city"] { background: linear-gradient(180deg, #172d46, #735b77 48%, #d78874); }
body[data-scene="city"] .mountain { display: none; }
body[data-scene="city"] .cityline { display: block; position: absolute; inset: auto 0 0; height: 40%; opacity: .42; background: linear-gradient(90deg, transparent 1%, #102532 1% 7%, transparent 7% 9%, #102532 9% 17%, transparent 17% 20%, #102532 20% 26%, transparent 26% 28%, #102532 28% 40%, transparent 40% 42%, #102532 42% 51%, transparent 51% 55%, #102532 55% 68%, transparent 68% 71%, #102532 71% 77%, transparent 77% 80%, #102532 80% 94%, transparent 94%); clip-path: polygon(0 38%,5% 38%,5% 24%,12% 24%,12% 50%,19% 50%,19% 30%,23% 30%,23% 9%,27% 9%,27% 45%,34% 45%,34% 25%,43% 25%,43% 55%,50% 55%,50% 18%,55% 18%,55% 42%,64% 42%,64% 4%,69% 4%,69% 52%,77% 52%,77% 31%,84% 31%,84% 13%,90% 13%,90% 45%,100% 45%,100% 100%,0 100%); }
body[data-scene="city"] .petal { background: #ffda71; opacity: .35; }

.app-shell { width: min(100%, 840px); margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom)); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; padding: 0; background: none; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; background: var(--salmon); border: 3px solid rgba(255,255,255,.75); border-radius: 50%; box-shadow: 0 4px 14px rgba(155, 73, 58, .26); transform: rotate(-4deg); }
.brand-mark span { font-family: serif; font-weight: 800; font-size: 22px; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: -.4px; }
.brand-copy small { margin-top: 1px; color: #536d68; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { display: flex; gap: 7px; }
.round-button { display: grid; place-items: center; width: 39px; height: 39px; padding: 9px; border: 1px solid rgba(50,70,66,.12); border-radius: 50%; background: rgba(255,253,248,.76); box-shadow: 0 4px 15px rgba(58,56,48,.09); backdrop-filter: blur(12px); }
.round-button svg { width: 100%; fill: #365a57; }
.sound-button .icon-sound-on { display: none; }
.sound-button[aria-pressed="true"] .icon-sound-on { display: block; }
.sound-button[aria-pressed="true"] .icon-sound-off { display: none; }

.shop-strip { position: relative; display: grid; grid-template-columns: 100px 1fr auto; align-items: center; min-height: 108px; margin-bottom: 12px; padding: 12px 11px 10px; border: 1px solid rgba(255,255,255,.75); border-radius: 23px; background: rgba(255, 250, 236, .72); box-shadow: 0 10px 30px rgba(70,73,60,.10); backdrop-filter: blur(16px); overflow: hidden; }
.shop-illustration { position: relative; align-self: end; width: 92px; height: 84px; }
.shop-roof { position: absolute; left: 2px; top: 20px; width: 88px; height: 16px; border-radius: 12px 12px 3px 3px; background: repeating-linear-gradient(90deg,#254c50 0 11px,#315e5f 11px 22px); transform: perspective(30px) rotateX(9deg); box-shadow: 0 5px 0 #183e44; z-index: 2; }
.shop-front { position: absolute; left: 8px; bottom: 4px; width: 76px; height: 52px; padding: 13px 5px 4px; background: #d49362; border-radius: 3px; box-shadow: inset 0 -4px #a95f45; }
.norens { display: block; height: 17px; padding: 2px; color: #ffefe0; background: #b6493c; font-family: serif; font-size: 8px; text-align: center; border-bottom: 3px dotted #f1bd8c; overflow: hidden; }
.window { display: flex; gap: 2px; height: 17px; margin: 3px 2px; }
.window i { flex: 1; background: #f5d67f; border: 2px solid #70463d; box-shadow: inset 0 0 6px #ef9f58; }
.lantern { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 22px; height: 33px; color: #3e352a; background: #ffd890; border: 2px solid #8c503a; border-radius: 48%; z-index: 3; box-shadow: inset 0 4px #e76b58; }
.lantern span { font-family: serif; font-size: 7px; writing-mode: vertical-rl; }
.patron-row { position: absolute; left: 3px; right: 3px; bottom: 0; display: flex; align-items: end; justify-content: center; gap: 1px; z-index: 5; font-size: 14px; filter: drop-shadow(0 2px 1px rgba(40,30,20,.18)); }
.shop-copy { min-width: 0; padding-left: 4px; }
.eyebrow { margin: 0 0 3px; color: var(--salmon-dark); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.shop-copy h1 { margin: 0; overflow: hidden; font-family: Georgia, serif; font-size: clamp(19px, 5vw, 25px); letter-spacing: -.4px; text-overflow: ellipsis; white-space: nowrap; }
.shop-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 5px; color: #61706e; font-size: 11px; }
.shop-metrics b { color: #34584f; }
.shop-metrics .dot { color: #d5ae77; }
.shop-button { display: flex; align-items: center; gap: 6px; min-width: 68px; padding: 8px; border: 0; border-radius: 14px; color: white; background: var(--navy); box-shadow: 0 6px 13px rgba(24,59,70,.22); }
.shop-button > span:last-child { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.shop-button b { max-width: 55px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.shop-button small { opacity: .75; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.coin-icon { color: var(--gold); font-size: 15px; text-shadow: 0 1px #a46d17; }

.game-card { position: relative; padding: 18px 12px 14px; border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,253,248,.93); box-shadow: var(--shadow); overflow: hidden; }
.game-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg,var(--salmon),var(--gold),var(--matcha)); }
.level-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 5px; }
.level-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; letter-spacing: -.5px; }
.moves-badge { display: flex; align-items: baseline; gap: 5px; min-width: 75px; padding: 7px 10px; border: 1px solid #ebd7b8; border-radius: 14px; background: #fff8eb; }
.moves-badge strong { color: var(--salmon-dark); font-family: Georgia,serif; font-size: 25px; line-height: 1; }
.moves-badge span { color: #8d7459; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.moves-badge.danger { animation: moves-pulse 900ms infinite alternate; }
@keyframes moves-pulse { to { background: #ffe5df; border-color: #f2a69a; transform: scale(1.04); } }

.score-progress { margin: 13px 5px 12px; }
.progress-track { position: relative; height: 9px; border-radius: 8px; background: #ebe4d7; box-shadow: inset 0 1px 3px rgba(80,60,40,.12); }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#e97562,#e8ac47); transition: width 400ms ease; }
.star-marker { position: absolute; top: 50%; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #b7aa98; background: #f3ede4; border: 2px solid white; box-shadow: 0 1px 5px rgba(52,43,35,.16); transform: translate(-50%,-50%); font-size: 10px; transition: 300ms ease; }
.star-one { left: 64%; } .star-two { left: 81%; } .star-three { left: 98%; }
.star-marker.earned { color: #fff; background: var(--gold); transform: translate(-50%,-50%) scale(1.2) rotate(12deg); }
.score-row { display: flex; justify-content: space-between; margin-top: 6px; color: #8a8275; font-size: 10px; }
.score-row b { color: #54625e; }

.orders-wrap { margin: 0 0 12px; padding: 10px; border: 1px dashed #e1cda9; border-radius: 16px; background: #fff9ed; }
.orders-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 11px; font-weight: 850; }
.orders-title small { color: #a0917a; font-size: 9px; font-weight: 600; }
.orders { display: flex; gap: 7px; }
.order { position: relative; display: flex; flex: 1; min-width: 0; align-items: center; gap: 6px; height: 42px; padding: 4px 7px; border-radius: 12px; background: white; box-shadow: 0 3px 9px rgba(63,54,43,.08); }
.order .mini-sushi { width: 32px; height: 32px; font-size: 24px; }
.order-copy { display: flex; min-width: 0; flex-direction: column; }
.order-copy strong { font-size: 12px; line-height: 1; white-space: nowrap; }
.order-copy small { margin-top: 3px; color: #8d8173; font-size: 8px; white-space: nowrap; }
.order.done { color: #637873; background: #edf4ed; }
.order.done::after { content: "✓"; position: absolute; top: -5px; right: -4px; display: grid; place-items: center; width: 18px; height: 18px; color: white; background: var(--matcha); border: 2px solid white; border-radius: 50%; font-size: 10px; }

.board-wrap { position: relative; width: 100%; }
.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(3px, .9vw, 6px); width: 100%; max-width: 600px; aspect-ratio: 1; margin: 0 auto; padding: clamp(5px, 1.5vw, 10px); border: 1px solid #dac4a4; border-radius: 21px; background: #e9d9bc; box-shadow: inset 0 2px 8px rgba(88,57,35,.16), 0 5px 0 #c7ae88; touch-action: none; user-select: none; }
.tile { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; padding: 0; border: 0; border-radius: clamp(7px, 2vw, 13px); background: rgba(255,250,237,.85); box-shadow: inset 0 -2px rgba(92,65,44,.07), 0 1px 2px rgba(79,58,40,.08); transition: transform 120ms ease, background 120ms ease, opacity 180ms ease; overflow: visible; }
.tile::after { content: ""; position: absolute; inset: 2px; border: 2px solid transparent; border-radius: inherit; pointer-events: none; }
.tile.selected { transform: scale(.9); background: #fff0bf; z-index: 3; }
.tile.selected::after { border-color: #eab849; }
.tile.hint { animation: tile-hint 700ms ease-in-out 2; }
@keyframes tile-hint { 50% { transform: scale(.86); background: #ffedaf; } }
.tile.clearing { animation: clear-sushi 300ms ease forwards; z-index: 4; }
@keyframes clear-sushi { 40% { transform: scale(1.18) rotate(-7deg); filter: brightness(1.15); } to { transform: scale(.15) rotate(18deg); opacity: 0; } }
.tile.invalid { animation: tile-no 260ms ease; }
@keyframes tile-no { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.sushi { position: relative; display: grid; place-items: center; width: 82%; aspect-ratio: 1; filter: drop-shadow(0 3px 2px rgba(59,38,24,.18)); transform-origin: center; }
.sushi::before { content: var(--emoji); font-size: clamp(27px, 8.7vw, 55px); line-height: 1; }
.sushi.special-row::after, .sushi.special-burst::after { content: ""; position: absolute; inset: -2px; border: 3px solid #ffd35e; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.8), 0 0 13px #ffc94e; animation: special-glow 900ms infinite alternate; }
.sushi.special-row::after { border-radius: 35%; border-left-color: #ec6758; border-right-color: #ec6758; }
.sushi.special-burst::after { border-style: dotted; border-color: #a563d7; }
@keyframes special-glow { to { transform: scale(1.09) rotate(8deg); box-shadow: 0 0 15px #ffc94e; } }
.sushi-nigiri { --emoji: "🍣"; }
.sushi-maki { --emoji: "🍙"; }
.sushi-ebi { --emoji: "🦐"; }
.sushi-ramen { --emoji: "🍜"; }
.sushi-dango { --emoji: "🍡"; }
.sushi-tempura { --emoji: "🍤"; }
.sushi-bento { --emoji: "🍱"; }
.mini-sushi { display: grid; place-items: center; filter: drop-shadow(0 2px 1px rgba(40,30,20,.12)); }
.mini-sushi::before { content: var(--emoji); }

.score-float { position: absolute; z-index: 20; color: #fff; font-weight: 1000; font-size: 17px; text-shadow: 0 2px 2px #7c4539, 0 0 6px #d95948; pointer-events: none; animation: score-fly 950ms ease-out forwards; }
@keyframes score-fly { from { transform: translate(-50%,0) scale(.8); opacity: 0; } 25% { opacity: 1; } to { transform: translate(-50%,-60px) scale(1.15); opacity: 0; } }
.combo-callout { position: absolute; left: 50%; top: 43%; z-index: 25; padding: 7px 14px; border: 2px solid white; border-radius: 20px; color: white; background: var(--salmon); box-shadow: 0 7px 20px rgba(126,63,53,.25); font-family: Georgia,serif; font-size: 20px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%,-50%) scale(.5) rotate(-5deg); }
.combo-callout.show { animation: combo-pop 1s ease both; }
@keyframes combo-pop { 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.1) rotate(3deg); } 75% { opacity: 1; transform: translate(-50%,-65%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-90%) scale(.8); } }

.power-section { margin-top: 17px; }
.power-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 0 3px; font-size: 11px; font-weight: 850; }
.power-heading small { color: #9b8d7d; font-size: 8px; font-weight: 650; }
.power-dock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.power-button { position: relative; display: flex; min-width: 0; align-items: center; gap: 5px; padding: 5px 6px; border: 1px solid #e5dac7; border-radius: 14px; background: white; box-shadow: 0 3px 8px rgba(67,52,38,.07); text-align: left; }
.power-button:disabled { opacity: .45; cursor: not-allowed; }
.power-button.active { border-color: var(--salmon); background: #fff0e8; box-shadow: 0 0 0 2px rgba(239,116,94,.16); transform: translateY(-2px); }
.power-art { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 39px; color: #f3d5a4; background: #2f3432; border-radius: 40% 40% 8px 8px; font-family: serif; font-size: 8px; font-weight: 800; line-height: .8; box-shadow: inset 0 4px rgba(255,255,255,.1), 0 2px 3px rgba(47,41,35,.2); }
.power-art.ginger { color: #b34254; background: #f5aab6; border-radius: 50% 30% 50% 30%; font-size: 22px; transform: rotate(-8deg); }
.power-art.wasabi { color: #316443; background: #8fc36c; border-radius: 50% 30% 55% 35%; font-size: 18px; transform: rotate(5deg); }
.power-info { display: none; flex-direction: column; min-width: 0; }
.power-info b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.power-info small { overflow: hidden; margin-top: 2px; color: #968878; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.power-count { position: absolute; top: -6px; right: -4px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; color: white; background: var(--navy); border: 2px solid white; border-radius: 10px; font-size: 9px; font-weight: 900; }
.game-tip { margin: 11px 0 0; color: #8e8478; font-size: 9px; text-align: center; }
.game-tip span { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 3px; border-radius: 50%; color: var(--matcha); background: #eaf3ec; font-weight: 900; vertical-align: middle; }

.bottom-nav { display: grid; grid-template-columns: 65px 1fr 65px; gap: 7px; align-items: stretch; margin-top: 12px; }
.bottom-nav > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 57px; padding: 6px; border: 1px solid rgba(255,255,255,.7); border-radius: 17px; background: rgba(255,250,238,.72); box-shadow: 0 5px 16px rgba(62,58,48,.08); backdrop-filter: blur(12px); }
.bottom-nav button svg { width: 21px; fill: #496a65; }
.bottom-nav button span { font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.daily-note { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; border-radius: 17px; color: #f8efe0; background: rgba(25, 57, 62, .9); box-shadow: 0 6px 17px rgba(30,57,61,.2); }
.daily-note > span { display: grid; place-items: center; width: 31px; height: 31px; color: #713a34; background: #f0ba8c; border-radius: 50%; font-family: serif; font-weight: 900; }
.daily-note p { display: flex; min-width: 0; flex-direction: column; margin: 0; }
.daily-note b { overflow: hidden; font-family: Georgia,serif; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.daily-note small { margin-top: 2px; color: #a7b7b1; font-size: 7px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 100; max-width: calc(100vw - 30px); padding: 10px 15px; color: white; background: #203f44; border-radius: 20px; box-shadow: 0 8px 25px rgba(20,38,40,.25); font-size: 11px; font-weight: 750; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%,20px); transition: 220ms ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

.modal { width: min(92vw, 480px); max-height: min(88vh, 740px); padding: 0; border: 0; border-radius: 27px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(28,42,41,.35); overflow: auto; }
.modal::backdrop { background: rgba(20,40,41,.53); backdrop-filter: blur(5px); }
.modal[open] { animation: modal-in 260ms ease both; }
@keyframes modal-in { from { transform: translateY(20px) scale(.95); opacity: 0; } }
.modal-body { padding: 24px; text-align: center; }
.modal h2 { margin: 2px 0 8px; font-family: Georgia,serif; font-size: 27px; line-height: 1.05; letter-spacing: -.6px; }
.modal p { color: #75807d; font-size: 12px; line-height: 1.55; }
.welcome-art { position: relative; height: 148px; background: linear-gradient(#cce9e4,#f8ddae); overflow: hidden; }
.welcome-art::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -55px; height: 105px; background: #6e9177; border-radius: 50% 50% 0 0; }
.welcome-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 6px; background: repeating-linear-gradient(90deg,#9c654b 0 42px,#573e35 42px 47px); }
.welcome-sun { position: absolute; top: 18px; right: 36px; width: 58px; height: 58px; border-radius: 50%; background: #f59e76; }
.welcome-chef, .welcome-sushi { position: absolute; z-index: 2; bottom: 20px; filter: drop-shadow(0 4px 2px rgba(50,35,25,.18)); }
.welcome-chef { left: 25%; font-size: 68px; }
.welcome-sushi { right: 27%; bottom: 25px; font-size: 46px; transform: rotate(8deg); }
.name-field, .leader-form label { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 12px; color: #5f6b68; font-size: 10px; font-weight: 800; text-align: left; }
.name-field input, .leader-form input { width: 100%; padding: 12px 14px; border: 1px solid #decdb4; border-radius: 13px; outline: none; background: #fffaf1; color: var(--ink); font-size: 14px; }
.name-field input:focus, .leader-form input:focus { border-color: var(--salmon); box-shadow: 0 0 0 3px rgba(239,116,94,.12); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 14px; font-weight: 850; }
.primary-button { color: white; background: var(--salmon); box-shadow: 0 6px 14px rgba(205,78,62,.22); }
.primary-button span { font-size: 19px; }
.secondary-button { color: #45625c; background: #edf2ec; }
.welcome-modal .primary-button { width: 100%; }
.fine-print { display: block; margin-top: 10px; color: #a59b90; font-size: 9px; }
.modal-close { display: grid; place-items: center; width: 35px; height: 35px; padding: 0; border: 0; border-radius: 50%; color: #7f827a; background: #f3eee5; font-size: 23px; line-height: 1; }

.result-modal { padding: 26px 22px 22px; text-align: center; overflow: visible; }
.result-modal .modal-close { position: absolute; top: 12px; right: 12px; }
.result-seal { display: grid; place-items: center; width: 68px; height: 68px; margin: -2px auto 13px; color: #fff5e7; background: var(--salmon); border: 5px double white; border-radius: 50%; box-shadow: 0 0 0 3px var(--salmon), 0 6px 14px rgba(163,62,51,.23); font-family: serif; font-size: 29px; font-weight: 900; transform: rotate(-6deg); }
.result-stars { margin: 12px 0; color: #d8cbb5; font-size: 35px; letter-spacing: 5px; text-shadow: 0 2px white; }
.result-stars[data-stars="1"] { background: linear-gradient(90deg,var(--gold) 0 31%,#d8cbb5 31%); }
.result-stars[data-stars="2"] { background: linear-gradient(90deg,var(--gold) 0 64%,#d8cbb5 64%); }
.result-stars[data-stars="3"] { color: var(--gold); }
.result-stars[data-stars="1"], .result-stars[data-stars="2"] { -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 16px 0; border-block: 1px solid #eee3d2; }
.result-stats div { display: flex; flex-direction: column; padding: 12px 5px; }
.result-stats div + div { border-left: 1px solid #eee3d2; }
.result-stats strong { font-family: Georgia,serif; font-size: 18px; }
.result-stats span { color: #9b9183; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.result-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

.sheet-modal { padding: 22px; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.sheet-header h2 { margin: 0; }
.sheet-intro { margin: 6px 0 15px; }
.wallet { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px; border-radius: 12px; color: #705b36; background: #fff1ca; font-size: 11px; }
.wallet b { font-size: 15px; }
.market-list { display: grid; gap: 8px; margin-top: 13px; }
.market-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #eadfce; border-radius: 16px; }
.market-item h3 { margin: 0; font-size: 13px; }
.market-item p { margin: 2px 0; font-size: 9px; line-height: 1.3; }
.market-item small { color: #859089; font-size: 8px; }
.market-item button, .leader-form button { min-width: 55px; padding: 8px; border: 0; border-radius: 10px; color: white; background: var(--matcha); font-size: 9px; font-weight: 850; }
.market-item button span { display: block; color: #eaf2c4; font-size: 8px; }
.market-item button:disabled { opacity: .4; }

.leader-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; margin: 11px 0 15px; }
.leader-form label { margin: 0; }
.leader-form button { min-height: 42px; padding-inline: 12px; background: var(--salmon); }
.leader-list { display: grid; gap: 5px; }
.leader-entry { display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 8px; min-height: 39px; padding: 6px 10px; border-radius: 11px; background: #f8f3e9; }
.leader-entry:nth-child(1) { color: #6e5517; background: #fff1b9; }
.leader-entry:nth-child(2) { background: #eef0ed; }
.leader-entry:nth-child(3) { background: #f5dfcf; }
.leader-rank { font-family: Georgia,serif; font-weight: 900; text-align: center; }
.leader-entry strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.leader-entry small { color: #8b887e; font-size: 8px; }
.leader-score { font-family: Georgia,serif; font-weight: 900; }
.leader-empty { padding: 30px 10px; color: #9b9184; text-align: center; font-size: 11px; }
.leader-note { margin-bottom: 0 !important; text-align: center; font-size: 8px !important; }

.lesson-list { display: grid; gap: 9px; margin-top: 15px; }
.lesson-list article { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 14px; background: #faf5eb; }
.lesson-list article > span { display: grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; color: white; background: var(--salmon); border-radius: 50%; font-family: Georgia,serif; font-weight: 900; }
.lesson-list h3 { margin: 1px 0 2px; font-size: 12px; }
.lesson-list p { margin: 0; font-size: 9px; line-height: 1.45; }

@media (min-width: 500px) {
  .app-shell { padding-inline: 22px; }
  .shop-strip { grid-template-columns: 130px 1fr auto; padding-inline: 20px; }
  .shop-illustration { transform: scale(1.15); transform-origin: left bottom; }
  .game-card { padding: 21px 23px 17px; }
  .power-info { display: flex; }
  .power-button { padding: 7px 9px; gap: 8px; }
  .power-art { width: 38px; height: 43px; }
  .bottom-nav { grid-template-columns: 80px 1fr 80px; }
}

@media (min-width: 820px) {
  .app-shell { padding-top: 22px; }
  .shop-strip { min-height: 122px; }
  .game-card { border-radius: 32px; }
  .board { max-width: 570px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .petals { display: none; }
}
