/* The admin page (admin.php), in the look of the new site proposal (julefrokost/site.html). Phone first. */
:root { --navy: #08103c; --navy2: #121c58; --panel: #17226b; --line: #2b3890; --yel: #fff200; --red: #e60012; --ink: #fff; --dim: #aab3e6;
  --up: #37e07a; --down: #ff6b78; --bro: #ff7a1a; --liv: #29b6f6; --tabs: 64px;
  --heavy: "Arial Black", "Segoe UI Black", Impact, "Helvetica Neue", Arial, sans-serif; --text: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--navy) linear-gradient(180deg, #0b1550, var(--navy) 420px) no-repeat; color: var(--ink); font: 16px/1.4 var(--text);
  padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); -webkit-tap-highlight-color: transparent; }
body.out { padding-bottom: 16px; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 12px; }

header.top { position: sticky; top: 0; z-index: 20; background: rgba(8, 16, 60, .94); backdrop-filter: blur(8px); border-bottom: 3px solid var(--yel); }
header.top .wrap { display: flex; align-items: center; gap: 10px; height: 60px; }
.badge { display: flex; align-items: stretch; text-decoration: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.badge b { background: var(--red); color: #fff; font: 900 22px/1 var(--heavy); padding: 9px 8px; border: 2px solid #fff; }
.badge span { background: var(--yel); color: #111; font: 900 17px/1 var(--heavy); padding: 6px 10px 5px; display: grid; }
.badge small { color: var(--red); font: 900 9px/1 var(--heavy); letter-spacing: .22em; font-style: italic; }
nav.menu { display: none; margin-left: auto; gap: 4px; }
nav.menu a { text-decoration: none; font: 900 13px var(--heavy); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-radius: 4px; }
nav.menu a:hover, nav.menu a.on { background: var(--panel); color: var(--yel); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; min-width: 0; }
nav.menu + .who { margin-left: auto; }
.who .tag { background: var(--yel); color: #111; font: 900 10.5px var(--heavy); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 3px; }
.who .tag.admin { background: var(--red); color: #fff; }
.who button { border: 0; background: transparent; box-shadow: inset 0 0 0 2px var(--line); border-radius: 6px; min-height: 40px; padding: 0 12px; font-weight: 800; cursor: pointer; }
.who span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

section { padding: 22px 0 6px; }
h2 { margin: 0 0 12px; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
h2 .k { background: var(--red); font: 900 italic 13px var(--heavy); padding: 4px 10px; letter-spacing: .12em; transform: skewX(-8deg); }
h2 .t { font: 900 italic clamp(26px, 7vw, 40px)/1 var(--heavy); text-transform: uppercase; text-shadow: 3px 3px 0 #000; letter-spacing: .01em; }
h2 .n { color: var(--dim); font-size: 13px; font-weight: 600; margin-left: auto; }
.lower { display: inline-block; justify-self: start; margin: 0; background: var(--yel); color: #111; font: 900 italic 16px var(--heavy); padding: 6px 14px; transform: skewX(-6deg); box-shadow: 4px 4px 0 rgba(0, 0, 0, .4); }
.lower em { color: var(--red); font-style: inherit; }
.note { color: var(--dim); margin: 0; font-size: 14.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 6px; cursor: pointer;
  font: 900 italic 18px var(--heavy); text-transform: uppercase; text-decoration: none; background: var(--yel); color: #111; box-shadow: 0 4px 0 #a39a00; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a39a00; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 #86000b; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); font-size: 14px; min-height: 44px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---- login ---- */
.card { display: grid; gap: 14px; max-width: 440px; margin: 28px auto 0; background: var(--panel); border: 1px solid var(--line); border-top: 6px solid var(--red); border-radius: 10px; padding: 20px 18px 22px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .25); }
.card h2 { margin: 0; }
.card .links { display: flex; gap: 8px; flex-wrap: wrap; }
.card .links .btn { flex: 1; white-space: nowrap; }
.field { display: grid; gap: 4px; font: 900 11px var(--heavy); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); min-width: 0; }
select, input { width: 100%; min-height: 48px; border-radius: 6px; border: 2px solid var(--line); background: var(--navy2); padding: 0 10px; font-size: 16px; font-weight: 700; color-scheme: dark; }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--yel); outline-offset: 2px; }
.msg { border-radius: 6px; padding: 10px 12px; font-weight: 700; display: none; margin: 0 0 10px; }
.card .msg { margin: 0; }
.msg.err { display: block; background: #5a0a12; border: 2px solid var(--red); } .msg.ok { display: block; background: #0d4a26; border: 2px solid var(--up); }

/* ---- lists ---- */
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; margin-bottom: 12px; }
.filters .btn { grid-column: 1 / -1; }
.filters .grow { grid-column: 1 / -1; }
.filters .picked { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; } .filters .picked:empty { display: none; }
.pick { border: 0; border-radius: 99px; background: var(--yel); color: #111; font: inherit; font-weight: 700; font-size: 14px; padding: 8px 12px; min-height: 40px; cursor: pointer; }
.pick b { margin-left: 8px; }
.games { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.game { background: var(--panel); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.game .meta { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: var(--navy2); font-size: 12.5px; color: var(--dim); font-weight: 600; }
.game .meta b { color: var(--ink); }
.game .meta .id { margin-left: auto; }
.game .sides { display: grid; grid-template-columns: 1fr 1fr; }
.side { padding: 8px 10px 10px; border-top: 4px solid var(--bro); min-width: 0; }
.side + .side { border-top-color: var(--liv); border-left: 1px solid var(--line); }
.side .tm { display: flex; justify-content: space-between; align-items: baseline; font: 900 12px var(--heavy); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.side .tm i { font: 900 italic 30px/1 var(--heavy); color: var(--ink); }
.side.win .tm i { color: var(--yel); }
.pl { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 700; font-size: 14.5px; }
.pl small { font: 900 10px var(--heavy); color: var(--dim); width: 12px; }
.pl span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl b { font: 900 15px var(--heavy); color: var(--yel); }
.game .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px 10px; border-top: 1px solid var(--line); }
.game .acts button, .item button { border: 0; border-radius: 6px; min-height: 42px; padding: 0 14px; font: 900 13px var(--heavy); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; background: var(--line); }
.game .acts button.del, .item button.del { background: transparent; box-shadow: inset 0 0 0 2px #7a1d28; color: var(--down); }

.list { display: grid; gap: 4px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; background: linear-gradient(90deg, var(--panel), #1e2b82); border-left: 5px solid var(--line); border-radius: 0 6px 6px 0; padding: 8px 10px; }
.item .name { font-weight: 800; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { grid-column: 1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); font-weight: 600; }
.item .sub b { color: var(--ink); }
.item .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.item .acts select { width: auto; min-height: 42px; font-size: 14px; }
.item.admin { border-left-color: var(--red); } .item.moderator { border-left-color: var(--yel); }
.item.logrow { grid-template-columns: 1fr; border-left-color: var(--yel); }
.item.logrow .what { font-weight: 700; overflow-wrap: anywhere; }
.temp { background: var(--yel); color: #111; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; box-shadow: 4px 4px 0 rgba(0, 0, 0, .4); }
.temp code { display: inline-block; font: 900 20px/1.2 Consolas, "Courier New", monospace; background: #111; color: var(--yel); padding: 4px 10px; border-radius: 4px; margin: 6px 0; user-select: all; }
.roles { margin-top: 14px; color: var(--dim); font-size: 14px; } .roles p { margin: 4px 0; } .roles b { color: var(--ink); }

/* ---- dialog ---- */
dialog { width: min(720px, calc(100vw - 16px)); max-height: calc(100vh - 16px); border: 0; border-top: 6px solid var(--red); border-radius: 10px; background: var(--navy); color: var(--ink); padding: 16px 14px 18px; overflow-y: auto; }
dialog::backdrop { background: rgba(3, 6, 28, .78); }
dialog form { display: grid; gap: 12px; }
dialog h2 { margin: 0; }
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; background: var(--yel); color: #111; border-radius: 8px; padding: 8px; font: 900 italic 13px var(--heavy); letter-spacing: .08em; }
.score b { font-size: 34px; padding: 0 14px; letter-spacing: 0; }
.pitch { display: grid; gap: 10px; grid-template-columns: 1fr; }
.half { background: #1b7a3a linear-gradient(90deg, rgba(255, 255, 255, .06) 50%, transparent 0) 0 0/64px 100%; border-radius: 10px; padding: 10px; border-top: 6px solid var(--bro); display: grid; gap: 10px; }
.half.liv { border-top-color: var(--liv); }
.half h3 { margin: 0; font: 900 italic 18px var(--heavy); text-transform: uppercase; text-shadow: 2px 2px 0 rgba(0, 0, 0, .5); }
.pos { background: rgba(8, 16, 60, .88); border-radius: 8px; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.step { display: grid; grid-template-columns: 48px 44px 48px; align-items: center; text-align: center; }
.step button { height: 48px; border: 0; border-radius: 6px; background: var(--line); font: 900 24px var(--heavy); cursor: pointer; }
.step button:active { background: var(--yel); color: #111; }
.step output { font: 900 26px var(--heavy); color: var(--yel); }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; } .buttons .btn { flex: 1; }
.was { color: var(--dim); font-size: 13.5px; margin: 0; }

/* ---- bottom tab bar (phone) ---- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(6, 12, 48, .97); border-top: 3px solid var(--yel); }
nav.tabs a { display: grid; place-content: center; justify-items: center; gap: 2px; text-decoration: none; font: 900 10.5px var(--heavy); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
nav.tabs a span { font: 900 19px/1 var(--heavy); color: var(--ink); }
nav.tabs a.on, nav.tabs a.on span { color: var(--yel); }
body.out nav.tabs { display: none; }

.view { display: none; } .view.on { display: block; }

@media (min-width: 600px) { .pitch { grid-template-columns: 1fr 1fr; } .filters { grid-template-columns: 1fr 1fr auto; } .filters .btn { grid-column: auto; } .filters .grow { grid-column: 1 / span 2; } }
@media (min-width: 860px) {
  body { padding-bottom: 16px; } nav.tabs { display: none; } nav.menu { display: flex; } .who { margin-left: 8px; }
  .badge b { font-size: 26px; } .badge span { font-size: 21px; }
}
@media (min-width: 600px) { .filters.three { grid-template-columns: 1fr 220px auto; } .filters.three .grow { grid-column: auto; } }
footer { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 26px; padding-top: 14px; padding-bottom: 8px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; font-weight: 700; }
@media (max-width: 859px) { .who .name, .who .pw { display: none; } .badge span { font-size: 14px; } .badge b { font-size: 19px; } }
.score b { white-space: nowrap; }
@media (max-width: 599px) { .score { font-size: 11px; } .score b { font-size: 30px; padding: 0 8px; } .pos { grid-template-columns: 1fr; } .step { grid-template-columns: 56px 1fr 56px; } }
.who button { white-space: nowrap; }
@media (max-width: 420px) { .badge span { font-size: 12.5px; padding: 6px 7px 5px; } .who button { padding: 0 9px; } }
@media (min-width: 860px) { .filters.find { grid-template-columns: 130px 1fr 1fr 1.4fr auto; } }
