* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: #000; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; font-family: "Press Start 2P", monospace; color: #fff;
}
#game { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; }
#ui { position: absolute; left: 0; top: 0; z-index: 2; }
.screen { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }

#title { background: #000 url(assets/arena.png) center / cover no-repeat; }
#title::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.25), rgba(0,0,0,.8)); }
.titlebox { position: relative; text-align: center; padding: 12px; }
h1 {
  margin: 0 0 .35em; font-size: clamp(28px, 7.5vmin + 2vw, 72px); line-height: 1.08; color: #ffd23a; letter-spacing: 3px;
  text-shadow: 0 4px 0 #c0360c, 0 8px 0 #4a0a00, 0 0 28px rgba(255,120,0,.7);
}
h1 span { display: block; }
.sub { font-size: clamp(8px, 1.8vmin + .4vw, 13px); color: #ffe9c0; margin: 0 0 1.3em; text-shadow: 2px 2px 0 #000; line-height: 1.6; }
.btn {
  display: block; margin: 9px auto; font: inherit; font-size: clamp(10px, 2.2vmin + .3vw, 14px); color: #fff;
  background: #a81c0e; border: 3px solid #ffd23a; padding: 11px 20px; box-shadow: 0 4px 0 #4a0a00; cursor: pointer; min-width: 230px;
}
.btn.big { background: #d8401a; font-size: clamp(12px, 2.8vmin + .3vw, 18px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a0a00; }
.hint { font-size: 8px; color: #ddd; margin-top: 1.2em; line-height: 1.9; text-shadow: 1px 1px 0 #000; }

#pause, #moves, #end { background: rgba(0,0,0,.65); }
.panel {
  background: rgba(12,6,16,.94); border: 3px solid #ffd23a; padding: 16px 22px; max-height: 94vh; max-width: 96vw;
  overflow: auto; text-align: center; box-shadow: 0 0 0 4px #000; touch-action: pan-y; -webkit-overflow-scrolling: touch;
}
.panel h2 { color: #ffd23a; margin: 0 0 12px; font-size: 18px; text-shadow: 3px 3px 0 #b4300a; }
.note { font-size: 8px; color: #aaa; margin: 0 0 6px; }
.movelist { text-align: left; font-size: 9px; line-height: 1.7; }
.movelist h3 { color: #ff7a3a; font-size: 10px; margin: 14px 0 6px; }
.movelist .row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 12px; align-items: center; padding: 2px 0; border-bottom: 1px dashed #333; }
.inp { color: #7fe0ff; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.endtxt { font-size: 10px; line-height: 1.8; color: #ffe9c0; }

#rotate {
  position: fixed; inset: 0; z-index: 50; background: #000; color: #ffd23a; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; font-size: 13px; line-height: 2;
}
.rotIcon { font-size: 64px; font-family: system-ui, sans-serif; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
