﻿:root{font-family:"Yu Gothic",Meiryo,sans-serif;color:#fff7e8;background:#bd2035;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 35%,#e34d54,#bd2035 75%);min-height:100dvh}button{font:inherit;cursor:pointer;border:1px solid #ffffff45;background:#ffffff12;color:inherit;border-radius:8px;padding:8px 15px}button:hover{background:#ffffff25}button:focus,button:focus-visible{outline:none}header{height:5dvh;min-height:36px;padding:0 2vw;display:flex;justify-content:space-between;align-items:center;gap:12px}.brand{font-weight:900;letter-spacing:3px;font-size:clamp(12px,1.2vw,20px)}.tools{display:flex;gap:8px}.tools button{font-size:clamp(10px,1vw,15px);padding:5px 12px}.stage{height:52dvh;display:grid;place-items:center;overflow:hidden}#ball{height:100%;width:100%;display:grid;place-items:center}#number{font-family:"Arial Black",Arial,sans-serif;font-size:min(47.6dvh,32.9vw);font-weight:900;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.055em;padding-right:.055em;color:#fff8dc;text-shadow:0 .012em 0 #841b2c;display:block}.controls{text-align:center;padding:0 3vw}#announcement{font-size:clamp(12px,1.6dvh,20px);min-height:2.4dvh;margin:0 0 1dvh}.draw{width:min(460px,75vw);height:7dvh;min-height:42px;background:#ffda75;color:#703625;border:2px solid #fff1bf;border-radius:50px;font-size:clamp(19px,3dvh,32px);font-weight:900;letter-spacing:.15em;box-shadow:0 4px 0 #863327}.draw:hover{background:#ffe6a0}.draw:active{transform:translateY(3px);box-shadow:none}.draw:disabled{opacity:.6;cursor:default}.details{display:flex;justify-content:center;align-items:center;gap:25px;margin:1.4dvh auto;font-size:clamp(10px,1.3dvh,15px);min-height:3dvh}.details b{color:#ffe093}.keyboard{opacity:.7}.history-panel{min-height:6dvh;display:flex;align-items:center;justify-content:center;gap:20px;padding:6px 2vw;border-top:1px solid #ffffff25;background:#791e2d25;font-size:11px}.history-panel>span{opacity:.7}ol{list-style:none;display:flex;flex-wrap:wrap;gap:8px;padding:0;margin:0;min-height:30px;align-items:center}ol li{width:30px;height:30px;border:1px solid #ffffff55;border-radius:50%;display:grid;place-items:center;font:bold 15px Arial}ol li:last-child{background:#ffda75;color:#703625;border-color:#ffda75}ol:empty:after{content:'—';opacity:.6}#save-note{font-size:10px}.rolling #number{opacity:.95}.reveal #number{animation:pop .42s ease-out}dialog{border:0;border-radius:18px;max-width:90vw;padding:28px;color:#433831;box-shadow:0 20px 80px #0004}dialog::backdrop{background:#25131b99}dialog h2{font-size:19px}dialog p{font-size:13px;margin:18px 0 25px}dialog>div{display:flex;justify-content:flex-end;gap:10px}dialog button{color:#433831;border:1px solid #e2dacc;background:#fffaf0}#confirm-reset{background:#c9293a;color:white}@keyframes pop{0%{transform:scale(.85)}65%{transform:scale(1.05)}100%{transform:scale(1)}}@media(max-width:600px){header{height:auto;min-height:50px;padding:10px;align-items:flex-start}.brand{font-size:11px;white-space:nowrap}.tools{flex-wrap:wrap;justify-content:flex-end;gap:4px}.tools button{font-size:9px;padding:4px 7px}.stage{height:50dvh}#number{font-size:min(42dvh,53.2vw)}.details{gap:10px;flex-wrap:wrap}.keyboard{display:none}.history-panel{gap:8px;flex-wrap:wrap}#save-note{display:none}ol{gap:5px}ol li{width:25px;height:25px;font-size:12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important}}

.history-panel{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;max-width:1600px;margin:0 auto;padding:16px 2vw;gap:16px}.history-panel>span{padding-top:10px}ol{min-height:0;gap:8px;align-content:start}ol li{width:40px;height:40px;font-size:20px;flex-shrink:0}@media(max-width:600px){.history-panel{grid-template-columns:1fr;padding:12px 15px;gap:10px}.history-panel>span{padding-top:0}ol{gap:6px}ol li{width:30px;height:30px;font-size:15px}}


/* Both characters flank the entire number, controls and history area. */
.machine{display:grid;grid-template-columns:minmax(0,24fr) minmax(0,52fr) minmax(0,24fr);grid-template-rows:auto auto auto;align-content:start;column-gap:1vw;padding:0 1vw 1dvh}
.stage,.controls,.history-panel{grid-column:2;min-width:0}
.stage{grid-row:1;grid-template-columns:1fr;padding:0;height:52dvh}
.controls{grid-row:2;padding:0}
#ball{min-width:0}
.mascot{display:block;grid-row:1 / 4;align-self:center;width:100%;height:88dvh;max-height:950px;object-fit:contain;pointer-events:none;user-select:none}
.mascot-left{grid-column:1}.mascot-right{grid-column:3}
.history-panel{grid-row:3;display:grid;grid-template-columns:1fr auto;gap:10px;width:100%;max-width:none;margin:0;padding:12px 10px;align-content:start;border-radius:12px}
.history-panel>span{padding-top:0}
#save-note{grid-column:2;grid-row:1}
#history{grid-column:1 / -1;display:grid;grid-template-columns:repeat(20,minmax(0,1fr));gap:6px;min-height:0}
#history li{width:100%;height:clamp(24px,3.5dvh,38px);min-width:0;font-size:clamp(12px,1.7dvh,19px)}
#history:empty:after{content:none}
.details{gap:14px;flex-wrap:wrap}
@media(max-width:900px){.machine{grid-template-columns:minmax(0,18fr) minmax(0,64fr) minmax(0,18fr);column-gap:0}.mascot{height:80dvh}#history{gap:3px}#history li{font-size:12px;height:26px}.history-panel{padding:10px 4px}}
@media(max-width:600px){.stage{height:44dvh}#number{font-size:min(38dvh,43vw)}.mascot{height:70dvh}.history-panel{grid-template-columns:1fr;gap:8px}#history{grid-template-columns:repeat(10,minmax(0,1fr))}#history li{height:24px;font-size:11px}}

/* Let the opening logo use the space beyond the number column. */
.stage:has(.opening-logo:not([hidden])){overflow:visible;position:relative;z-index:1}
.opening-logo{display:block;width:min(130%,1200px);max-width:none;max-height:min(38dvh,400px);object-fit:contain;height:auto;justify-self:center}
@media(max-width:900px){.opening-logo{width:110%;max-height:32dvh}}
#number[hidden],.opening-logo[hidden]{display:none}

/* Keep the recent results and complete number board below the controls. */
.machine{grid-template-rows:auto auto auto auto}
.mascot{grid-row:1 / 5}
.stage{height:46dvh}
#number{font-size:min(44dvh,32.9vw)}
.history-panel{min-height:0;margin-bottom:8px;padding:9px 10px;gap:7px}
.number-panel{grid-column:2;grid-row:4;min-width:0;padding:10px;border-radius:12px;background:#791e2d45;border:1px solid #ffffff30}
.number-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.number-panel h2{font-size:13px;margin:0}.number-panel-heading>span{font-size:10px;opacity:.8}
#number-board{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));gap:5px;min-height:0}
#number-board li{position:relative;display:grid;place-items:center;width:100%;height:clamp(25px,3dvh,34px);min-width:0;border-radius:5px;border:1px solid #ffffff28;background:#551324;color:#e3a9ad;font-size:clamp(13px,1.7dvh,19px);font-weight:bold}
#number-board li.called{background:#ffda75;color:#54271b;border-color:#fff1be}
#number-board li.latest{outline:2px solid white;outline-offset:0}
#number-board:empty:after{content:none}
@media(max-width:600px){.stage{height:40dvh}#number{font-size:min(36dvh,43vw)}.number-panel{padding:7px 4px}.number-panel-heading{flex-direction:column;align-items:flex-start;gap:4px}#number-board{gap:3px}#number-board li{height:24px;font-size:11px}}

/* Prevent intrinsic logo height from enlarging its grid row. */
#ball{min-height:0}
/* Reserve the same result rows before the first number is drawn. */
#history{--history-cell-height:clamp(24px,3.5dvh,38px);grid-auto-rows:var(--history-cell-height);min-height:var(--history-cell-height)}
#history li{height:var(--history-cell-height)}
@media(max-width:900px){#history{--history-cell-height:26px}}
@media(max-width:600px){#history{--history-cell-height:24px;min-height:51px}}
