/* Theme 2: Forest Adventure. Every rule is scoped so Theme 1 remains untouched. */
body[data-theme="forest"] {
  --ink: #173f35;
  --muted: #4d7162;
  --accent: #f09b19;
  --accent-deep: #bd6510;
  --glass: #fff9e9f2;
  --line: #fff4cf;
  --gold: #ffc329;
  --light: #f5e3a5;
  --dark: #76b67a;
  color: var(--ink);
  background: #38bc91;
}

body[data-theme="forest"] .world {
  background: radial-gradient(ellipse at 50% 34%, #81f1cb 0, #1bb98a 54%, #087559 100%);
}
body[data-theme="forest"] .world:before {
  background-image: url('assets/forest-world-hd.webp');
  background-position: center;
  opacity: .96;
  filter: saturate(1.08) contrast(1.02);
}
body[data-theme="forest"] .world:after {
  background-image: linear-gradient(120deg, #ffbb2730, #fff2a63d 52%, #f097182b), url('assets/forest-world-hd.webp');
  background-position: center;
  opacity: 0;
  filter: sepia(.18) saturate(1.16) brightness(1.05);
}
body.gold-world[data-theme="forest"] .world:after { opacity: 1; }
body[data-theme="forest"] .ambient-drops { opacity: .38; }
body[data-theme="forest"] .drop {
  border-color: #d7fff0a6;
  background: radial-gradient(circle at 30% 24%, #fff, #d7fff06b 18%, transparent 36%), radial-gradient(circle at 68% 78%, #03a88155, transparent 52%);
  box-shadow: inset -4px -6px 10px #087b6450, inset 3px 4px 7px #fff9, 2px 8px 14px #064f3b26;
}

body[data-theme="forest"] .topbar {
  background: linear-gradient(180deg, #125f45f2, #0c4f3af2);
  border-color: #80d5a95c;
  box-shadow: 0 8px 22px #06463338, inset 0 -2px 0 #063d2b55;
}
body[data-theme="forest"] .brand { color: #fff7d7; text-shadow: 0 2px 0 #164b31; }
body[data-theme="forest"] .brand-sub { color: #b8edba; }
body[data-theme="forest"] .brand-mark {
  color: #73400d;
  background: linear-gradient(150deg, #fff684, #ffc52f 52%, #ec8616);
  border-color: #fff4a7;
  box-shadow: 0 4px 0 #99520b, 0 8px 16px #063b273d;
}
body[data-theme="forest"] .edition { color: #c8edcf; }
body[data-theme="forest"] .quiet {
  color: #fffbe9;
  background: #ffe8a51d;
  border-color: #dcf3c95c;
  box-shadow: none;
}
body[data-theme="forest"] .quiet:hover { background: #fff1c632; }
body[data-theme="forest"] button:focus-visible,
body[data-theme="forest"] a:focus-visible { outline-color: #ffe66d; }

/* Supports the compact selector the host will add to the header. */
body[data-theme="forest"] [data-theme-choice] {
  color: #d9f1d9;
  background: #073c2d99;
  border-color: #83c9985c;
}
body[data-theme="forest"] [data-theme-choice="forest"] {
  color: #64370b;
  background: linear-gradient(#ffe77a, #ffc32f);
  border-color: #fff2a0;
  box-shadow: 0 3px 0 #a45a0d;
}

body[data-theme="forest"] h1 { color: #124635; text-shadow: 0 1px 0 #eaffd2; }
body[data-theme="forest"] .eyebrow { color: #a7550d; }
body[data-theme="forest"] .live-label {
  color: #fff9dd;
  background: #0b6348e8;
  border-color: #b6e7a894;
  box-shadow: 0 3px 0 #064d38;
}
body[data-theme="forest"] .player-row {
  color: #163f33;
  background: #fff8daf0;
  border: 1px solid #fff4c7;
  box-shadow: 0 3px 0 #277c5b40;
}
body[data-theme="forest"] .player-row > div > span,
body[data-theme="forest"] .player-side { color: #547263; }
body[data-theme="forest"] .captured { color: #245844; }
body[data-theme="forest"] .avatar.black { background: linear-gradient(145deg, #336a4c, #133b2d); }
body[data-theme="forest"] .avatar.white { color: #457456; background: linear-gradient(145deg, #fffef0, #d8efb9); }
body[data-theme="forest"] .chess-clock {
  color: #e9ffed;
  background: #15563e;
  border-color: #88be7e;
  box-shadow: inset 0 1px 0 #ffffff25;
}
body[data-theme="forest"] .chess-clock.running {
  color: #583609;
  background: linear-gradient(#fff38c, #ffd33c);
  border-color: #fff5a9;
  box-shadow: 0 0 0 2px #fff7cc, 0 3px 0 #b86b12;
}
body[data-theme="forest"] .chess-clock.low { color: #fff; background: #a53d32; }

body[data-theme="forest"] .board-wrap {
  border-color: #d08a35;
  background: linear-gradient(145deg, #ffd063 0, #b86521 10%, #6e3719 46%, #a9501d 84%, #f0a23e 100%);
  box-shadow: 0 2px 0 #ffe097, 0 6px 0 #a8561d, 0 13px 0 #713713, 0 22px 0 #4a2714, 0 27px 0 #2f1c11, 0 37px 35px #073e305c, inset 0 2px 1px #fff1a27a;
}
body[data-theme="forest"] .board-wrap:before {
  border-color: #3e2515;
  box-shadow: inset 0 5px 8px #30170bd1, inset 0 -2px 1px #ffd48196;
}
body[data-theme="forest"] .board {
  border-color: #422916;
  box-shadow: 0 2px 1px #ffd98c91, 0 -2px 4px #2a160bd1;
}
body[data-theme="forest"] .board:after { box-shadow: inset 0 8px 9px #3c241b42, inset 7px 0 10px #3c241b24, inset 0 -2px 1px #fff8bd7a; }
body[data-theme="forest"] .sq { background: linear-gradient(145deg, #fff8ca80, transparent 67%), var(--light); }
body[data-theme="forest"] .sq.dark { background: linear-gradient(145deg, #dffff24a, transparent 70%), var(--dark); }
body[data-theme="forest"] .sq.selected { background: #54d9c3 !important; box-shadow: inset 0 0 0 3px #08745d !important; }
body[data-theme="forest"] .sq.last { background: #ffe578; }
body[data-theme="forest"] .sq.dark.last { background: #a9d566; }
body[data-theme="forest"] .sq.drop-target { background: #55d9bd !important; box-shadow: inset 0 0 0 4px #eaffc7 !important; }
body[data-theme="forest"] .sq.legal:after { background: #11664d8c; border-color: #f8ffca; }
body[data-theme="forest"] .sq.capture:after { background: transparent; border-color: #e56e2fc9; }
body[data-theme="forest"] .sq.checked { background: #f69b73 !important; }
body[data-theme="forest"] .coord { color: #3f754c; }
body[data-theme="forest"] .dark .coord { color: #f5ffd7; }
body.pieces-ready[data-theme="forest"] .piece { filter: drop-shadow(0 4px 1.5px #2637174f); }
body.pieces-ready[data-theme="forest"] .piece.golden { filter: drop-shadow(0 0 4px #ffdc45) drop-shadow(0 4px 2px #6b3f0a55); }

body[data-theme="forest"] .board-toolbar > span { color: #174a3c; text-shadow: 0 1px 0 #dfffd2; }
body[data-theme="forest"] .board-toolbar { background:#fff8e1e0; }
body[data-theme="forest"] .icon-button {
  color: #fff7d7;
  background: linear-gradient(#21775a, #10523d);
  border-color: #8ad39970;
  box-shadow: 0 3px 0 #073f2f;
}
body[data-theme="forest"] .icon-button.on { color: #63380b; background: linear-gradient(#ffe978, #ffc632); border-color: #fff4a4; }
body[data-theme="forest"] .music-indicator { color: #75460d; }

body[data-theme="forest"] .turn-panel,
body[data-theme="forest"] .history-panel {
  color: #173f35;
  background: linear-gradient(155deg, #fffdf0f5, #eef3cef2);
  border-color: #fff7cf;
  box-shadow: 0 7px 0 #2474513d, 0 13px 25px #07513a29;
}
body[data-theme="forest"] .turn-panel .eyebrow { color: #b05b0c; }
body[data-theme="forest"] .turn-status h2 { color: #163f34; }
body[data-theme="forest"] .turn-panel > p { color: #587162; }
body[data-theme="forest"] .panel-heading > span:last-child { color: #66806f; }
body[data-theme="forest"] .turn-dot { border-color: #fff9d5; background: linear-gradient(#fff4a5, #8dd17d); box-shadow: 0 2px 0 #4d8745; }
body[data-theme="forest"] .turn-dot.black { background: linear-gradient(#4e795d, #153f30); }
body[data-theme="forest"] .turn-dot.gold { background: linear-gradient(#fff38e, #f2a51a); }
body[data-theme="forest"] .mode-switch { background: #dceac8; border-color: #c9dbaf; }
body[data-theme="forest"] .mode-switch > button { color: #52705d; }
body[data-theme="forest"] .mode-switch > button.active { color: #154b38; background: #fffdf0; box-shadow: 0 3px 0 #a9c394; }
body[data-theme="forest"] .game-setting > label { color: #56715f; }
body[data-theme="forest"] .setting-options > button { color: #416451; background: #e6edcf; border-color: #c2d1a8; }
body[data-theme="forest"] .setting-options > button.active { color: #fff9dd; background: linear-gradient(#278060, #155840); border-color: #67ac79; box-shadow: 0 3px 0 #0c3f2e; }
body[data-theme="forest"] .game-setting > small { color: #6c806f; }
body[data-theme="forest"] .primary-button {
  color: #63360b;
  background: linear-gradient(160deg, #ffe55c, #ffaf1d);
  border-color: #fff28d;
  border-bottom-color: #b75b0b;
  box-shadow: 0 4px 0 #a7590e, 0 7px 12px #7f3d122b;
  text-shadow: 0 1px 0 #fff4a5;
}
body[data-theme="forest"] .primary-button:hover:not(:disabled) { box-shadow: 0 6px 0 #a7590e, 0 10px 15px #7f3d1238; }
body[data-theme="forest"] .secondary-button { color: #21523f; background: #fffdf0; border-color: #cbd9b4; }

body[data-theme="forest"] .gold-card {
  background: radial-gradient(ellipse at 90% 12%, #fff69e99, transparent 60%), linear-gradient(145deg, #fff4a6, #ffd253);
  border-color: #fff6b8;
  box-shadow: 0 6px 0 #b26b1e, 0 11px 22px #74400e30;
}
body[data-theme="forest"] .gold-card .eyebrow { color: #7c4b0f; }
body[data-theme="forest"] .gold-card h2 { color: #6d3d0c; text-shadow: 0 1px 0 #fff1a2; }
body[data-theme="forest"] .gold-card p { color: #704f26; }
body[data-theme="forest"] .gold-emblem { color: #bd68155e; }
body[data-theme="forest"] .fusion-diagram { border-bottom-color: #9e671a4d; }
body[data-theme="forest"] .fusion-diagram > span,
body[data-theme="forest"] .fusion-diagram b { color: #80612d; }
body[data-theme="forest"] .fusion-diagram .gold-mini,
body[data-theme="forest"] .fusion-diagram i,
body[data-theme="forest"] .text-button { color: #884a0a; }
body.gold-world[data-theme="forest"] .gold-card { outline-color: #fff09a; box-shadow: 0 0 30px #ffe269, 0 6px 0 #a96015; }

body[data-theme="forest"] .history-labels { color: #617761; background: #dce8bc99; }
body[data-theme="forest"] .history-row { color: #385c48; border-bottom-color: #adc39b57; }
body[data-theme="forest"] .history-row > span:first-child { color: #7c927d; }
body[data-theme="forest"] .history-row:last-child { color: #fffce6; background: #3d8d61; }
body[data-theme="forest"] .empty-history { color: #66806b; }
body[data-theme="forest"] .empty-history > span { color: #879884; }
body[data-theme="forest"] footer { color: #184f3d; border-color: #d7ffd070; text-shadow: 0 1px 0 #ceffca; }
body[data-theme="forest"] footer > button { color: #174b3a; }

body[data-theme="forest"] dialog {
  color: #173f35;
  background: linear-gradient(155deg, #fffdf1, #edf1cf);
  border-color: #fff8d5;
  box-shadow: 0 30px 90px #063e315e, 0 7px 0 #1f674b;
}
body[data-theme="forest"] dialog::backdrop { background: #063e3173; }
body[data-theme="forest"] .dialog-inner p,
body[data-theme="forest"] .dialog-inner li { color: #536e5d; }
body[data-theme="forest"] .dialog-inner strong { color: #1b573f; }
body[data-theme="forest"] .dialog-inner .rules-note { color: #69806d; }
body[data-theme="forest"] .close-dialog { color: #54705e; }
body[data-theme="forest"] #promotion-options > button { color: #285c43; background: #e5edc7; border-color: #b9ce9b; }
body[data-theme="forest"] #result-detail { color: #285e46; }
body[data-theme="forest"] .toast { color: #25543f; background: #fffbe9; border-color: #d4dfb4; box-shadow: 0 8px 24px #064b363b; }

@media (max-width: 480px) {
  body[data-theme="forest"] .player-row { border-radius: 10px; }
  body[data-theme="forest"] [data-theme-choice] { font-size: 10px; padding-left: 8px; padding-right: 8px; }
}
