.treasures-page { min-height:100svh; background:radial-gradient(ellipse at 54% 0%,#43251d,#1b1010 53%,#090605); }
.treasures-page [hidden] { display:none !important; }
.treasures-main { width:min(100% - 24px,690px); margin:auto; padding:12px 0 24px; }
.treasures-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:12px; }
.treasures-heading h1 { font:500 clamp(1.95rem,7vw,3.75rem)/1 Georgia,serif; letter-spacing:-.045em; margin:0; }
.treasures-shell { padding:clamp(7px,2.5vw,16px); border:1px solid #946849; border-radius:17px; background:#2d1915; box-shadow:0 18px 54px #0009; }
.treasures-button,.treasures-hud select { min-height:44px; background:#39221d; color:#ffebce; border:1px solid #ac805b; border-radius:9px; padding:6px 11px; font-weight:750; }
.treasures-button:hover:not(:disabled) { background:#664132; }
.treasures-button:disabled { opacity:.48; }
.treasures-primary,.treasures-primary:hover:not(:disabled) { background:#e9c08a; color:#321c16; }
.treasures-rules { padding:10px 14px; background:#2e1c19; border:1px solid #957050; border-radius:10px; color:#ffe8c9; line-height:1.5; }
.treasures-hud { display:grid; grid-template-columns:minmax(0,2fr) repeat(2,minmax(56px,1fr)); gap:5px; margin:0 auto 8px; max-width:510px; }
.treasures-hud > * { display:grid; justify-items:center; align-content:center; gap:2px; min-width:0; text-align:center; padding:3px; background:#1c100f; border:1px solid #765142; border-radius:9px; font-size:.75rem; color:#edc8a7; }
.treasures-hud select { width:100%; min-width:0; padding:4px; font-size:.82rem; }
.treasures-hud strong { color:#fff1cb; font-size:1.22rem; }
.treasures-field { position:relative; margin:auto; width:min(100%,510px); border-radius:12px; background:radial-gradient(ellipse at 52% 36%,#455544,#22382d 65%,#19251c); border:1px solid #b88e61; box-shadow:inset 0 1px 17px #10150d; padding:clamp(6px,2vw,15px); }
#treasures-board { position:relative; width:100%; aspect-ratio:12/var(--rows); }
.treasures-tile {
  position:absolute; left:calc(var(--x) / 12 * 100%); top:calc(var(--y) / var(--rows) * 100%); z-index:calc(var(--depth) + 1);
  width:calc(100% / 6 - 2px); height:calc(200% / var(--rows) - 2px);
  transform:translate(calc(var(--depth) * -2px),calc(var(--depth) * -3px));
  display:grid; place-items:center; padding:0; border:1px solid #c0a070; border-radius:13%;
  color:var(--ink); background:linear-gradient(147deg,#fff3ce,#dfc08d 78%,#c6a16c);
  box-shadow:inset 0 1px 2px #fff, inset 0 -3px 2px #92653c75, 1px 3px 0 #99734b, 2px 5px 5px #10140ec9;
  font:700 clamp(1.45rem,7vw,3rem)/1 Georgia,serif; touch-action:manipulation;
}
.treasures-tile::before { content:''; position:absolute; inset:4px; border:1px solid #ab835964; border-radius:10%; pointer-events:none; }
.treasures-tile[aria-disabled="true"] { filter:brightness(.65) saturate(.8); cursor:default; }
.treasures-tile[aria-pressed="true"],.treasures-tile.is-hint { border-color:#ffe19e; box-shadow:0 0 0 2px #f8cd83,inset 0 1px 2px #fff,0 0 15px #ffd681ae; }
.treasures-tile:focus-visible { outline:2px solid #ffedb2; outline-offset:-3px; }
.treasures-tile.is-match { animation:treasures-match .21s ease-out both; }
@keyframes treasures-match { 40% { filter:brightness(1.5); } 100% { opacity:0; transform:translateY(-7px) scale(.9); } }
.treasures-complete { position:absolute; inset:0; z-index:10; display:grid; place-content:center; justify-items:center; border-radius:11px; background:#1c281eee; color:#fff0c8; text-align:center; }
.treasures-complete h2 { font:500 clamp(1.6rem,5vw,2.6rem) Georgia,serif; margin:0 0 10px; }
.treasures-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; max-width:510px; margin:8px auto 0; }
.treasures-actions button { padding-inline:2px; font-size:.8rem; }
#treasures-status { min-height:1.2em; margin:8px 0 0; text-align:center; color:#f0d5b2; font-size:.85rem; }
.treasures-back { min-height:44px; display:inline-flex; align-items:center; font-size:.87rem; color:#e4b98f; }
@media(max-width:660px) { .treasures-page .gallery-header { position:relative; } .treasures-heading .treasures-button { font-size:.76rem; } }
@media(prefers-reduced-motion:reduce) { .treasures-tile.is-match { animation:none; } }

.treasures-tile span { display:block; font-weight:800; line-height:1.18; text-shadow:0 1px #fff1d4; }
