/* ============ Theme: bright sky-blue background, white rounded cards, Plus Jakarta Sans + Fraunces italic accents ============ */
:root {
  --bg: #0ea5e9; --panel: #ffffff; --panel2: #f2f9fe; --line: #dbe9f4;
  --text: #1e293b; --muted: #64748b; --accent: #0ea5e9; --accent2: #0284c7; --deep: #0c4a6e;
  --grad: linear-gradient(90deg, #22c3f3, #0ea5e9 60%, #0284c7);
  --green: #16a34a; --red: #ef4444; --blue: #0284c7; --navy: #0c4a6e; --cyan: #0ea5e9;
  --radius: 18px; --shadow: 0 18px 45px rgba(3, 60, 100, .16);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font: 15px/1.45 var(--font); }
body { min-height: 100vh; background: linear-gradient(135deg, #3cc9f7 0%, #12a7e6 35%, #0b86c4 72%, #5d7f93 100%) fixed; }
a { color: var(--accent2); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.serif { font-family: var(--serif); font-style: italic; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); box-shadow: 0 6px 24px rgba(3,60,100,.12); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; color: var(--deep); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; }
.tab:hover { color: var(--accent2); background: #e9f6fe; }
.tab.active { color: #fff; background: var(--grad); box-shadow: 0 6px 16px rgba(14,165,233,.35); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--muted); border: 1px solid #e2e8f0; }
.badge.offline { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge.sold { background: #ecfdf3; color: #15803d; border-color: #bbf7d0; }
.badge.unsold { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.available { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge.female { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }

main { padding: 18px; max-width: 1600px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 17px; color: var(--deep); }

/* forms */
input, select, textarea { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.form-grid.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-grid.stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 16px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700;
  white-space: nowrap; text-decoration: none; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: #f0f9ff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(14,165,233,.35); }
.btn.primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.06); }
.btn.green { background: #22c55e; color: #fff; border-color: #22c55e; box-shadow: 0 8px 20px rgba(34,197,94,.3); }
.btn.green:hover:not(:disabled) { background: #16a34a; }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 8px 20px rgba(239,68,68,.3); }
.btn.red:hover:not(:disabled) { background: #dc2626; }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 28px; font-size: 20px; border-radius: 16px; }
.btn.sm { padding: 4px 11px; font-size: 13px; border-radius: 10px; }
.btn.sound-wait { background: #fef3c7; border-color: #f59e0b; color: #92400e; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: 0 0 0 5px rgba(245,158,11,.25); } }
/* drag a player row by the handle to reorder */
.drag { cursor: grab; font-size: 18px; color: #94a3b8; padding: 0 4px; user-select: none; }
.drag:hover { color: var(--accent); }
tr.dragging { opacity: .4; }
tr.drop-above td { box-shadow: inset 0 3px 0 var(--accent); }
tr.drop-below td { box-shadow: inset 0 -3px 0 var(--accent); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 13px; position: sticky; top: 0; background: var(--panel); }
tbody tr:hover { background: #f7fbff; }
.table-wrap { overflow: auto; max-height: 70vh; }

/* auction layout: player card (left) + team grid (right) */
.auction { display: grid; grid-template-columns: minmax(0, 1fr) clamp(400px, 30vw, 500px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .auction { grid-template-columns: 1fr; } }
main[data-tab="auction"] { max-width: none; }
.stage { min-height: calc(100vh - 190px); display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.stage .controls { margin-top: 14px; }
.stage-pic { display: flex; justify-content: center; align-items: center; }

/* company name + logo (top-left of the auction screen) */
.co-bar { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 18px); padding: 2px 4px 10px; color: #fff; min-width: 0; }
.co-logo { width: clamp(46px, 8.5vh, 92px); height: clamp(46px, 8.5vh, 92px); border-radius: 50%; object-fit: contain; background: #fff; padding: 4px;
  box-shadow: 0 8px 22px rgba(3,60,100,.3); flex-shrink: 0; }
.co-logo.ph { display: grid; place-items: center; font-weight: 800; color: var(--accent2); font-size: clamp(16px, 2.6vh, 28px); padding: 0; }
.co-text { min-width: 0; }
.co-name { font-size: clamp(22px, 4vh, 44px); font-weight: 800; line-height: 1.05; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(3,60,100,.25); }
.co-tag { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(13px, 2vh, 21px); color: rgba(255,255,255,.92); margin-top: 2px; }

/* live news ticker (bottom of the auction screen) */
.ticker { display: flex; align-items: stretch; height: clamp(38px, 5.2vh, 54px); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); flex-shrink: 0; }
.tk-live { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 18px; background: linear-gradient(90deg, #ef4444, #f97316); color: #fff;
  font-weight: 800; letter-spacing: .1em; font-size: clamp(12px, 1.7vh, 16px); }
.tk-live i { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.tk-track { flex: 1; overflow: hidden; display: flex; align-items: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tk-move { display: inline-flex; white-space: nowrap; animation: ticker 60s linear infinite; will-change: transform; }
.tk-item { padding: 0 26px; font-weight: 600; font-size: clamp(14px, 2.1vh, 21px); color: var(--text); }
.tk-item b { color: var(--accent2); font-weight: 800; }
.tk-item + .tk-item { border-left: 2px solid #e2eef7; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: .25; } }

/* player stats card (auction + board) */
/* sizes use --u (1% of the screen height, limited by width) so the whole card fits on one screen without scrolling */
.pcard { --u: min(1.12vh, .58vw); width: min(100%, calc(var(--u) * 125)); background: #fff; border: 1px solid var(--line);
  border-radius: calc(var(--u) * 2.6); padding: max(8px, calc(var(--u) * 1.5)); box-shadow: var(--shadow); color: var(--text); animation: pop .35s ease-out; }
.pc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px calc(var(--u) * 2); border-radius: calc(var(--u) * 1.6); padding: calc(var(--u) * 1.1) calc(var(--u) * 2);
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(14,165,233,.3); }
.pc-name { font-size: max(18px, calc(var(--u) * 4)); font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.pc-role { font-size: max(12px, calc(var(--u) * 1.9)); font-weight: 700; padding: 2px calc(var(--u) * 1.4); border-radius: 999px; background: #fff; color: var(--accent2); white-space: nowrap; }
.pc-firm { font-size: max(14px, calc(var(--u) * 2.6)); font-weight: 600; color: rgba(255,255,255,.95); }
.pc-body { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 1.5); margin-top: calc(var(--u) * 1.4); }
.pc-sec { border: 1px solid var(--line); background: var(--panel2); border-radius: calc(var(--u) * 2.2); padding: calc(var(--u) * 1.4) calc(var(--u) * 1.6); }
.pc-title { text-align: center; font-family: var(--serif); font-style: italic; font-size: max(15px, calc(var(--u) * 2.7)); font-weight: 700; color: var(--accent2); margin-bottom: calc(var(--u) * 1.1); }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 1.3); }
.pc-box { border: 1px solid var(--line); border-radius: calc(var(--u) * 1.4); padding: calc(var(--u) * .9) 6px; text-align: center; background: #fff; box-shadow: 0 3px 10px rgba(3,60,100,.05); }
.pc-val { font-size: max(18px, calc(var(--u) * 4.2)); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: #0f172a; }
.pc-lbl { font-size: max(10px, calc(var(--u) * 1.4)); color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* auction tab on a laptop/desktop: everything fits on one screen, no page scrolling */
@media (min-width: 1101px) {
  body:has(main[data-tab="auction"]) { height: 100vh; overflow: hidden; }
  /* the menu bar hides on the auction screen; move the mouse to the top edge to show it */
  body:has(main[data-tab="auction"]) .topbar { position: fixed; left: 0; right: 0; top: 0; transform: translateY(calc(-100% + 8px)); transition: transform .25s ease; }
  body:has(main[data-tab="auction"]) .topbar:hover, body:has(main[data-tab="auction"]) .topbar:focus-within { transform: none; }
  main[data-tab="auction"] { height: 100vh; width: 100%; padding: 14px 18px 12px; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
  main[data-tab="auction"] .auction { flex: 1; min-height: 0; align-items: stretch; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  main[data-tab="auction"] .stage-col { display: flex; flex-direction: column; min-height: 0; }
  main[data-tab="auction"] .stage { flex: 1; min-height: 0; padding: 12px; overflow: hidden; }
  main[data-tab="auction"] .stage .controls { margin-top: calc(min(1vh, .55vw) * 1.6); }
  main[data-tab="auction"] .bidbar { margin-top: 10px; padding: 10px 16px; flex-wrap: nowrap; }
  main[data-tab="auction"] .bidbar select { min-width: 0; flex: 1 1 160px; max-width: 240px; }
  main[data-tab="auction"] .bidbar .random { flex-shrink: 0; white-space: nowrap; }
  main[data-tab="auction"] .side { display: flex; flex-direction: column; min-height: 0; position: static; max-height: none; padding: 10px; }
  main[data-tab="auction"] .team-grid { flex: 1; min-height: 0; overflow-y: auto; }
  main[data-tab="auction"] .pcard { --u: min(1.3vh, .52vw); width: 100%; }
  main[data-tab="auction"] .tt-name { font-size: clamp(14px, 2.5vh, 28px); }
  main[data-tab="auction"] .tt-cap { font-size: clamp(11px, 1.7vh, 18px); }
  main[data-tab="auction"] .tt-row { font-size: clamp(11px, 1.8vh, 19px); }
  main[data-tab="auction"] .tt-row b { font-size: clamp(13px, 2.4vh, 26px); }
  main[data-tab="auction"] .logo.tt-logo { width: clamp(34px, 7.5vh, 84px); height: clamp(34px, 7.5vh, 84px); }
  main[data-tab="auction"] .result-wrap { flex-direction: column; gap: 12px; }
  main[data-tab="auction"] .result-wrap .stage-pic { flex: 0 1 auto; max-width: none; width: 100%; }
  main[data-tab="auction"] .result-wrap .pcard { --u: min(1vh, .52vw); }
  /* result as one wide strip under the card: SOLD · amount · team · captain */
  main[data-tab="auction"] .result-wrap .result { width: 100%; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: 6px 22px; padding: clamp(8px, 1.4vh, 16px) 18px; }
  main[data-tab="auction"] .result-wrap .res-title { font-size: clamp(28px, 5vh, 60px); }
  main[data-tab="auction"] .result-wrap .res-amt { font-size: clamp(24px, 4.2vh, 50px); margin-top: 0; }
  main[data-tab="auction"] .result-wrap .res-team { font-size: clamp(16px, 2.8vh, 30px); margin-top: 0; }
  main[data-tab="auction"] .result-wrap .res-team .logo { width: clamp(32px, 5vh, 56px); height: clamp(32px, 5vh, 56px); }
  main[data-tab="auction"] .result-wrap .res-cap { font-size: clamp(13px, 2vh, 20px); margin-top: 0; }
  main[data-tab="auction"] .result { min-width: 0; padding: 18px 26px; }
}
@media (max-width: 700px) { .pc-body { grid-template-columns: 1fr; } }
.board-stage .pcard { width: min(100%, 980px); }

/* result (SOLD / UNSOLD) shown after each player, until the next one comes up */
.result-wrap { display: flex; gap: 28px; align-items: center; justify-content: center; }
.result-wrap .stage-pic { flex: 1 1 0; min-width: 0; max-width: calc(min(1.12vh, .58vw) * 125); }
.result-wrap .pcard { width: 100%; }
.result-wrap .result { flex: 0 0 auto; }
@media (max-width: 900px) { .result-wrap { flex-direction: column; } }
.result { border-radius: 20px; padding: 24px 34px; text-align: center; min-width: 300px; animation: pop .45s cubic-bezier(.2,1.6,.4,1); box-shadow: var(--shadow); }
.result.sold { background: #ecfdf3; border: 3px solid #22c55e; }
.result.unsold { background: #fef2f2; border: 3px solid var(--red); }
.res-title { font-size: clamp(44px, 6vw, 84px); font-weight: 800; letter-spacing: .04em; line-height: 1; }
.result.sold .res-title { color: var(--green); } .result.unsold .res-title { color: #dc2626; }
.res-amt { font-size: clamp(36px, 4.5vw, 64px); font-weight: 800; color: var(--accent2); margin-top: 10px; font-variant-numeric: tabular-nums; }
.res-team { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: clamp(22px, 2.4vw, 34px); font-weight: 800; margin-top: 10px; color: var(--deep); }
.res-cap { font-size: clamp(16px, 1.6vw, 22px); margin-top: 6px; color: #166534; }
.logo.lgx { width: 64px; height: 64px; }
.board-stage { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.bidbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; }
.bidbar select { min-width: 200px; }
.bidbar .random { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(14,165,233,.35); }
.bidbar .random:hover:not(:disabled) { background: var(--grad); filter: brightness(1.06); }

/* logos */
.logo { object-fit: contain; border-radius: 10px; background: #f1f7fc; flex-shrink: 0; }
.logo.sm { width: 40px; height: 40px; } .logo.md { width: 48px; height: 48px; } .logo.lg { width: 100%; max-width: 120px; height: 64px; display: block; margin: 0 auto; background: none; }
.logo.ph { display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--accent2); border: 1px solid var(--line); background: #e9f6fe; }

/* team panel (right side) */
.side { position: sticky; top: 70px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; padding: 14px; }
/* auction: 3 x 3 grid of team tiles */
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.team-tile { display: flex; flex-direction: column; justify-content: center; gap: clamp(3px, .7vh, 8px); text-align: left; min-width: 0; min-height: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(8px, 1.2vh, 14px) clamp(10px, .8vw, 14px);
  color: var(--text); font: inherit; cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .1s; box-shadow: 0 4px 14px rgba(3,60,100,.06); }
.team-tile:hover { border-color: var(--accent); box-shadow: 0 8px 22px rgba(14,165,233,.18); }
.team-tile.chosen { border-color: var(--accent); background: #e0f4fd; box-shadow: 0 0 0 3px rgba(14,165,233,.45); }
.team-tile.dim { opacity: .5; }
.tt-head { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: clamp(2px, .6vh, 8px); }
.logo.tt-logo { width: clamp(34px, 6.5vh, 72px); height: clamp(34px, 6.5vh, 72px); border-radius: 12px; }
.logo.tt-logo.ph { font-size: clamp(13px, 2vh, 22px); }
.tt-names { display: flex; flex-direction: column; min-width: 0; }
.tt-name { font-size: clamp(14px, 2.2vh, 24px); font-weight: 800; line-height: 1.15; color: var(--deep); overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tt-cap { font-size: clamp(11px, 1.6vh, 17px); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: clamp(11px, 1.6vh, 17px); }
.tt-row span { color: var(--muted); text-transform: uppercase; font-size: .8em; letter-spacing: .05em; font-weight: 600; }
.tt-row b { font-size: clamp(13px, 2vh, 21px); font-variant-numeric: tabular-nums; font-weight: 800; }
.tt-row.mx b { color: var(--accent2); }

/* image upload box */
.img-pick { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.img-preview { width: 96px; height: 96px; border-radius: 14px; border: 1px dashed #b9d4e8; display: grid; place-items: center; overflow: hidden; background: #f7fbff; flex-shrink: 0; }
.img-preview img { width: 100%; height: 100%; object-fit: contain; }
.img-pick.round .img-preview { border-radius: 50%; }
.flash-photo { display: block; max-width: min(640px, 80vw); max-height: 42vh; margin: 0 auto 12px; object-fit: contain; border-radius: 14px; }
.flash-detail { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.block { background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.7); border-radius: 22px; padding: 22px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.block .empty { text-align: center; padding: 40px 10px; color: var(--muted); font-size: 18px; font-weight: 600; }
.player-name { font-size: clamp(28px, 3.6vw, 52px); font-weight: 800; line-height: 1.05; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* board (excel-like) */
.board-wrap { overflow-x: auto; }
.board { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.board th, .board td { border: 1px solid var(--line); padding: 6px 10px; white-space: nowrap; position: static; }
.board tr td.lbl { background: #f1f7fc; color: var(--muted); font-weight: 700; text-align: left; box-shadow: none; }
.board .r-max td { font-weight: 800; color: var(--accent2); text-align: right; }
.board .r-bal td { background: #ecfdf3; text-align: right; }
.board .r-used td { background: #d1fae5; text-align: right; }
.board .r-logo td { background: #fff; text-align: center; }
.board .r-team td { background: var(--deep); color: #fff; font-weight: 700; }
.board .r-cap td { background: var(--accent); color: #fff; font-weight: 600; }
.board .slot td .pr { color: var(--accent2); font-size: 12px; margin-left: 6px; font-weight: 700; }

/* captain view */
.cap-wrap { max-width: 460px; margin: 0 auto; padding: 14px; }
.cap-wrap > .row .brand { color: #fff; }
.cap-wrap > .row a { color: #fff; }
.cap-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.cap-card .line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.cap-card .line .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.cap-card .max { background: #e0f2fe; } .cap-card .max .v { color: var(--accent2); font-size: 22px; }
.cap-card .bal { background: #ecfdf3; } .cap-card .used { background: #d1fae5; }
.cap-card .tname { background: var(--deep); color: #fff; font-weight: 700; } .cap-card .cname { background: var(--accent); color: #fff; }
.cap-card .slot .v { font-weight: 600; text-align: right; }
.cap-card .slot .p { color: var(--accent2); font-size: 13px; display: block; }
.cap-card .slot.empty .v { color: var(--muted); font-weight: 400; }
.cap-banner { background: #f1f7fc; display: grid; place-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.cap-banner img { max-width: 100%; max-height: 120px; object-fit: contain; }
.cap-wrap:has(.cap-all) { max-width: 1400px; }
.cap-all { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.cap-card.mine { outline: 3px solid #fde047; outline-offset: -1px; }
.cap-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8fbfe; }
.cap-hname { flex: 1; font-weight: 800; color: var(--deep); min-width: 0; }
.cap-head .btn { white-space: nowrap; }
.team-pick { display: grid; gap: 10px; }
.team-pick a { display: block; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow); }
.team-pick a span { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

/* flash overlay */
.flash { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8,47,73,.55); backdrop-filter: blur(3px); z-index: 100; animation: fadein .25s ease; }
.flash.out { opacity: 0; transition: opacity .5s; pointer-events: none; }
.flash { cursor: pointer; } .flash-box { cursor: default; position: relative; z-index: 1; }
.flash-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flash-hint { margin-top: 14px; font-size: 13px; color: var(--muted); }
.flash-box { text-align: center; padding: 34px 50px; border-radius: 26px; background: #ecfdf3; border: 3px solid #22c55e; animation: pop .45s cubic-bezier(.2,1.6,.4,1); max-width: 92vw; box-shadow: 0 30px 80px rgba(3,60,100,.35); }
.flash-unsold .flash-box { background: #fef2f2; border-color: var(--red); }
.flash-title { font-size: clamp(48px, 9vw, 110px); font-weight: 800; letter-spacing: .03em; color: var(--green); line-height: 1; }
.flash-unsold .flash-title { color: #dc2626; }
.flash-name { font-size: clamp(24px, 4vw, 44px); font-weight: 800; margin-top: 10px; color: var(--deep); }
.flash-detail { font-size: clamp(18px, 2.6vw, 28px); margin-top: 6px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }

/* toast + dialog */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #fff; border: 2px solid var(--red); color: #b91c1c; font-weight: 600;
  padding: 10px 18px; border-radius: 14px; z-index: 200; max-width: 90vw; box-shadow: var(--shadow); }
.toast.ok { border-color: #22c55e; color: #15803d; }
dialog { background: var(--panel); color: var(--text); border: 0; border-radius: 22px; padding: 22px; width: min(680px, 94vw); box-shadow: 0 30px 80px rgba(3,60,100,.35); }
dialog h2 { color: var(--deep); }
dialog input[type=file] { max-width: 100%; }
dialog::backdrop { background: rgba(8,47,73,.45); backdrop-filter: blur(2px); }
.login { max-width: 380px; margin: 10vh auto; }
.home { max-width: 720px; margin: 6vh auto; text-align: center; color: #fff; }
.home .brand { color: #fff; }
.home > .muted { color: rgba(255,255,255,.88); }
.home .links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 24px; }
.home .links a { padding: 22px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--deep); font-weight: 800; font-size: 18px; box-shadow: var(--shadow); }
.home .links a span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.home .links a:hover { border-color: var(--accent); transform: translateY(-2px); }
