#medal-machines { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; margin-bottom: 19px; }
#medal-machines a { overflow: hidden; text-align: center; border: 1px solid #4b5156; border-radius: 8px; background: #12171d; color: #e3dfd7; }
#medal-machines a:hover { border-color: #d2b37b; }
#medal-machines a[aria-current] { color: #ffe1ad; background: #383026; border-color: #e5bb79; box-shadow: 0 0 0 1px #c8a16b; }
#medal-machines img { display: block; width: 100%; height: clamp(40px,4.2vw,60px); object-fit: cover; object-position: 50% 43%; }
#medal-machines a span { display: block; padding: 4px 1px; font-size: clamp(.67rem,1.15vw,.8rem); font-weight: 650; }
#lottery { --accent: #90d599; --trim: #46674f; }
.medal-edition { margin: 0 0 8px; color: #c8c6bc; font-size: .79rem; }
#lottery[data-lottery="coral"] { --accent: #8edcda; --trim: #4d7375; }
#lottery[data-lottery="volcano"] { --accent: #ffb485; --trim: #885d43; }
#lottery[data-lottery="ice"] { --accent: #a0deff; --trim: #587d93; }
#lottery[data-lottery="galaxy"] { --accent: #dbb5ff; --trim: #715686; }
.lottery-stage { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.25fr); overflow: hidden; border: 1px solid var(--trim); border-radius: 11px; background: #111619; }
#cabinet-photo { min-width: 0; padding: 0; border: 0; border-right: 1px solid var(--trim); position: relative; background: #13181c; overflow: hidden; }
#cabinet-photo img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
#cabinet-motion { position: absolute; display: block; width: 100%; height: 100%; inset: 0; pointer-events: none; }
#cabinet-photo span { position: absolute; bottom: 8px; right: 8px; padding: 3px 9px; border-radius: 9px; background: #0b1119de; color: #f5f2e9; font-size: .7rem; }
#cabinet-photo:focus-visible { outline-offset: -4px; z-index: 1; }
.lottery-glass { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(ellipse at center,#273435,#0d141c 78%); }
.stage-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px 0; color: var(--accent); }
.stage-caption strong { font-size: .92rem; }
#ball-count { font: 650 .74rem/1.25 ui-monospace,monospace; color: #eae5da; }
#lottery-wheel { width: 100%; height: auto; aspect-ratio: 520/315; display: block; }
#ring-stages { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 7px 0; list-style: none; padding: 0; }
#ring-stages li { font-size: .72rem; color: #b4b2ad; }
#ring-stages li[aria-current] { color: var(--accent); font-weight: 750; }
#ring-stages li:not(:last-child)::after { content: "›"; margin-left: 8px; color: #9b9a8e; }
#lottery-readout { display: flex; align-items: center; gap: 14px; border: 1px solid #3e484b; background: #141b20; padding: 10px 12px; border-radius: 8px; }
#lottery[data-lottery="forest"] #lottery-readout { display: grid; grid-template-columns: minmax(145px,205px) minmax(82px,108px) minmax(100px,1fr); gap: 10px; }
:is(#bingo-card,#sample-card) { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; padding: 3px; border: 1px solid #ac8448; border-radius: 6px; background: #46301b; }
:is(#bingo-card,#sample-card).legacy { grid-template-columns: repeat(3,minmax(0,1fr)); }
#bingo-card.wonder { grid-template-columns: repeat(3,minmax(0,1fr)); }
#bingo-card span.apple-line { position: relative; }
#bingo-card span.apple-line::after { content: ''; width: 5px; height: 6px; border-radius: 60%; background: #96dc72; position: absolute; right: 2px; top: 2px; }
:is(#bingo-card,#sample-card) span { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 30px; color: #f4e1ae; background: #30241e; border: 1px solid #715437; border-radius: 3px; font: 750 .92rem/1 ui-monospace,monospace; }
:is(#bingo-card,#sample-card) span.inner { border-color: #b58d45; }
:is(#bingo-card,#sample-card) span.free { background: #33402e; color: #e3eac8; }
:is(#bingo-card,#sample-card) span.hit { color: #302518; background: #ecc979; border-color: #f5e5a3; }
:is(#bingo-card,#sample-card) span.line { box-shadow: inset 0 0 0 2px #7de7a6; }
:is(#bingo-card,#sample-card) small { min-height: .6rem; font: 700 .55rem/1.1 system-ui,sans-serif; }
:is(#garden-paytable,#sample-prizes) { align-self: stretch; display: flex; flex-direction: column-reverse; justify-content: space-around; list-style: none; padding: 0; margin: 0; }
:is(#garden-paytable,#sample-prizes) li { border-bottom: 1px solid #455049; color: #ded2b4; font-size: .69rem; }
:is(#garden-paytable,#sample-prizes) strong { display: block; color: #f1e9c9; font-size: .83rem; font-variant-numeric: tabular-nums; }
:is(#garden-paytable,#sample-prizes) .reached { color: #a8e5b4; }
#machine-source { display: inline-block; margin-top: 6px; color: #d9c39a; text-decoration: underline; }
.draw-log { min-width: 0; }
#draw-label { color: var(--accent); font-size: .77rem; font-weight: 700; }
#draw-trace { display: flex; flex-wrap: wrap; gap: 3px; list-style: none; padding: 0; }
#draw-trace:not(:empty) { margin-block: 5px 2px; }
#draw-trace li { display: grid; place-items: center; min-width: 24px; height: 23px; padding: 2px 5px; border-radius: 15px; border: 1px solid #617078; background: #273138; color: #efeadf; font: 650 .72rem/1 ui-monospace,monospace; }
#draw-trace li.special { background: #594727; border-color: #b59158; color: #ffe3a5; }
#draw-message { color: var(--muted); font-size: .79rem; }
.lottery-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 18px; margin-top: 12px; }
.lottery-settings fieldset { border: 0; padding: 0; min-width: 0; }
.lottery-settings legend, #aim-label { color: #d6d0c2; font-size: .75rem; padding: 0; }
.bet-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#lottery-bet { width: calc(6ch + 2.5em); min-height: 34px; border: 1px solid #788a87; border-radius: 5px; background: #131b20; color: var(--text); font: inherit; font-variant-numeric: tabular-nums; padding: 3px 7px; }
#lottery-bet[aria-invalid="true"] { border-color: #ffbdad; }
#bet-error { margin-top: 3px; font-size: .74rem; color: #ffbdad; }
.setting-choices { display: flex; gap: 4px; flex-wrap: wrap; }
.setting-choices button, #aim-controls button, .draw-actions button { border: 1px solid #596264; color: #dddcd6; border-radius: 5px; background: #242b2e; font-size: .77rem; padding: 5px 9px; min-height: 32px; }
.setting-choices [aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #2b3839; }
.setting-choices button[data-color]::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: var(--ball-color); }
[data-color="red"] { --ball-color: #fd756a; } [data-color="yellow"] { --ball-color: #ffd56e; } [data-color="green"] { --ball-color: #81dda1; } [data-color="pink"] { --ball-color: #f3a6e9; } [data-color="blue"] { --ball-color: #73b8f0; }
#draw-trace [data-color] { border-color: var(--ball-color); color: var(--ball-color); }
#aim-controls { display: flex; flex-wrap: wrap; gap: 4px 7px; align-items: center; }
#aim-controls #aim-value { font: 700 .79rem/1.3 ui-monospace,monospace; color: var(--accent); min-width: 5.4em; }
.draw-actions { display: flex; justify-content: end; gap: 8px; margin-top: 6px; }
.draw-actions button { font-size: .72rem; min-height: 28px; padding: 2px 8px; background: transparent; }
#photo-dialog { width: min(920px, calc(100% - 30px)); padding: 12px; }
#photo-dialog .dialog-title { margin: 0 0 8px; }
#photo-dialog img { display: block; max-width: 100%; max-height: 75dvh; margin: auto; border-radius: 5px; object-fit: contain; }
@media (max-width: 560px) {
  #medal-machines { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-bottom: 12px; }
  #medal-machines img { height: 38px; }
  .lottery-stage { grid-template-columns: minmax(0,1fr); }
  #cabinet-photo { min-height: clamp(110px,30vw,163px); border: 0; border-bottom: 1px solid var(--trim); }
  #cabinet-photo img { object-position: center 43%; }
  #lottery-readout { gap: 8px; padding: 8px; }
  #lottery[data-lottery="forest"] #lottery-readout { grid-template-columns: minmax(0,1.7fr) minmax(73px,1fr); }
  #lottery[data-lottery="forest"] .draw-log { grid-column: 1 / -1; }
  .lottery-settings { gap: 7px 12px; }
}

.sample-layout { display: grid; grid-template-columns: minmax(120px,195px) minmax(80px,115px); gap: 12px; margin: 10px 0; }
#garden-study button, #garden-previous { color: #f3e7ca; background: #252e31; border: 1px solid #75786f; border-radius: 5px; padding: 5px 8px; font-size: .77rem; }
#garden-previous { margin-top: 7px; }
#garden-study a { color: #d9c39a; text-decoration: underline; }
@media (max-width: 380px) {
  :is(#garden-paytable,#sample-prizes) strong { font-size: .73rem; white-space: nowrap; }
}

#station-nav { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 15px; }
#station-nav a { padding:7px 13px; background:#171e21; border:1px solid #4e595b; color:#e5e4d9; border-radius:18px; font-size:.86rem; }
#station-nav a[aria-current] { color:#172119; background:#dbcb9e; border-color:#f3e3b8; font-weight:750; }
#station-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px 15px; font-size:.82rem; margin:8px 0; }
#station-status strong { color:var(--accent); }
#station-status a { color:#fbe0a8; text-decoration:underline; }
#lottery #lottery-readout.station-view { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); align-items:center; }
#station-board { min-width:0; max-width:100%; width:100%; padding:8px; border:2px solid #997a48; border-radius:10px; background:linear-gradient(135deg,#223e33,#16241e 45%,#33291d); box-shadow:inset 0 0 0 2px #342c20; color:#fff2cf; }
#lottery[data-lottery=coral] #station-board { background:linear-gradient(155deg,#123f50,#0e2434 70%,#264a4a); }
.station-head { display:flex; flex-wrap:wrap; justify-content:space-between; gap:2px 8px; margin-bottom:6px; line-height:1.3; font-size:.88rem; }
.station-head span,#station-board>small { color:#ead698; font-size:.76rem; }
.station-grid,.column-odds { display:grid; gap:2px; grid-template-columns:repeat(6,minmax(0,1fr)); }
.station-cell { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; border-radius:3px; color:#152128; font-weight:800; line-height:1; font-size:clamp(.62rem,1.4vw,.95rem); min-height:14px; background:linear-gradient(145deg,#eae1b8,#ad8b52); box-shadow:inset 0 0 0 1px #0003,inset 0 2px 0 #fff3; }
.station-cell[data-shade="1"] { background:linear-gradient(145deg,#ffa095,#d9544a); }
.station-cell[data-shade="2"] { background:linear-gradient(145deg,#ffe289,#dcb439); }
.station-cell[data-shade="3"] { background:linear-gradient(145deg,#a1ea96,#63b983); }
.station-cell[data-shade="4"] { background:linear-gradient(145deg,#ffc3f1,#d886ce); }
.station-cell[data-shade="5"] { background:linear-gradient(145deg,#99dbff,#6a9fdc); }
.chain,.dama { margin:auto; width:min(100%,255px); background:#292d29; padding:3px; border:1px solid #8a754d; border-radius:5px; }
.chain .station-cell,.dama .station-cell { aspect-ratio:1.34; }
.station-cell.empty { background:#24302b; box-shadow:none; }
.station-cell.gem,.station-cell.prize { color:#ffe66f; background:radial-gradient(ellipse at 35% 30%,#897646,#53312c); border:1px solid #e1b361; }
.station-cell.bomb { color:#fff; border-radius:8px; background:radial-gradient(circle at 38% 22%,#a99dbd,#4b3c63 60%); }
.station-cell.orb { border-radius:50%; }
.column-odds { margin:2px auto 0; width:min(100%,255px); text-align:center; color:#e9cd79; font-size:clamp(.52rem,1.05vw,.7rem); }
.station-grid.stone { grid-template-columns:repeat(3,minmax(0,1fr)); max-width:205px; margin:6px auto; gap:5px; }
.stone .station-cell { aspect-ratio:1.4; }
.stone .lit,.tree-floor .lit,.jp-balls .lit,.islands .lit { outline:2px solid #ffdb68; outline-offset:-2px; color:#fff3bf; background:#386a4c; }
.tree-canopy { display:grid; gap:4px; background:linear-gradient(90deg,transparent 42%,#735135 42% 55%,transparent 55%); padding:4px 0; }
.tree-floor { display:flex; align-items:center; gap:3px; border-radius:14px 9px 6px 6px; background:linear-gradient(#527d4b,#234b39); border-bottom:3px solid #956943; padding:3px 5px; }
.tree-floor b { font-size:.73rem; min-width:25px; }
.tree-floor.current { border:1px solid #f3d584; border-bottom-width:3px; }
.tree-floor .station-cell { border-radius:50%; width:clamp(23px,4.3vw,39px); min-height:26px; background-color:#8bb5c2; }
.tree-floor .station-cell small { font-size:.49rem; }
.station-grid.islands,.station-grid.jp-balls { grid-template-columns:repeat(5,minmax(0,1fr)); padding:7px 0; gap:4px; }
.islands .station-cell,.jp-balls .station-cell { padding:7px 1px; }
#station-toggle { margin-top:6px; font-size:.78rem; }
#galaxy-link { position:relative; padding:12px 15px; margin:8px 0 12px; border:1px solid #9a82ab; border-radius:10px; color:#eee2fa; background:radial-gradient(ellipse at 83% 0,#59446d,#261f33 64%,#211d23); }
#galaxy-link h3 { display:inline-block; font-size:.99rem; margin:0 12px 0 0; }
#link-seats,#link-last,#galaxy-link details { font-size:.79rem; }
#galaxy-link .link-meter { margin:4px 0; color:#e9be71; }
.link-meter strong { font:750 clamp(1.6rem,3.2vw,2.3rem)/1.1 ui-monospace,monospace; letter-spacing:.035em; }
#link-balls { position:absolute; right:15px; top:13px; display:flex; gap:5px; }
#link-balls span { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; color:#ddd4e9; background:radial-gradient(circle at 30% 22%,#716381,#2c2237 68%); border:1px solid #8e7b9d; font-size:.69rem; }
#link-balls .special { color:#36250c; background:radial-gradient(circle at 30% 22%,#fff1ba,#d89f44); }
#link-last { margin:5px 0; }
#galaxy-link summary { cursor:pointer; }
@media(max-width:620px) {
  #lottery #lottery-readout.station-view { grid-template-columns:minmax(0,1fr); }
  #station-nav a { font-size:.78rem; padding:6px 10px; }
  #link-seats { display:block; }
}
.next-card { display:flex; align-items:center; justify-content:center; gap:5px; margin:5px; font:650 .67rem monospace; color:#e1cfa2; }
.mini-card { display:grid; width:54px; grid-template-columns:repeat(3,1fr); gap:1px; }
.mini-card .station-cell { min-height:9px; font-size:6px; }
.chain .station-cell:not(.empty) { border:1px solid #fff5; box-shadow:inset 0 2px 2px #fff8,inset 0 -3px 4px #0006,0 1px 2px #040a08; }
.chain .gem { font-size:1.18em; color:#fff18b; text-shadow:0 0 7px #ffbb32; }
.chain .bomb { border-radius:32%; text-shadow:0 1px 2px #000; }
.column-odds b { padding:2px 0; white-space:nowrap; }
.column-odds .apple-column { color:#bcf28f; border-bottom:3px solid #8bc86d; }
.dama .orb { position:relative; height:100%; justify-content:flex-end; border:1px solid #fff5; box-shadow:inset 2px 3px 3px #fffc,inset -2px -4px 4px #0005; }
.orb::before { content:""; position:absolute; left:29%; right:29%; top:29%; height:19%; background:radial-gradient(ellipse closest-side at 14% 50%,#3f3234 84%,transparent 100%),radial-gradient(ellipse closest-side at 86% 50%,#3f3234 84%,transparent 100%); }
.dama .orb small { display:block; padding-bottom:1px; font-size:clamp(.45rem,.8vw,.65rem); line-height:1.2; white-space:nowrap; }
.dama .orb.item { outline:2px solid #ffe6a2; outline-offset:-2px; }
.tree-canopy { border-radius:12px; padding:10px 5px 5px; background:radial-gradient(ellipse at 15% 0,#88b25b88,transparent 40%),linear-gradient(90deg,#1a4536 39%,#533c24 42%,#9a7547 47%,#775130 56%,#284d36 60%); }
.tree-floor { box-shadow:inset 0 3px 3px #9ccc7040,0 2px 2px #17140f8c; }
.tree-floor .station-cell { box-shadow:inset 1px 2px 3px #fffd,inset -2px -3px 3px #0004; }

/* The photographic cabinet and the close-up use a common window and control deck. */
.lottery-stage {
  padding: 5px; gap: 3px;
  border: 1px solid #4d5658; border-radius: 14px 14px 9px 9px;
  background: linear-gradient(155deg,#c4bca7 0%,#4f5558 .8%,#222d31 12%,#3c4549 54%,#8a8278 86%,#2c3437 98%);
  box-shadow: inset 0 0 0 1px #acaaa480,0 3px 0 #121a1d,0 5px 12px #07101555;
}
#cabinet-photo, .lottery-glass { border-radius: 7px; overflow: hidden; }
#cabinet-photo { border: 1px solid #090f15; }
.lottery-glass {
  border: 2px solid #171b1e;
  box-shadow: inset 0 0 0 1px #958d79;
  background: linear-gradient(160deg,#363e40,#17212b 47%,#090f18);
}
.stage-caption {
  align-self: stretch; padding: 7px 9px; margin: 4px 5px 0;
  border: 1px solid #495558; border-bottom-color: #6c7171; border-radius: 4px;
  background: linear-gradient(172deg,#19292f,#0b151b 58%,#182328);
  box-shadow: inset 0 2px 4px #050c10b0;
}
#ball-count { color: var(--accent); font-variant-numeric: tabular-nums; }
#ring-stages li[aria-current] { text-decoration: underline; text-underline-offset: 3px; }
#station-board {
  border-color: #776b50; box-shadow: inset 0 0 0 2px #252623,inset 0 0 14px #06101185,0 1px 0 #aaa28773;
}
#lottery-readout .station-grid:not(.mini-card), #bingo-card {
  background-image: linear-gradient(145deg,#3f3e32,#141d1f 48%,#3f4037);
  box-shadow: inset 0 1px 4px #0c1418;
}
#draw-trace li {
  border-color: #768185; border-bottom-color: #252c30; background: radial-gradient(ellipse at 36% 16%,#536471,#25313b 65%,#192329);
  box-shadow: inset 0 1px 0 #effaff47,0 1px 2px #080e1399;
}
#draw-trace li[data-color] {background:radial-gradient(ellipse at 34% 15%,#36474c,#19232d);box-shadow:inset 0 -2px 0 var(--ball-color);}
#draw-trace li.special { background: radial-gradient(ellipse at 34% 20%,#806644,#45341b); }
@media (prefers-reduced-motion:no-preference) {
  .tile-drops { animation: medal-tile-fall 340ms ease-out both; }
  .medal-impact { animation: medal-hit 450ms ease-out; }
  .floor-arrival { animation: medal-floor 420ms ease-out; }
}
@keyframes medal-tile-fall {
  0% { transform: translateY(-42%); opacity:.65; }
  66% { transform: translateY(5%) scaleY(.92); opacity:1; }
  86% { transform: translateY(-4%); }
  100% { transform:none; }
}
@keyframes medal-hit {
  25% { box-shadow: inset 0 0 7px 2px #fff1aa,0 0 6px #ffc95d; }
}
@keyframes medal-floor {
  25% { transform:translateY(3px); filter:brightness(1.28); }
}
