:root {
  --cyan: #00fcfe;
  --navy: #010a2c;
  --navy2: #071a4a;
  --ink: #e8fbff;
  --muted: #8fb3c9;
  --cut: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--navy); }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(0, 252, 254, .18), transparent 70%),
    var(--navy);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }

/* Angular "cut corner" shape used across the site, echoing the logo */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* hero */
.hero { text-align: center; padding: 48px 20px 36px; }
.logo { width: min(78vw, 420px); height: auto; filter: drop-shadow(0 0 28px rgba(0, 252, 254, .35)); }
.tagline { margin: 18px 0 26px; font-size: 19px; color: var(--muted); letter-spacing: .3px; }
.cta, .play {
  display: inline-block; text-decoration: none; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  background: var(--cyan); color: var(--navy); padding: 15px 30px; min-height: 52px;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: transform .12s, filter .12s;
}
.cta:hover, .play:hover { filter: brightness(1.1); transform: translateY(-1px); }
.cta:active, .play:active { transform: translateY(1px); }

/* games */
.games { max-width: 980px; margin: 0 auto; padding: 10px 16px 30px; }
.section-title { text-align: center; margin: 10px 0 26px; font-size: 15px; letter-spacing: 6px; text-transform: uppercase; color: var(--cyan); }
.section-title span { display: inline-flex; align-items: center; gap: 14px; }
.section-title span::before, .section-title span::after { content: ""; width: 40px; height: 2px; background: var(--cyan); opacity: .6; }

.game {
  display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 auto 24px; max-width: 460px;
  background: linear-gradient(160deg, var(--navy2), #04123b);
  border: 1px solid rgba(0, 252, 254, .25);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.shot { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .3s; }
.game:hover .shot img { transform: scale(1.03); }
.info { padding: 18px 20px 24px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--cyan);
  border: 1px solid rgba(0, 252, 254, .4); padding: 3px 9px; }
.info h3 { margin: 12px 0 6px; font-size: 30px; line-height: 1.1; font-weight: 900; font-style: italic; letter-spacing: .5px; }
.info p { margin: 0 0 18px; color: var(--muted); }
.play { width: 100%; text-align: center; }

.more { text-align: center; color: var(--muted); margin: 8px 0 0; font-style: italic; }

.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px 36px; color: var(--muted); font-size: 14px;
  border-top: 1px solid rgba(0, 252, 254, .12); }

/* wider screens: games side by side */
@media (min-width: 820px) {
  .hero { padding-top: 72px; }
  .games-grid, .games { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .section-title, .more { grid-column: 1 / -1; }
  .game { max-width: none; margin: 0; }
}

/* account (top right) */
.topbar { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 10; }
.account { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 8px; font: inherit; font-weight: 700; font-size: 15px;
  color: var(--ink); text-decoration: none; background: rgba(1, 10, 44, .7); border: 1px solid rgba(0, 252, 254, .45); cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); backdrop-filter: blur(6px); }
