/* Guild Hub — night-sky look shared with Săn Boss / Phòng Tranh: deep navy, cyan + yellow accents. Mobile-first. */
:root {
  color-scheme: dark;
  --night: #0c1033; --night-2: #161c4e; --panel: #1b2160; --panel-2: #222a72; --line: #2f377d;
  --ink: #f3f4ff; --muted: #a9b0e6; --cyan: #5ed0ff; --yellow: #ffd83a; --pink: #ff8fc0; --pink-deep: #f06aa6;
  --paper: #ffffff; --navy: #13206b; --blue: #3b8de0; --sky: #5cb8ea; --red: #e8384f; --green: #3ccf8e;
  --display: "Baloo 2", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 600 15px/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; }
a { color: var(--cyan); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(26px, 5vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .6em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 48px; flex: 1; display: grid; gap: 22px; align-content: start; }
.wrap > *, section { min-width: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: #ffb3bd; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.warn { color: #ffb3bd; font-size: 13px; font-weight: 700; margin: 0; }
:focus-visible { outline: 2.5px solid var(--cyan); outline-offset: 2px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  background: rgba(12, 16, 51, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--yellow); font: 800 19px/1 var(--display); letter-spacing: .02em; flex: none; }
.logo img { border-radius: 50%; }
#nav { display: flex; align-items: center; gap: 4px 6px; flex: 1; flex-wrap: wrap; min-width: 0; }
#nav .grow { flex: 1; }
.navl { color: var(--muted); text-decoration: none; font-weight: 800; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.navl.on, .navl:hover { color: var(--ink); background: var(--panel); }
.me { display: flex; align-items: center; gap: 6px; }
.lang, .tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.lang button, .tabs button { font: 800 13px var(--body); color: var(--muted); background: none; border: 0; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.lang button[aria-pressed="true"], .tabs button[aria-pressed="true"] { background: var(--cyan); color: var(--night); }
.tabs { border-radius: 14px; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  #nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  #nav .grow { display: none; }
}
.site-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 22px); border-top: 1px solid var(--line); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 800 14.5px/1.2 var(--body); color: var(--night); background: var(--cyan);
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled, .btn.busy { opacity: .55; pointer-events: none; }
.btn.alt { background: var(--yellow); }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--panel); }
.btn.on { background: var(--yellow); color: var(--night); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost.danger { background: transparent; color: #ffb3bd; box-shadow: inset 0 0 0 1.5px rgba(232, 56, 79, .5); }
.btn.google { background: #fff; color: #1f2a44; }
.linkbtn { background: none; border: 0; color: var(--cyan); font: inherit; font-weight: 800; cursor: pointer; padding: 0; text-decoration: underline; }
.icon { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--night-2); color: var(--ink); font: 800 17px/1 var(--body); cursor: pointer; flex: none; }
.icon:disabled { opacity: .35; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.two, .three { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* tooltip ⓘ */
.tip-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; }
.tip { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--cyan); background: transparent; color: var(--cyan);
  font: 800 12px/1 Georgia, serif; font-style: italic; cursor: help; padding: 0; }
.tip-pop { position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(320px, 80vw);
  background: #0a0e2b; color: var(--ink); border: 1px solid var(--cyan); border-radius: 10px; padding: 9px 11px; font: 600 13px/1.45 var(--body);
  text-transform: none; letter-spacing: 0; white-space: normal; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.tip-wrap:hover .tip-pop, .tip-wrap.open .tip-pop, .tip:focus-visible + .tip-pop { opacity: 1; visibility: visible; }
@media (max-width: 600px) { .tip-pop { position: fixed; left: 16px; right: 16px; bottom: auto; top: 30%; transform: none; max-width: none; width: auto; } }

/* forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 16px; min-width: 0; }
.f { display: grid; gap: 7px; min-width: 0; }
.lb { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb small, .f > span small { color: var(--muted); font-weight: 600; margin-left: auto; }
input[type=text], input[type=number], input[type=url], input[type=email], input[type=search], input[type=datetime-local], textarea, select {
  width: 100%; font: 700 15px var(--body); color: var(--ink); background: var(--night-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
textarea { resize: vertical; line-height: 1.45; }
input.bad, textarea.bad { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.contacts { display: grid; gap: 8px; }
.cf { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 10px; font-weight: 800; font-size: 13px; color: var(--muted); }
.cf > span { display: flex; align-items: center; }
.cookies { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 8px 4px 2px 2px; }
.ck { position: relative; display: grid; justify-items: center; gap: 3px; background: var(--night-2); border: 2px solid var(--line); border-radius: 14px;
  padding: 6px 4px 5px; cursor: pointer; color: var(--muted); font: 700 10.5px/1.15 var(--body); text-align: center; }
.ck img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }
.ck[aria-pressed="true"] { border-color: var(--yellow); color: var(--ink); background: #262c70; }
.ck .n { position: absolute; top: -7px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); color: var(--night); font: 800 12px/22px var(--body); display: none; }
.ck[aria-pressed="true"] .n { display: block; }
.ck .new { position: absolute; left: -5px; top: -7px; background: var(--cyan); color: var(--night); font: 800 9px/1 var(--body); padding: 3px 5px; border-radius: 6px; }
.av-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.av-prev { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 2px solid var(--sky); background: var(--night-2); }
.av-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.av-actions label.btn { cursor: pointer; }
canvas.crop { width: min(280px, 100%); aspect-ratio: 1; justify-self: center; border-radius: 12px; touch-action: none; cursor: grab; border: 2px solid var(--cyan); }
canvas.crop:active { cursor: grabbing; }
.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.rk { display: grid; justify-items: center; gap: 2px; background: var(--night-2); border: 2px solid var(--line); border-radius: 14px; padding: 7px 4px; cursor: pointer; color: var(--muted); font: 800 11.5px var(--body); }
.rk img { width: 38px; height: 38px; object-fit: contain; }
.rk .unranked { width: 38px; height: 38px; display: grid; place-items: center; background: #c9cede; color: #5d6481; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); font: 800 16px var(--display); }
.rk[aria-pressed="true"] { border-color: var(--cyan); color: var(--ink); background: #262c70; }

/* pages */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.back { color: var(--muted); text-decoration: none; font-weight: 800; justify-self: start; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hero { background: radial-gradient(120% 120% at 100% 0%, #3a2a8f 0%, transparent 55%), linear-gradient(135deg, #2b1f7a, #1b2160);
  border: 2px solid rgba(94, 208, 255, .5); border-radius: 22px; padding: clamp(18px, 4vw, 34px); }
.hero h1 { font-size: clamp(30px, 6vw, 48px); text-shadow: 0 3px 0 #4a1f9a; }
.hero h1 .y { color: var(--yellow); }
.hero p { color: #d8dcff; max-width: 58ch; }
.empty { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 40px 0; }
.notice { background: rgba(255, 216, 58, .1); border: 1.5px dashed var(--yellow); border-radius: var(--r); padding: 16px; display: grid; gap: 6px; justify-items: start; }
.notice-sm { background: rgba(94, 208, 255, .08); border: 1px solid rgba(94, 208, 255, .35); border-radius: 12px; padding: 10px 12px; margin: 0; font-size: 13.5px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.filters label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--muted); }

/* profile tiles */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.ptile { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.ptile:hover { border-color: var(--cyan); }
.pt-top { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pt-face { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 2px solid var(--sky); }
.pt-id { display: grid; min-width: 0; }
.pt-id b { font: 800 16px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-rank { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.pt-rank img { width: 20px; height: 20px; object-fit: contain; }
.pt-crown { display: flex; align-items: center; gap: 4px; font: 800 14px var(--display); color: var(--yellow); }
.pt-crown img { width: 22px; height: 22px; }
.pt-cookies { display: flex; gap: 6px; }
.pt-cookies img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.pt-note { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.preview { position: sticky; top: 80px; display: grid; gap: 10px; }
.cap { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 860px) { .editor { grid-template-columns: minmax(0, 1fr); } .preview { position: static; order: -1; } }
.card-wrap { width: 100%; max-width: 560px; justify-self: center; }

/* ───────── profile card (4:5, scales by container width) ───────── */
.card { container-type: inline-size; position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 14px; color: var(--navy);
  background: radial-gradient(120% 80% at 80% 0%, #24307e 0%, transparent 60%), radial-gradient(90% 70% at 0% 100%, #1d2a74 0%, transparent 65%), var(--night);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.card.export { border-radius: 0; box-shadow: none; width: 1080px; }
.card .sky { position: absolute; inset: 0; pointer-events: none; }
.card .sky i { position: absolute; color: var(--cyan); filter: drop-shadow(0 0 1.2cqw rgba(94, 208, 255, .85)); opacity: .9; }
.card .sky svg { width: 100%; height: 100%; display: block; }
.card .brand { position: absolute; right: 5cqw; top: 4cqw; text-align: right; font: 800 3.6cqw/1 var(--display); color: var(--yellow); text-shadow: 0 .4cqw 0 #6b2bb8; letter-spacing: .02em; }
.card .brand small { display: block; color: var(--cyan); font-size: 2.2cqw; text-shadow: none; letter-spacing: .14em; margin-top: .6cqw; }
.card .paper { position: absolute; left: 9cqw; top: 13cqw; width: 82cqw; height: 104cqw; background: var(--paper); transform: rotate(-2.2deg);
  box-shadow: 0 2cqw 5cqw rgba(0, 0, 0, .5); padding: 5.5cqw 5cqw 4cqw; }
.card .clip { position: absolute; left: -4.5cqw; top: -6cqw; width: 13cqw; height: 28cqw; }
.card .ttl { margin: 0 0 0 7cqw; font: 800 5.3cqw/1.1 var(--display); color: var(--navy); white-space: nowrap; }
.card .top { display: grid; grid-template-columns: 45cqw 1fr; gap: 3cqw; margin-top: 3.4cqw; align-items: center; }
.card .idbox { display: flex; align-items: center; gap: 2.4cqw; background: var(--pink); padding: 2.2cqw; min-height: 20cqw; min-width: 0; }
.card .face { flex: none; width: 15.5cqw; height: 15.5cqw; background: var(--navy); border: .7cqw solid var(--sky); overflow: hidden; }
.card .face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .ign { min-width: 0; color: #fff; font: 800 4cqw/1.08 var(--display); text-transform: uppercase; overflow-wrap: anywhere; text-shadow: 0 .3cqw 0 var(--pink-deep);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .ign.long { font-size: 3cqw; }
.card .stats { display: grid; gap: 1.8cqw; align-content: center; min-width: 0; }
.card .stat { display: flex; align-items: center; gap: 2cqw; }
.card .stat img { width: 8.5cqw; height: 8.5cqw; object-fit: contain; flex: none; }
.card .lbl { font: 800 2.5cqw/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.card .val { font: 800 4cqw/1 var(--display); font-variant-numeric: tabular-nums; }
.card .rname { font: 800 3.1cqw/1.05 var(--display); }
.card .tag { position: relative; display: inline-block; background: var(--pink); color: var(--navy); font: 800 2.7cqw/1 var(--display);
  padding: 1.5cqw 2.4cqw 1.1cqw; text-transform: uppercase; letter-spacing: .03em; transform: rotate(-9deg); z-index: 2; }
.card .bar { background: var(--blue); color: #fff; font: 800 3cqw/1.25 var(--display); padding: 3.4cqw 3cqw 2cqw; margin-top: -2.4cqw; margin-left: 4cqw; }
.card .sec { margin-top: 2.6cqw; }
.card .trio { display: flex; gap: 2.6cqw; align-items: center; }
.card .trio figure { margin: 0; display: grid; justify-items: center; gap: .6cqw; width: 18cqw; }
.card .trio img { width: 10cqw; height: 10cqw; object-fit: cover; border-radius: 1.6cqw; border: .5cqw solid #fff; }
.card .trio figcaption { font: 700 1.95cqw/1.1 var(--body); text-align: center; }
.card .note .bar { background: var(--sky); color: var(--navy); height: 17cqw; overflow: hidden; font: 800 2.45cqw/1.36 var(--body); white-space: pre-line; overflow-wrap: anywhere; }
.card .bar.empty { opacity: .6; }
.card .contact .bar { display: flex; flex-wrap: wrap; gap: 1.4cqw 3.4cqw; font-size: 2.6cqw; }
.card .contact .it { display: flex; gap: 1.4cqw; align-items: center; min-width: 0; max-width: 100%; }
.card .contact .ct { flex: none; background: rgba(255, 255, 255, .22); padding: .4cqw 1.3cqw; font-size: 2cqw; text-transform: uppercase; }
.card .contact .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .stamp { position: absolute; right: -3cqw; bottom: -4.6cqw; background: rgba(255, 255, 255, .88); border: .7cqw solid var(--red); color: var(--red);
  font: 800 3.4cqw/1 var(--display); padding: 1.4cqw 2.2cqw .9cqw; transform: rotate(-12deg); text-transform: uppercase; border-radius: 1cqw;
  box-shadow: inset 0 0 0 .35cqw #fff, inset 0 0 0 .7cqw var(--red); }
.card .foot { position: absolute; left: 9cqw; bottom: 2.6cqw; font: 700 2.2cqw/1 var(--body); color: var(--muted); letter-spacing: .06em; }
.card .foot b { color: var(--cyan); }
@media (prefers-reduced-motion: no-preference) {
  .card:not(.export) .sky i { animation: tw 3.2s ease-in-out infinite alternate; }
  .card .sky i:nth-child(2n) { animation-delay: -1.4s; }
  @keyframes tw { from { opacity: .45; } to { opacity: .95; } }
}
.export-holder { position: fixed; left: -12000px; top: 0; overflow: hidden; background: var(--night); }
.preview-img { display: block; width: 100%; border-radius: 10px; }

/* tournaments */
.list { display: grid; gap: 8px; }
.trow { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; color: var(--ink); text-decoration: none; flex-wrap: wrap; }
.trow:hover { border-color: var(--cyan); }
.tr-main { display: grid; min-width: 0; }
.tr-main b { font: 800 17px/1.25 var(--display); overflow-wrap: anywhere; }
.tr-main .muted, .tr-side .muted { font-size: 13px; }
.tr-side { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 2px 10px; font: 800 12px/1.5 var(--body); }
.pill.live { background: rgba(60, 207, 142, .15); border-color: var(--green); color: var(--green); }
.thead { display: grid; gap: 6px; }
.thead h1 { margin: 0; overflow-wrap: anywhere; }
.seeds { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.seeds li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; background: var(--night-2); border-radius: 10px; padding: 4px 6px; }
.seeds .seed { color: var(--yellow); font-weight: 800; text-align: center; }
.seeds .sn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage { border-color: rgba(255, 216, 58, .45); }

/* bracket */
.bracket-scroll { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; min-width: min-content; }
.bcol { display: grid; gap: 8px; scroll-snap-align: start; }
.bhead { font: 800 13px var(--display); color: var(--yellow); text-transform: uppercase; letter-spacing: .06em; padding: 4px 2px; }
.bslot { display: flex; align-items: center; min-height: 74px; }
.match { position: relative; width: 100%; display: grid; gap: 2px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 6px; text-align: left; color: var(--ink); font: inherit; }
button.match { cursor: pointer; }
button.match:hover { border-color: var(--cyan); }
.match.live { border-color: var(--green); box-shadow: 0 0 0 2px rgba(60, 207, 142, .25); }
.match.bye { opacity: .6; }
.livebadge { position: absolute; top: -9px; right: 8px; background: var(--green); color: var(--night); font: 800 10px/1 var(--body); padding: 3px 6px; border-radius: 6px; }
.mt { display: grid; grid-template-columns: 22px minmax(0, 1fr) 26px; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 8px; background: var(--night-2); }
.mt .seed { color: var(--muted); font-size: 11px; text-align: center; }
.mt .mn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mt .ms { text-align: center; font: 800 15px var(--display); }
.mt.win { background: rgba(255, 216, 58, .14); }
.mt.win .mn, .mt.win .ms { color: var(--yellow); font-weight: 800; }
.mt.lose { opacity: .55; }
.mnote { color: var(--muted); font-size: 11.5px; padding: 0 4px; overflow-wrap: anywhere; }
.bthird { margin-top: 18px; display: grid; gap: 8px; }
@media (max-width: 720px) { .bracket { grid-auto-columns: 82vw; } }

/* podium */
.podium { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; align-items: end; max-width: 620px; margin: 0 auto; width: 100%; }
.pd { display: grid; justify-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px 14px 6px 6px; padding: 14px 8px; text-align: center; min-width: 0; }
.pd b { font: 800 16px/1.2 var(--display); overflow-wrap: anywhere; }
.pd small { color: var(--muted); font-weight: 800; }
.pd .medal { font-size: 30px; line-height: 1; }
.pd.p1 { padding-block: 26px; border-color: var(--yellow); background: linear-gradient(180deg, rgba(255, 216, 58, .2), var(--panel)); }
.pd.p1 b { color: var(--yellow); font-size: 20px; }
.pd.p1 .medal { font-size: 42px; }

/* album */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.album figure { position: relative; margin: 0; display: grid; gap: 4px; }
.album img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; }
.album figcaption { font-size: 12.5px; color: var(--muted); }
.album .del { position: absolute; top: 6px; right: 6px; background: rgba(12, 16, 51, .85); }
.videos { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.videos li { display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.videos a { font-weight: 800; text-decoration: none; }
.videos .del { margin-left: auto; width: 28px; height: 28px; }
.addimg { cursor: pointer; justify-self: start; }
.addimg.busy { opacity: .5; pointer-events: none; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }

/* match dialog */
.score-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; text-align: center; }
.score-grid .side { display: grid; gap: 8px; justify-items: center; min-width: 0; }
.score-grid .side b { overflow-wrap: anywhere; }
.score-grid .vs { color: var(--muted); font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .icon { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.big-score { font: 800 34px/1 var(--display); min-width: 34px; color: var(--yellow); }

/* admin */
.acc { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.acc-name { display: flex; align-items: center; }
.acc small { grid-column: 1 / -1; }
@media (max-width: 720px) { .acc { grid-template-columns: minmax(0, 1fr); } }
.setup { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.setup li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sql { background: var(--night-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; overflow-x: auto; white-space: nowrap; max-width: 100%; display: block; flex: 1; min-width: 0; }
.reports { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.reports li { background: var(--night-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; overflow-wrap: anywhere; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 25, .72); display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 6px; position: sticky; top: 0; background: var(--panel); }
.modal-head h3 { margin: 0; }
.modal .x { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.modal-body { padding: 6px 16px 16px; display: grid; gap: 14px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translate(-50%, 20px); opacity: 0;
  background: #0a0e2b; border: 1.5px solid var(--cyan); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 800; transition: .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--red); color: #ffd0d6; }

/* ───────── export images (rendered off-screen at fixed pixel size) ───────── */
.exp { width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 24px; padding: 48px 56px 36px; color: var(--ink);
  background: radial-gradient(70% 60% at 85% 0%, #3a2a8f 0%, transparent 60%), radial-gradient(60% 50% at 0% 100%, #1d2a74 0%, transparent 65%), var(--night); }
.exp-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; border-bottom: 3px solid rgba(94, 208, 255, .35); padding-bottom: 18px; }
.exp-kicker { color: var(--cyan); font: 800 22px var(--display); letter-spacing: .08em; }
.exp-title { font: 800 54px/1.05 var(--display); color: var(--yellow); text-shadow: 0 4px 0 #4a1f9a; }
.exp-meta { color: var(--muted); font-size: 20px; text-align: right; max-width: 40%; }
.exp-foot { color: var(--muted); font-size: 18px; letter-spacing: .06em; }
.exp-foot b { color: var(--cyan); }
.exp .bracket { grid-auto-columns: 1fr; height: 100%; }
.exp .bcol { height: 100%; }
.exp .bslot { min-height: 0; }
.exp .match { padding: 4px; }
.exp .mt { padding: 3px 8px; font-size: 18px; }
.exp .mt .ms { font-size: 20px; }
.exp .bhead { font-size: 18px; }
.exp.port { padding: 64px 60px 44px; }
.exp.port .exp-head { flex-direction: column; align-items: start; }
.exp.port .exp-meta { text-align: left; max-width: none; }
.exp-podium { display: grid; align-content: center; justify-items: center; gap: 28px; }
.exp-trophy { font-size: 150px; line-height: 1; filter: drop-shadow(0 0 40px rgba(255, 216, 58, .5)); }
.exp-label { font: 800 40px var(--display); color: var(--cyan); letter-spacing: .1em; text-transform: uppercase; }
.exp .podium { max-width: none; gap: 20px; }
.exp .pd { padding: 26px 14px; border-width: 2px; }
.exp .pd b { font-size: 30px; }
.exp .pd small { font-size: 22px; }
.exp .pd .medal { font-size: 56px; }
.exp .pd.p1 { padding-block: 46px; }
.exp .pd.p1 b { font-size: 38px; }
.exp .pd.p1 .medal { font-size: 80px; }
