/* MIGORY Arcade — additions on top of migory.com's site.css (same tokens, same type, same buttons). */
.brand .arc { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--accent); margin-left: 4px; vertical-align: 3px; }
.chip.who { text-decoration: none; color: var(--fg); }
@media (max-width: 700px) { .chip.who { display: none; } }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.ok { color: var(--accent); }
.err { color: #ff6b5c; }

/* home */
.arc-hero { min-height: 0; padding-block: clamp(36px, 6vw, 80px) clamp(24px, 4vw, 48px); }
.arc-hero::before { background: radial-gradient(ellipse at 70% 30%, rgba(51,214,255,.12), transparent 60%), radial-gradient(ellipse at 20% 0%, rgba(62,241,19,.10), transparent 55%); }
.arc-hero .wrap { padding: 0; }
.arc-hero .h-xl { font-size: clamp(40px, 6.4vw, 84px); }
.arc-hero .lead { max-width: 40ch; }
.shot { display: block; aspect-ratio: 16 / 9; background: #000; }
.shot img { object-fit: contain; }
.btn.play-now { font-size: 16px; padding: 16px 26px; }
.cast { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cast li { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 8px; align-content: start; }
.cast li img { height: 112px; width: auto; justify-self: start; margin-bottom: 6px; }
.cast h3 { font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cast h3 .chip { font-size: 10px; padding: 3px 7px; }
.cast p { color: var(--soft); font-size: 14.5px; line-height: 1.5; }
.board-panel { padding: clamp(12px, 2vw, 22px); display: grid; gap: 14px; }
.board-empty { padding: 8px 4px; }

/* leaderboards */
.board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board td { padding: 11px 10px; border-bottom: 1px solid rgba(36,48,36,.6); white-space: nowrap; }
.board .rk { width: 3em; font-family: var(--display); font-weight: 800; color: var(--accent); }
.board .sc { text-align: right; font-family: var(--display); font-weight: 600; }
.board .tm { font-family: var(--mono); font-size: 13px; color: var(--soft); }
.board .nm a { color: var(--fg); text-decoration: none; font-weight: 500; }
.board .nm a:hover { color: var(--accent); }
.board tr.me td { background: rgba(62,241,19,.07); }
.board tr.gap td { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 18px; }
.board tr.removed td { opacity: .5; }
.board tbody tr:first-child .rk { color: #ffd23f; }
.board-tabs a { font-family: var(--display); font-weight: 600; }
.board-tabs a[aria-selected="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.week-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.archive summary { cursor: pointer; font-family: var(--display); font-weight: 600; padding: 8px 0; }
.archive .subnav { margin-top: 8px; }
.archive a[aria-current="page"], .subnav a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.provisional { border-color: rgba(255,201,74,.5); color: #ffe4a3; }

/* login / profile / share */
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #6d78ff; }
.callout.err { border-color: rgba(255,107,92,.5); color: #ffd0ca; }
.ok-box { border-color: rgba(62,241,19,.45); }
.name-form { padding: 18px 20px; display: grid; gap: 10px; }
.row-in { display: flex; gap: 10px; flex-wrap: wrap; }
.row-in input { flex: 1 1 220px; min-width: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; }
.row-in input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.profile .panel { padding: 18px 20px; display: grid; gap: 12px; }
.prog-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 640px) { .prog-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.prog-grid .pl { border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; background: var(--panel2); display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.prog-grid .pl b { font-family: var(--display); color: var(--fg); font-size: 14px; }
.prog-grid .pl.done { border-color: rgba(62,241,19,.5); color: var(--accent); }
.share-card { display: flex; gap: 20px; align-items: center; background: radial-gradient(ellipse at 0% 0%, rgba(62,241,19,.16), transparent 60%), var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(18px, 3vw, 30px); }
.share-score { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 8vw, 72px); line-height: 1; color: var(--accent); margin: 6px 0 8px !important; }
.share-card .chip { margin-top: 10px !important; }

/* ───────────── the game ───────────── */
.page-game .foot { margin-top: 32px; }
.game-section { padding-block: clamp(12px, 2.5vw, 28px) 0; }
.sbe { position: relative; max-width: 1152px; margin-inline: auto; }
.sbe-stage {
  position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 30px 90px -40px rgba(62,241,19,.35);
}
.sbe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.sbe-topbtns { position: absolute; top: 7.5%; right: 1.2%; display: flex; gap: 6px; z-index: 3; }
.sbe-topbtns button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(3,4,3,.6); color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.sbe-topbtns button:hover { border-color: var(--accent); }
.sbe-topbtns button[hidden] { display: none; }
.sbe-overlay { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: clamp(10px, 3%, 28px); background: rgba(3,4,3,.5); overflow: auto; }
.sbe-overlay[hidden] { display: none; }
.sbe-overlay.is-title { background: linear-gradient(90deg, rgba(3,4,3,.82) 0%, rgba(3,4,3,.35) 70%, rgba(3,4,3,.1) 100%); place-items: center start; }
.sbe-panel { background: rgba(13,16,13,.94); border: 1px solid var(--line); border-radius: 16px; padding: clamp(14px, 2.2vw, 26px); width: min(560px, 100%); display: grid; gap: 12px; }
.sbe-title { background: transparent; border: 0; padding: clamp(8px, 2vw, 28px); }
.sbe-logo { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 4.6vw, 52px); line-height: .95; letter-spacing: .01em; text-shadow: 0 3px 0 #000; }
.sbe-logo em { color: var(--accent); font-style: normal; display: block; }
.sbe-panel h2 { font-family: var(--display); font-size: clamp(18px, 2.4vw, 26px); line-height: 1.1; }
.sbe-panel h3 { font-family: var(--display); font-size: 13px; color: var(--edge, var(--accent)); margin-top: 6px; letter-spacing: .02em; }
.sbe-menu { display: grid; gap: 8px; }
.sbe-menu.row { display: flex; flex-wrap: wrap; }
.sbe-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sbe-btn { font-family: var(--display); font-weight: 600; font-size: 14px; border-radius: 12px; padding: 13px 18px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg); cursor: pointer; text-align: left; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; justify-content: flex-start; }
.sbe-btn small { font-family: var(--mono); font-size: 11px; font-weight: 500; opacity: .75; margin-left: auto; }
.sbe-btn:hover, .sbe-btn:focus-visible { border-color: var(--accent); }
.sbe-btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.sbe-btn.primary:hover { background: #5cff36; }
.sbe-btn.ghost { background: rgba(3,4,3,.4); }
.sbe-btn.sm { padding: 9px 12px; font-size: 12.5px; }
.sbe-btn[disabled] { opacity: .5; cursor: progress; }
.sbe-small { font-size: 13px; line-height: 1.5; color: var(--soft); }
.sbe-small a { color: var(--accent); }
.sbe-small.muted, .sbe-panel .muted { color: var(--muted); }
.sbe-challenge { background: rgba(62,241,19,.12); border: 1px dashed rgba(62,241,19,.6); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.sbe-rules ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14.5px; color: var(--soft); }
.sbe-rules li::marker { color: var(--accent); font-family: var(--mono); font-weight: 700; }
.sbe-levels { width: min(860px, 100%); }
.sbe-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sbe-lvl { border: 1px solid var(--line); background: var(--panel2); color: var(--fg); border-radius: 10px; padding: 8px; display: grid; gap: 2px; text-align: left; cursor: pointer; min-width: 0; }
.sbe-lvl b { font-family: var(--display); font-size: 15px; }
.sbe-lvl span { font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbe-lvl small { font-family: var(--mono); font-size: 10px; color: var(--accent); }
.sbe-lvl.done { border-color: rgba(62,241,19,.45); }
.sbe-lvl:hover:not([disabled]), .sbe-lvl:focus-visible { border-color: var(--accent); }
.sbe-lvl.locked { opacity: .45; cursor: not-allowed; }
.sbe-intro { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; }
.sbe-intro .sbe-portrait { width: clamp(64px, 12vw, 120px); height: auto; image-rendering: pixelated; }
.sbe-intro p { color: var(--soft); margin: 6px 0 12px; }
.sbe-big { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 5vw, 48px); color: var(--accent); line-height: 1; }
.sbe-done p { color: var(--soft); }
.sbe-pb { color: #ffd23f !important; font-family: var(--display); font-weight: 600; }
.sbe-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sbe-table td { padding: 5px 0; border-bottom: 1px solid rgba(36,48,36,.7); color: var(--soft); }
.sbe-table td:last-child { text-align: right; font-family: var(--mono); color: var(--fg); }
.sbe-table tr.tot td { font-family: var(--display); font-weight: 800; color: var(--accent); border-bottom: 2px solid var(--line); }
.sbe-status { font-size: 14px; }
.sbe-status a { color: var(--accent); }
.sbe-jump {
  display: none; width: 100%; margin-top: 12px; height: 92px; border-radius: 22px; border: 2px solid var(--accent); background: rgba(62,241,19,.14);
  color: var(--accent); font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .12em; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sbe-jump:active { background: rgba(62,241,19,.32); }
@media (hover: none) and (pointer: coarse) {
  .sbe-jump { display: block; }
  .sbe:not(.is-playing) .sbe-jump { opacity: .4; }
}
/* Phones held sideways: the whole picture is the jump button (nothing covers the road ahead). */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  .sbe-jump { display: none !important; }
  .sbe-stage { max-height: calc(100dvh - 16px); max-width: calc((100dvh - 16px) * 16 / 9); margin-inline: auto; }
}
@media (max-height: 520px) {
  .sbe-overlay { padding: 8px; }
  .sbe-panel { gap: 7px; padding: 10px 14px; }
  .sbe-logo { font-size: 22px; }
  .sbe-btn { padding: 8px 12px; font-size: 12.5px; }
  .sbe-small { font-size: 11.5px; }
  .sbe-panel h2 { font-size: 16px; }
  .sbe-rules ol { font-size: 12.5px; gap: 2px; }
  .sbe-table { font-size: 12px; }
  .sbe-table td { padding: 2px 0; }
  .sbe-big { font-size: 24px; }
  .sbe-rotate { display: none; }
}
/* Phones held upright: menus sit under the picture instead of squeezing on top of it. */
@media (max-width: 720px) and (orientation: portrait) {
  .sbe-stage { border-radius: 12px; }
  .sbe:not(.is-playing) .sbe-stage { overflow: visible; aspect-ratio: auto; }
  .sbe:not(.is-playing) .sbe-stage canvas { position: relative; aspect-ratio: 16 / 9; height: auto; border-radius: 12px; }
  .sbe:not(.is-playing) .sbe-overlay { position: static; background: none; padding: 14px 0 0; place-items: stretch; }
  .sbe:not(.is-playing) .sbe-stage { border: 0; box-shadow: none; background: transparent; }
  .sbe-overlay .sbe-panel { width: 100%; }
  .sbe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sbe-topbtns button { width: 34px; height: 34px; font-size: 13px; }
}
.sbe.is-playing .sbe-overlay:not(.is-play) { background: rgba(3,4,3,.6); }
.sbe:fullscreen { background: #000; display: grid; place-items: center; max-width: none; padding: 0; }
.sbe:fullscreen .sbe-stage { width: min(100vw, 177.78vh); border: 0; border-radius: 0; }
body.sbe-lock { overflow: hidden; overscroll-behavior: none; }
.game-info .goals { margin-top: 18px !important; }
.game-info .callout { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .sbe-btn, .sbe-lvl { transition: none; } }
.sbe { scroll-margin-top: 84px; }
@media (max-height: 520px) { .page-game .top { position: relative; } .sbe { scroll-margin-top: 4px; } }
.page-head + .section { padding-top: 0; }