.acct-btn:hover { border-color: var(--cyan); }
.acct-btn .g { display: inline-grid; place-items: center; width: 26px; height: 26px; background: #fff; color: #4285f4; font-weight: 900; border-radius: 50%; }
.acct-btn img, .acct-btn .initial { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.acct-btn .initial { display: inline-grid; place-items: center; background: var(--cyan); color: var(--navy); font-weight: 900; }
.acct-btn .nm { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #061640; border: 1px solid rgba(0, 252, 254, .35); padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.acct-menu[hidden] { display: none; }
.acct-hi { font-size: 14px; color: var(--muted); padding: 6px 8px 10px; }
.acct-hi .adm { color: var(--cyan); font-weight: 700; }
.acct-menu button, .acct-menu a { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; color: var(--ink); background: none; border: 0;
  padding: 11px 8px; text-decoration: none; cursor: pointer; }
.acct-menu button:hover, .acct-menu a:hover { background: rgba(0, 252, 254, .1); }

/* leaderboards */
.boards, .builder { max-width: 980px; margin: 0 auto; padding: 10px 16px 30px; }
.boards-note { text-align: center; color: var(--muted); margin: -12px 0 18px; font-size: 15px; }
.board-grid { display: grid; gap: 16px; }
.board { background: linear-gradient(160deg, var(--navy2), #04123b); border: 1px solid rgba(0, 252, 254, .2); padding: 14px 16px 10px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.board-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.board-head .bi { font-size: 28px; }
.board-head .bg { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cyan); font-weight: 700; }
.board-head .bl { font-size: 19px; font-weight: 900; font-style: italic; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid rgba(255,255,255,.06); }
.board li .rk { width: 24px; text-align: center; font-weight: 900; color: var(--muted); }
.board li.top1 .rk { color: #ffd34d; } .board li.top2 .rk { color: #cfd8e3; } .board li.top3 .rk { color: #e0a06a; }
.board li .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li b { font-variant-numeric: tabular-nums; color: var(--cyan); }
.board li.empty { color: var(--muted); font-style: italic; justify-content: center; }
@media (min-width: 820px) { .board-grid { grid-template-columns: repeat(3, 1fr); } }

/* builder box (admins only) */
.builder-box { max-width: 680px; margin: 0 auto; background: linear-gradient(160deg, #0a2258, #04123b); border: 1px solid var(--cyan); padding: 18px;
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.builder-intro { margin: 0 0 12px; color: var(--muted); }
#builder-text { width: 100%; font: inherit; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid rgba(0, 252, 254, .35); padding: 12px; resize: vertical; min-height: 100px; }
#builder-text:focus { outline: none; border-color: var(--cyan); }
#builder-form .play { margin-top: 10px; border: 0; cursor: pointer; font-size: 16px; }
#builder-form .play:disabled { opacity: .6; }
.chat { margin-top: 18px; max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.chat-empty { color: var(--muted); text-align: center; font-style: italic; }
.msg { max-width: 88%; }
.msg.you { align-self: flex-end; text-align: right; }
.msg .bubble { display: inline-block; text-align: left; padding: 10px 14px; line-height: 1.45; word-wrap: break-word; }
.msg.you .bubble { background: var(--cyan); color: var(--navy); font-weight: 600; }
.msg.bot .bubble { background: #102a66; border: 1px solid rgba(0, 252, 254, .3); }
.msg.bot .bubble a { color: var(--cyan); }
.msg .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* account menu: delete; footer + legal pages */
.acct-menu button.danger { color: #ff8a8a; }
.foot a { color: var(--muted); }
.legal { max-width: 680px; margin: 0 auto; padding: 24px 20px 48px; line-height: 1.6; }
.legal h1 { color: var(--cyan); font-size: 28px; margin: 8px 0 4px; }
.legal h2 { color: var(--cyan); font-size: 19px; margin: 26px 0 6px; }
.legal p, .legal li { color: var(--ink); font-size: 16px; }
.legal .upd { color: var(--muted); font-size: 14px; }
.legal a { color: var(--cyan); }
.legal-top { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.legal-top img { width: 96px; height: auto; }

/* gamer tag picker */
.tag-modal { position: fixed; inset: 0; z-index: 100; background: rgba(1, 10, 44, .85); display: flex; align-items: center; justify-content: center; padding: 20px; }
.tag-card { width: 100%; max-width: 380px; background: linear-gradient(160deg, #0a2258, #04123b); border: 1px solid var(--cyan); padding: 22px 20px; text-align: center; box-shadow: 0 0 40px rgba(0, 252, 254, .25); }
.tag-emoji { font-size: 40px; }
.tag-card h2 { color: var(--cyan); margin: 6px 0 6px; font-size: 24px; }
.tag-card p { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.tag-card input { width: 100%; font: inherit; font-size: 20px; text-align: center; color: var(--ink); background: rgba(0,0,0,.35); border: 1px solid rgba(0, 252, 254, .5); padding: 12px; }
.tag-card input:focus { outline: none; border-color: var(--cyan); }
.tag-err { min-height: 22px; margin: 8px 0 4px; color: #ff8a8a; font-size: 15px; }
.tag-save { width: 100%; font: inherit; font-weight: 800; font-size: 18px; padding: 14px; border: 0; cursor: pointer; background: var(--cyan); color: var(--navy); }
.tag-save:disabled { opacity: .6; }
.tag-out { display: inline-block; margin-top: 12px; color: var(--muted); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }

/* admin player list */
.plist { display: flex; flex-direction: column; gap: 8px; }
.pl { background: rgba(0,0,0,.25); border: 1px solid rgba(0, 252, 254, .2); }
.pl summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.pl summary::-webkit-details-marker { display: none; }
.pl summary b { color: var(--ink); }
.pl summary i { color: var(--muted); font-weight: 400; }
.pl summary span { color: var(--muted); font-size: 14px; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.pl-acts button { font: inherit; font-size: 14px; color: var(--ink); background: rgba(0, 252, 254, .1); border: 1px solid rgba(0, 252, 254, .35); padding: 10px 12px; cursor: pointer; }

/* builder: question banner + pictures */
.builder-q { margin: 0 0 14px; padding: 14px 16px; background: rgba(255, 210, 63, .12); border: 2px solid #ffd23f; color: var(--ink); }
.builder-q b { color: #ffd23f; font-size: 17px; }
.builder-q p { margin: 6px 0; font-size: 16px; }
.builder-q small { color: var(--muted); }
.builder-q a { color: var(--cyan); }
.bubble.q { border-color: #ffd23f !important; }
.brow { display: flex; gap: 10px; align-items: stretch; margin-top: 10px; }
.brow .play { flex: 1; margin-top: 0 !important; }
.addpic { display: flex; align-items: center; padding: 0 14px; border: 1px solid rgba(0, 252, 254, .5); color: var(--ink); cursor: pointer; font-size: 15px; white-space: nowrap; }
.bpics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bpics:empty { display: none; }
.bp { position: relative; }
.bp img { width: 72px; height: 72px; object-fit: cover; display: block; border: 1px solid rgba(0, 252, 254, .35); }
.bp button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #ff6b6b; color: #fff; font-size: 13px; cursor: pointer; }
.bthumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bthumbs img { width: 90px; height: 90px; object-fit: cover; display: block; }
