/* Hole Swallow — GameCMB (gamecmb.com) */
:root {
  --bg: #120a26;
  --bg2: #1a1033;
  --panel: rgba(24, 14, 52, 0.92);
  --ink: #f4efff;
  --muted: #b7a9e0;
  --accent: #a78bfa;
  --accent2: #ff5ec4;
  --good: #7cff6b;
  --gold: #ffd60a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* [hidden] must always win over any display rule below (standing convention) */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #2a1760 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font-family: var(--font); line-height: 1.55;
}
a { color: #c9b8ff; }
button { font-family: inherit; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; color: #000; padding: 6px 10px; border-radius: 6px; }

.site-header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; max-width: 1240px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .5px; }
.brand-dot { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #000 45%, #6d28d9 70%, #a78bfa 100%); box-shadow: 0 0 10px #a78bfa; }
.crumbs { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs span { margin: 0 3px; }

.game-wrap { max-width: 1240px; margin: 0 auto; padding: 0 12px; }
.stage {
  position: relative; width: 100%; height: min(calc(100vh - 110px), 780px); min-height: 440px;
  border-radius: 18px; overflow: hidden; background: #0c0718; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(167,139,250,.25);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

.corner-btns { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; z-index: 5; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(20,12,45,.7); color: #fff; font-size: 17px; cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}
.icon-btn:hover { background: rgba(60,40,120,.85); }

.countdown {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; pointer-events: none;
  font-weight: 900; font-size: clamp(64px, 14vw, 140px); color: #fff; letter-spacing: 2px;
  text-shadow: 0 6px 0 #5b21b6, 0 0 40px rgba(167,139,250,.9);
}
.countdown.pop { animation: pop .6s ease-out; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

.respawn {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 6; text-align: center; pointer-events: none;
  background: rgba(15,6,35,.78); padding: 16px 26px; border-radius: 16px; box-shadow: 0 0 0 2px rgba(255,56,96,.6);
}
.respawn-title { font-weight: 900; font-size: 34px; color: #ff3860; letter-spacing: 1px; }
.respawn-by { color: #fff; font-weight: 700; font-size: 15px; }
.respawn-bar { margin-top: 10px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.respawn-bar i { display: block; height: 100%; width: 0; background: #fff; }
.respawn.run .respawn-bar i { animation: fill 2s linear forwards; }
@keyframes fill { to { width: 100%; } }

.screen { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.screen.menu { background: linear-gradient(180deg, rgba(12,6,28,.25), rgba(12,6,28,.55)); }
#pause, #over { background: rgba(10,5,24,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

.menu-card, .panel {
  width: min(460px, 100%); background: var(--panel); border-radius: 22px; padding: 22px 20px 18px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(167,139,250,.35); margin: auto;
}
.logo { font-weight: 900; font-size: clamp(30px, 8vw, 44px); line-height: 1; letter-spacing: 1px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.logo b { color: var(--accent); font-weight: 900; }
.logo-hole { flex: 0 0 auto; width: .9em; height: .9em; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #000 42%, #3b0f7a 68%, #a78bfa 100%); box-shadow: 0 0 18px #a78bfa; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tagline { color: var(--muted); margin: 8px 0 14px; font-weight: 600; }

.map-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.map-card {
  position: relative; border: 0; border-radius: 14px; padding: 10px 4px 8px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); transition: transform .12s;
}
.map-card:hover { transform: translateY(-2px); }
.map-card.active { background: rgba(167,139,250,.22); box-shadow: inset 0 0 0 2px var(--accent); }
.map-emoji { font-size: 26px; }
.map-card b { font-size: 13px; }
.map-card small { font-size: 11px; color: var(--muted); }
.map-badge { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9px; font-weight: 800; white-space: nowrap;
  background: var(--accent2); color: #fff; padding: 1px 6px; border-radius: 8px; text-transform: uppercase; letter-spacing: .3px; }

.btn {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; font-size: 15px; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn-primary { background: linear-gradient(180deg, #b69cff, #7c3aed); box-shadow: 0 5px 0 #4c1d95, 0 8px 20px rgba(124,58,237,.45); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #4c1d95; }
.btn-big { width: 100%; font-size: 22px; padding: 15px; letter-spacing: 1px; }
.btn-daily { width: 100%; margin-top: 12px; background: linear-gradient(180deg, #ff8fd8, #db2777); box-shadow: 0 4px 0 #9d174d; flex-direction: column; gap: 0; }
.btn-daily small { font-weight: 600; font-size: 11px; opacity: .9; }
.btn-ghost { background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn:disabled { opacity: .6; cursor: wait; }
.menu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.menu-row .btn { padding: 10px 4px; font-size: 12.5px; }
.menu-stats { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }

.panel h2 { margin: 0 0 14px; }
.panel > .btn { width: 100%; margin-top: 8px; }

.over-card { width: min(480px, 100%); padding: 18px 18px 16px; }
.place { font-size: 40px; font-weight: 900; line-height: 1; color: #fff; }
.place.p1 { color: var(--gold); text-shadow: 0 0 20px rgba(255,214,10,.6); }
.over-title { font-weight: 900; letter-spacing: 1px; color: var(--muted); font-size: 13px; margin-top: 4px; }
.score-big { font-size: 46px; font-weight: 900; line-height: 1.1; margin-top: 6px; }
.best { color: var(--muted); font-weight: 700; font-size: 13px; }
.best.new { color: var(--gold); }
.over-pct { margin: 6px 0 8px; font-weight: 700; }
.over-pct b { color: var(--accent2); font-size: 1.15em; }
.over-stats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; text-align: left; font-size: 13px; }
.over-stats li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed rgba(255,255,255,.1); padding: 2px 0; }
.over-stats span { color: var(--muted); }
.nick-form { margin: 6px 0; text-align: left; }
.nick-form label { font-size: 12px; color: var(--muted); font-weight: 700; }
.nick-row { display: flex; gap: 8px; margin-top: 4px; }
.nick-row input { flex: 1; min-width: 0; border-radius: 12px; border: 2px solid rgba(167,139,250,.5); background: rgba(0,0,0,.3); color: #fff; padding: 10px 12px; font-size: 16px; font-weight: 700; }
.nick-row input:focus { outline: none; border-color: var(--accent); }
.nick-msg { color: #ff8fa3; font-size: 13px; margin: 4px 0 0; min-height: 1em; }
.save-status { font-size: 13px; color: var(--good); margin: 4px 0; font-weight: 700; }
.unlock-hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.over-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.over-btns .btn { flex: 1 1 26%; padding: 10px 4px; font-size: 13px; }
.over-btns .btn-primary { flex-basis: 100%; font-size: 18px; padding: 13px; }

.tl { pointer-events: none; align-items: flex-end; background: none; }
.tl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.12); }
.tl-bar i { display: block; height: 100%; width: 0; background: var(--accent2); }
.tl-skip { position: absolute; right: 12px; top: 12px; pointer-events: auto; padding: 8px 12px; font-size: 13px; }

.toasts { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92%, 380px); }
.toasts.top { bottom: auto; top: 12px; }
.toast { background: rgba(20,10,45,.94); border-radius: 12px; padding: 8px 14px; font-size: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); text-align: center; animation: tin .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.ach { box-shadow: 0 0 0 2px var(--gold); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.boot-error { position: absolute; inset: auto 16px 16px; z-index: 20; background: #7f1d1d; color: #fff; padding: 12px; border-radius: 10px; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(6,3,16,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { position: relative; width: min(520px, 100%); max-height: 88vh; overflow-y: auto; background: var(--bg2); border-radius: 20px; padding: 22px 20px; box-shadow: 0 0 0 1px rgba(167,139,250,.4), 0 30px 80px rgba(0,0,0,.6); }
.modal-box h2 { margin: 0 0 12px; }
.modal-x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font-size: 16px; }
.how-list { padding-left: 20px; }
.how-list li { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.modal-box > .btn { width: 100%; margin-top: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { flex: 1; border: 0; border-radius: 10px; padding: 8px; background: rgba(255,255,255,.08); color: #fff; font-weight: 800; cursor: pointer; }
.tab.active { background: var(--accent); color: #1a0b3d; }
.board-map { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.board-map select { background: #2a1b52; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 8px; }
.board-list { list-style: none; padding: 0; margin: 8px 0 0; }
.board-list li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.board-list li:nth-child(odd) { background: rgba(255,255,255,.04); }
.board-list li.me { background: rgba(167,139,250,.28); box-shadow: inset 0 0 0 1px var(--accent); }
.board-list li.muted { display: block; text-align: center; }
.board-list .rk { font-weight: 900; text-align: center; }
.board-list .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .sz { color: var(--muted); font-size: 12px; }
.board-list .sc { font-weight: 900; }
.skin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skin { border: 0; border-radius: 14px; background: rgba(255,255,255,.06); color: #fff; padding: 12px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.06); }
.skin.active { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(167,139,250,.16); }
.skin.locked { opacity: .55; cursor: default; }
.skin small { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.swatch { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #000 48%, var(--rim2) 74%, var(--rim) 88%, transparent 90%); box-shadow: 0 0 12px var(--rim); }
.swatch.rainbow { background: radial-gradient(circle at 50% 45%, #000 48%, transparent 72%), conic-gradient(#ff5ec4, #ffd60a, #7cff6b, #4cc9f0, #a78bfa, #ff5ec4); }
.ach-list { list-style: none; padding: 0; margin: 0; }
.ach-list li { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.ach-list li small { grid-column: 2; color: var(--muted); font-size: 12px; }
.ach-list li.done b { color: var(--good); }

.ad-slot { min-height: 0; margin: 12px auto 0; text-align: center; }

.seo { max-width: 860px; margin: 32px auto 0; padding: 0 18px 24px; }
.seo h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; }
.seo h2 { margin-top: 28px; color: #e2d9ff; }
.seo h3 { margin: 18px 0 4px; font-size: 17px; }
.seo .lede { font-size: 17px; }
.seo table { border-collapse: collapse; width: 100%; font-size: 15px; }
.seo th, .seo td { border-bottom: 1px solid rgba(255,255,255,.12); padding: 8px 6px; text-align: left; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 36px; }

@media (max-width: 640px) {
  .site-header { padding: 8px 12px; }
  .crumbs { display: none; }
  .game-wrap { padding: 0; }
  .stage { height: calc(100svh - 46px); min-height: 480px; border-radius: 0; }
  .menu-card, .panel { padding: 16px 14px 14px; border-radius: 18px; }
  .score-big { font-size: 38px; }
  .map-emoji { font-size: 22px; }
  .over-stats { font-size: 12.5px; grid-template-columns: 1fr; }
  .over-stats li { padding: 1px 0; }
  .corner-btns { left: 8px; bottom: 8px; }
  .toasts { bottom: 96px; }
  .icon-btn { width: 38px; height: 38px; font-size: 15px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .stage { height: calc(100svh - 10px); }
  .site-header { display: none; }
  .tagline, .menu-stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-hole { animation: none; }
  .countdown.pop { animation: none; }
}
