* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3fa9f5; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
body { font-family: 'Press Start 2P', monospace; color: #1f2340; }

/* The game is drawn on a fixed 1194 x 834 board and scaled to fit the screen. */
#stage { position: absolute; left: 50%; top: 50%; width: 1194px; height: 834px; transform-origin: center center; overflow: hidden; background: #3fa9f5; }
#rotate { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; background: #3fa9f5; color: #fff; font-size: 16px; line-height: 1.8; text-shadow: 3px 3px 0 #1f2340; }
#rotate[hidden] { display: none; }

.px { shape-rendering: crispEdges; display: block; }
.body { font-family: 'Jersey 20', 'Trebuchet MS', sans-serif; }
.abs { position: absolute; }
.cx { transform: translateX(-50%); }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }

button { font: inherit; color: inherit; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 0; }
button:active { transform: translate(2px, 2px); }
button.cx:active { transform: translateX(-50%) translate(2px, 2px); }
button[disabled] { opacity: .45; cursor: default; }
input { font: inherit; color: inherit; border-radius: 0; -webkit-appearance: none; appearance: none; -webkit-user-select: text; user-select: text; }

.plate { display: inline-block; background: #fff; border: 4px solid #1f2340; padding: 7px 9px; font-size: 10px; line-height: 1; white-space: nowrap; }
.frame { position: absolute; background: #fff; border: 4px solid #1f2340; box-shadow: 6px 6px 0 rgba(31, 35, 64, .35); }
.btn { background: #fff; border: 4px solid #1f2340; line-height: 1; }
.btn.go { background: #45b649; }
.ring { box-shadow: 0 0 0 4px #ffd43b, 0 0 0 8px #1f2340; }
.title { position: absolute; left: 597px; top: 26px; transform: translateX(-50%); font-size: 17px; line-height: 1; color: #fff; text-shadow: 3px 3px 0 #1f2340; white-space: nowrap; }
.dim { color: #4a5170; }

.tile { position: absolute; width: 48px; height: 48px; border: 4px solid #1f2340; font-size: 18px; line-height: 1; }
.node { position: absolute; width: 60px; height: 60px; border: 4px solid #1f2340; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }

.opt { height: 74px; background: #fff; border: 4px solid #1f2340; font-family: 'Jersey 20', 'Trebuchet MS', sans-serif; font-size: 40px; line-height: 1; }
.opt.sel { background: #ffd43b; box-shadow: 0 0 0 4px #ffd43b, 0 0 0 8px #1f2340; }
.opt.right { background: #7fe08f; box-shadow: 0 0 0 4px #45b649, 0 0 0 8px #1f2340; }
.opt.wrong { background: #ffb3b3; }
.opt.gone { visibility: hidden; }
.blank { background: #fff3bf; border-bottom: 4px solid #1f2340; padding: 0 14px; min-width: 90px; display: inline-block; text-align: center; }
.blank.right { background: #c8f7c5; }

.seg { width: 52px; height: 22px; border: 4px solid #1f2340; background: #e9f6ff; }
.seg.ok { background: #45b649; }
.seg.no { background: #ff8f8f; }
.seg.now { background: #ffd43b; }

.toast { position: absolute; left: 597px; top: 380px; transform: translateX(-50%); z-index: 5; background: #1f2340; color: #fff; border: 4px solid #fff; padding: 16px 20px; font-size: 13px; line-height: 1.6; text-align: center; white-space: nowrap; }

@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pop { animation: pop .45s steps(6) both; }
.bob { animation: bob 1s steps(4) infinite; }
@media (prefers-reduced-motion: reduce) { .pop, .bob { animation: none; } }
