/* The Live View page's base styles: the same theme as the tournament tool's window (copied from src/Web/Assets/app.css).
   Inside the tool this file is not used; the window's own app.css is there already. */

/* Tournament Setup - one dark theme. Every colour is a variable defined here. */

:root {
  color-scheme: dark;

  /* Neutrals: deep blue-black with a cool hue */
  --bg: #0a0f1c;
  --rail: #070b16;
  --surface: #111a2e;
  --surface-2: #172239;
  --surface-3: #202e4c;
  --inset: #0c1424;
  --border: #1f2b46;
  --border-strong: #35466d;
  --field-border: #5470a6;
  --scrim: rgba(5, 8, 17, 0.68);

  --text: #e8edf8;
  --text-2: #b3bdd6;
  --text-3: #8f9cbb;

  /* Primary accent (PLAY and main actions) and secondary accent (selection, focus, progress) */
  --accent: #ff7a2b;
  --accent-hover: #ff9147;
  --accent-press: #ee661a;
  --accent-tint: rgba(255, 122, 43, 0.14);
  --on-accent: #1d0d02;
  --accent-2: #4cc9f0;
  --accent-2-tint: rgba(76, 201, 240, 0.14);
  --accent-2-line: rgba(76, 201, 240, 0.5);
  --focus: #7fdcf7;

  /* Meaning */
  --ok: #4fdc9b;
  --ok-tint: rgba(79, 220, 155, 0.13);
  --warn: #ffc857;
  --warn-tint: rgba(255, 200, 87, 0.13);
  --err: #ff8591;
  --err-tint: rgba(255, 133, 145, 0.14);
  --danger: #c62f42;
  --danger-hover: #d03a4c;
  --on-danger: #ffffff;
  --star: #ffd45c;

  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --rail-w: 216px;
  --dock-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: 0.92em; }

::selection { background: rgba(76, 201, 240, 0.35); color: #fff; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); font-weight: 700; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.noscript { padding: 24px; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text);
  font-weight: 600; font-size: 14px; line-height: 1.2; text-align: center;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.08s, box-shadow 0.12s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; }
.btn .icon { font-size: 1.1em; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }
.btn-primary:disabled { background: var(--surface-3); color: var(--text-3); }

.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--accent-2-line); }
.btn-secondary:active:not(:disabled) { background: var(--surface-2); }
.btn-secondary:disabled { background: transparent; border-color: var(--border); color: var(--text-3); }

.btn-caution { color: var(--err); }
.btn-caution:disabled { color: var(--text-3); }

.btn-quiet { color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-quiet:active:not(:disabled) { background: var(--surface-3); }
.btn-quiet:disabled { color: var(--text-3); opacity: 0.6; }

.btn-danger { background: var(--danger); color: var(--on-danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger:disabled { background: var(--surface-3); color: var(--text-3); }

.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 0; width: 40px; }
.btn-icon.btn-sm { width: 32px; }


.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 30px 36px; }
.page-wide { max-width: 1440px; }
.page-narrow { max-width: 780px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.lead { color: var(--text-2); margin-top: 4px; max-width: 62ch; }

.label { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.02em; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack:empty { display: none; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; min-width: 0; }
.panel + .panel { margin-top: 20px; }
.play-side .panel + .panel { margin-top: 0; }
.panel h2 { font-size: 18px; font-weight: 700; }
.panel-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.panel-head p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.panel-head-sm { margin-bottom: 12px; }
.panel-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--accent-tint); color: var(--accent); font-size: 20px; }
.panel-ico-2 { background: var(--accent-2-tint); color: var(--accent-2); }
.panel-compact { padding: 18px 22px 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; gap: 10px; }
.field-label small { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.input {
  width: 100%; min-height: 40px; padding: 0 12px; background: var(--inset); color: var(--text);
  border: 1px solid var(--field-border); border-radius: 10px;
  transition: border-color 0.12s;
}
.input:hover { border-color: var(--accent-2-line); }
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
select.input {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3bdd6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
select.input option { background: var(--surface-2); color: var(--text); }

/* ---- dialogs: the same boxes as the tool's (app.css "Overlays"), for the hub's own page --------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade 0.14s ease-out;
}
.modal {
  display: flex; flex-direction: column; width: min(540px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.8); animation: pop 0.16s ease-out;
}
.modal-wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 8px; }
.modal-head h2 { font-size: 19px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.modal-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-2-tint); color: var(--accent-2); font-size: 19px; }
.modal-ico.is-warn { background: var(--warn-tint); color: var(--warn); }
.modal-ico.is-danger { background: var(--err-tint); color: var(--err); }
.modal-body { min-height: 0; overflow: auto; padding: 6px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal-msg { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-backdrop, .modal { animation: none; } }
