/* UI kit styles (assets/js/ui/). Element/container classes that predate the
   kit (element, plain, square, player, scorer, list, dialog, overlay, game,
   score, stats) still live in style.min.css — this file only styles what the
   kit added. Per-view CSS keeps layout only. */

/* d-liveBadge */
.livebadge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.1em 0.5em;
  border-radius: 0.6em;
  background: #c0392b;
  color: #fff;
  font-size: 0.7em;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.livebadge::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #fff;
  animation: livebadge-pulse 1.2s ease-in-out infinite;
}

@keyframes livebadge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* d-squareButton icons: inlined svgs may carry fixed width/height
   attributes; height must stay auto for the aspect-ratio sizing in
   style.min.css to work. */
.square .icon svg {
  height: auto;
}

/* d-match — game card (two sides + optional score). Scoped to .element so
   the xoi scoreboard's plain .game div stays untouched; tnmbrackets.css
   loads after this and wins where it overlaps (server-rendered cards). */
.game.element.plain {
  /* .element.plain is a flex row by default; sides belong above each other */
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  font-size: 0.9em;
}

.game.element:hover,
.game.element:focus {
  border-color: orange;
  outline: none;
}

.game.element .pplayer {
  display: flex;
  width: 100%;
  color: #fff;
}

/* the winner of a finished game (d-match `winner`, bracket cards): orange
   name, score as an orange block (after .pplayer, which sets the white) */
.game.element .pplayer.winner {
  color: orange;
}
.game.element .pplayer.winner .legs {
  background-color: orange;
  color: #000;
}

.game.element .pplayer:first-child {
  border-bottom: 0.15rem solid black;
}

.game.element .pplayer :first-child {
  flex-grow: 1;
  padding: 0.2em 0.75em;
  text-align: left;
}

.game.element .pplayer :nth-child(2) {
  padding: 0.2em 0.75em;
  border-left: 0.15rem solid black;
}

.game.element.running {
  border-color: green;
}

/* Disabled elements: core/focus.js skips them in navigation and swallows
   their clicks (live, by this class) */
.element.disabled {
  opacity: 0.4;
  cursor: default;
}

.element.disabled:hover {
  border-color: #000;
}

/* d-tabs */
.tabs {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
}

.tabs .tab {
  padding: 0.3em 1em;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tabs .tab.active {
  border-bottom-color: orange;
}

/* d-team captain marking (member[0] of a 2-player scorer) */
.scorer .player.captain .name::after {
  content: " (C)";
  opacity: 0.7;
  font-size: 0.8em;
}

/* home menu: four squares (Play, Watch, Rankings, Archive) */
body.home .modeselect .element.square {
  width: 18.5em;
  height: 18.5em;
}

/* Online lobby (views/xoi/main.js d-lobby, WP10c/d) */
body.xoi main .gamesetup.lobby {
    width: 75%;
}
body.xoi main .gamesetup.lobby .seats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 1em;
}
body.xoi main .gamesetup.lobby .seats .vs {
    align-self: center;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0.1rem 0.1rem 0.2rem #000;
}
body.xoi main .gamesetup.lobby .seats .open {
    font-size: 1.3rem;
    opacity: 0.75;
    cursor: default;
}
body.xoi main .gamesetup.lobby .settings {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8em;
}
body.xoi main .gamesetup.lobby .settings .label {
    font-size: 1.3rem;
}
body.xoi main .gamesetup.lobby .actions {
    display: flex;
    gap: 1em;
}
body.xoi main .gamesetup.lobby .actions > * {
    flex: 1;
}
body.xoi main .gamesetup.lobby .mode,
body.xoi main .gamesetup.lobby .hint {
    font-size: 1.6rem;
    text-align: center;
    text-shadow: 0.1rem 0.1rem 0.2rem #000;
}
body.xoi main .gamesetup.lobby .hint {
    opacity: 0.85;
}

/* Bot's turn in the visit table (views/xoi/main.js d-botinput, WP10e) */
body.xoi main .xoi .game > div > div.input input.botinput {
    background-color: #e8f0e6;
    caret-color: transparent;
}
body.xoi main .xoi .game > div > div.input input.botinput::placeholder {
    font-style: italic;
    font-size: 0.7em;
}

/* Pickers: d-select launched with class "overlay" — the class lands on
   d-select's own root, so overlay and playerselect are the same element */
.playerselect.overlay > h2 {
    font-size: 1.8em;
    margin-bottom: 0.7em;
    text-align: center;
    text-shadow: 0.2rem 0.2rem 0.4rem #000;
}
.playerselect.overlay {
    display: flex;
    flex-direction: column;
}
/* the list scrolls, the Back below it stays in view */
.playerselect.overlay nav.list.vertical {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.3rem;
}
.playerselect.overlay nav.list.vertical::-webkit-scrollbar {
    width: 0;
}
/* a seat that can't be changed (a member's own seat) */
body.xoi main .gamesetup.lobby .seats .scorer.disabled {
    cursor: default;
    opacity: 0.85;
}

/* Back buttons. Views and dialogs place their own (ui/back.js d-back) where
   it fits; overlays and dialogs at the bottom */
.overlay > .element.plain.back,
.dialog > .element.plain.back {
    flex-shrink: 0;
    width: 22em;
    max-width: 90%;
    margin: 1.2rem auto 0;
}
.dialog > .element.plain.back {
    width: 14em;
}
/* the fallback (core/back.js) for views without one: bottom left */
main {
    position: relative;
}
.appback.element.plain {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    z-index: 1100;
    width: 10rem;
}
.appback[hidden] {
    display: none;
}
/* rejoin banner (core/resume.js): own unfinished games — a bar across the
   top of the app frame, overlaying the page (kit colors: dark green panel,
   black border like .element) */
.resumebanner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1.5rem;
    background-color: #193a16;
    border-bottom: 0.3rem solid #000;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}
.resumebanner .label {
    flex-shrink: 0;
}
.resumebanner .more {
    flex-shrink: 0;
    font-weight: normal;
    opacity: 0.8;
}
.resumebanner a.element.plain {
    min-width: 0;
    padding: 0.3em 1em;
    font-size: 1.2rem;
    text-decoration: none;
    background-color: #2f6f2a;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* game scoreboard: in the nav row */
body.xoi main:has(.xoi) .appback.element.plain {
    bottom: 0.3rem;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
}
body.xoi main .xoi .nav {
    padding-left: 12rem;
}

/* number input overlay (ui/numberInput.js) */
.overlay.numberinput h2 {
    font-size: 1.8em;
    margin-bottom: 0.7em;
    text-align: center;
    text-shadow: 0.2rem 0.2rem 0.4rem #000;
}
.overlay.numberinput .hint {
    font-size: 1.2rem;
    margin: 0.6em 0 1em;
    text-align: center;
    opacity: 0.85;
}
.overlay.numberinput .hint.error {
    color: #ffb4a8;
    opacity: 1;
}
.overlay.numberinput .actions {
    display: flex;
    gap: 1em;
}
.overlay.numberinput .actions > * {
    flex: 1;
}
