:root { --lc-border-width: 2px; --lc-panel-radius: 28px; color-scheme: dark; font-family: ui-sans-serif, system-ui, sans-serif; color: #f5f5f0; background: #1d1d1b; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Only life controls reserve simultaneous fingers; the rest of the page keeps scrolling/zoom. */
button[data-delta] { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { cursor: pointer; border: var(--lc-border-width) solid #ffffff26; border-radius: 12px; background: #ffffff08; color: inherit; min-height: 44px; padding: 10px 14px; }
button:hover { background: #ffffff14; }
button:active { background: #ffffff24; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f4d28b; outline-offset: 3px; }
[hidden] { display: none !important; }
.lc-app { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); max-width: 1600px; margin: 0 auto; }
.lc-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 2px; }
.lc-header h1 { font-size: 18px; line-height: 1.3; margin: 0; }
.lc-header h1 span { color: #bebebb; font-size: 14px; font-weight: 400; margin-left: 6px; }
.lc-header p { margin: 4px 0 0; font-size: 14px; color: #bebebb; }
.lc-back { order: -1; height: 44px; min-width: 44px; padding: 0 10px; border: var(--lc-border-width) solid #ffffff26; border-radius: 12px; font-size: 12px; color: #bebebb; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.lc-back svg { flex-shrink: 0; display: block; }
.lc-back.is-tournament-link .lc-site-icon { display: none; }
.lc-header > div:first-child { min-width: 0; flex: 1; }
.lc-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lc-back.is-tournament-link { order: -1; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: var(--lc-border-width) solid #ffffff26; border-radius: 12px; color: inherit; }
.lc-back.is-tournament-link [data-back-label] { display: none; }
.lc-back.is-tournament-link:hover { background: #ffffff14; }
[data-theme="mono"] .lc-back { border-color: #000; border-radius: 0; }
[data-theme="mono"] .lc-back.is-tournament-link:hover { background: #0000000d; }
.lc-focus-toggle, .lc-fullscreen { appearance: none; -webkit-appearance: none; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; padding: 0; line-height: 1; display: grid; place-items: center; }
.lc-focus-toggle svg, .lc-fullscreen svg { display: block; }
.lc-fullscreen { color: #bebebb; }
.lc-play-area { position: relative; display: flex; flex: 1; min-height: 0; min-width: 0; }
.lc-board { display: grid; flex: 1; min-height: 0; gap: 10px; grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lc-board[data-count="3"], .lc-board[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lc-board[data-count="3"] .lc-player:last-child { grid-column: 1 / -1; }
.lc-player { --accent: #9ad8d0; position: relative; background: #203b39; border: var(--lc-border-width) solid #9ad8d045; border-radius: var(--lc-panel-radius); min-width: 0; min-height: 0; overflow: hidden; }
.lc-player[data-color="1"] { --accent: #ead091; background: #3b3020; border-color: #ead09145; }
.lc-player[data-color="2"] { --accent: #d2bee8; background: #30283e; border-color: #d2bee845; }
.lc-player[data-color="3"] { --accent: #b1cee9; background: #233449; border-color: #b1cee945; }
.lc-player.is-starting { border-color: var(--accent); }
.lc-player-inner { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: clamp(10px, 2vmin, 26px); position: relative; }
.lc-player.is-rotated .lc-player-inner { transform: rotate(180deg); }
.lc-player-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-player-identity { min-width: 0; }
.lc-player h2 { color: var(--accent); font-size: clamp(16px, 2.6vmin, 24px); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-flip { flex-shrink: 0; display: grid; place-items: center; padding: 0; width: 44px; height: 44px; line-height: 1; border-color: transparent; color: var(--accent); }
.lc-starter { font-size: 14px; font-weight: 700; color: var(--accent); margin: 3px 0 0; }
.lc-readout { position: relative; z-index: 1; pointer-events: none; display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; flex: 1; min-height: 0; }
.lc-total { --lc-delta-space: clamp(24px, 5vmin, 36px); position: relative; min-width: 0; min-height: 0; align-self: stretch; display: grid; place-items: center; padding-top: var(--lc-delta-space); }
.lc-value { position: relative; min-width: 0; display: grid; place-items: center; }
.lc-change { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font-size: clamp(22px, 5vmin, 34px); font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; pointer-events: none; }
.lc-readout output { font-size: clamp(80px, 27vmin, 170px); font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; letter-spacing: -.05em; }
.lc-player.is-zero output { color: #ffc2b8; }
.lc-board[data-count="2"] .lc-readout output[data-digits="3"] { font-size: clamp(54px, 20vmin, 124px); }
.lc-board .lc-readout output[data-digits="4"], .lc-board .lc-readout output[data-digits="5"] { font-size: clamp(28px, 8vmin, 60px); }
.lc-step { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; height: 100%; z-index: 0; display: flex; align-items: center; justify-content: flex-start; font-size: clamp(32px, 7vmin, 64px); color: var(--accent); border-color: transparent; background: transparent; padding: 0 0 0 6%; user-select: none; }
.lc-step[data-delta="1"] { left: auto; right: 0; justify-content: flex-end; padding: 0 6% 0 0; }
.lc-quick { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 20px; }
.lc-quick button { border-color: #ffffff20; padding: 8px 16px; color: var(--accent); font-weight: 600; min-width: 54px; }
.lc-quick span { font-size: 14px; letter-spacing: .15em; color: var(--accent); }
.lc-footer { flex-shrink: 0; }
.lc-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.lc-tools button { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px; font-size: 14px; flex: 1; max-width: 180px; min-width: 74px; padding: 5px; }
.lc-tools button span { color: #d6b476; font-size: 18px; line-height: 1; flex-shrink: 0; }
.lc-local-note { font-size: 14px; text-align: center; color: #bebebb; margin: 4px 0 0; }
.lc-notice { color: #ead091; font-size: 14px; padding: 10px 12px; margin: 0; border: var(--lc-border-width) solid #ead09140; border-radius: 12px; }
.lc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
dialog { padding: 0; border: var(--lc-border-width) solid #ffffff30; border-radius: 20px; background: #252623; color: #f5f5f0; max-width: min(560px, calc(100vw - 24px)); width: 100%; max-height: 90vh; max-height: 90dvh; }
dialog::backdrop { background: #000b; }
.lc-dialog-content { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.lc-dialog-content h2 { margin: 0; font-size: 24px; }
.lc-dialog-content p { margin: 0; line-height: 1.6; color: #bebebb; }
.lc-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lc-dialog-header button { font-size: 24px; padding: 0 12px; }
.lc-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lc-dialog-content label { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.lc-dialog-content input, .lc-dialog-content select { background: #1d1d1b; border: var(--lc-border-width) solid #ffffff40; border-radius: 8px; padding: 12px; color: #f5f5f0; min-width: 0; width: 100%; font-size: 16px; }
.lc-name-fields { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lc-name-fields legend { margin-bottom: 12px; font-weight: 600; }
.lc-name-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.lc-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.lc-primary { background: #8abeb7; border-color: #8abeb7; color: #172522; font-weight: 700; }
.lc-primary:hover { background: #a8d5cf; }
.lc-help { font-size: 14px; }
.lc-start-overlay { position: absolute; inset: 0; z-index: 4; background: inherit; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--accent); opacity: 1; transition: opacity 300ms ease; }
.lc-player.is-rotated .lc-start-overlay { transform: rotate(180deg); }
.lc-start-copy { position: relative; min-width: 0; max-width: 100%; }
.lc-start-copy p { margin: 0 0 8px; font-size: 16px; line-height: 1.3; }
.lc-start-number { display: block; font-size: clamp(64px, 20vmin, 140px); line-height: 1; font-variant-numeric: tabular-nums; }
.lc-start-copy .lc-start-name { font-weight: 600; font-size: clamp(16px, 4vmin, 28px); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-start-result { display: block; font-size: clamp(24px, 7vmin, 56px); line-height: 1.15; }
.lc-start-overlay[data-phase="winner"]::before, .lc-start-overlay[data-phase="fading"]::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%); }
.lc-start-overlay[data-phase="fading"] { opacity: 0; }
[data-theme="mono"] .lc-start-overlay::before { background: none; }
@supports (container-type: size) {
  .lc-start-overlay { container-type: size; }
  .lc-start-number { font-size: clamp(36px, min(50cqw, 50cqh), 140px); }
  .lc-start-result { font-size: clamp(24px, min(13cqw, 25cqh), 56px); }
  .lc-start-copy .lc-start-name { font-size: clamp(16px, 8cqw, 28px); }
}
.lc-app.is-choosing .lc-focus-tools { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .lc-start-overlay { transition: none; } }
.lc-install { border-top: var(--lc-border-width) solid #ffffff30; padding-top: 16px; display: grid; gap: 12px; }
.lc-install h3 { font-size: 18px; margin: 0; }
.lc-update { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 8px 12px; font-size: 14px; border: var(--lc-border-width) solid currentColor; }
.lc-app.is-focused .lc-update { display: none; }
/* Monochrome is deliberately flat: no colored panels, shadows or decorative fills. */
:root[data-theme="mono"] { color-scheme: light; color: #000; background: #fff; }
[data-theme="mono"] button { border-color: #000; background: transparent; border-radius: 0; }
[data-theme="mono"] button:hover { background: #0000000d; }
[data-theme="mono"] button:active { background: #00000020; }
[data-theme="mono"] :is(button, a, input, select):focus-visible { outline-color: #000; }
[data-theme="mono"] .lc-player { --accent: #000; color: #000; background: #fff; border-color: #000; }
[data-theme="mono"] :is(.lc-header h1 span, .lc-header p, .lc-back, .lc-fullscreen, .lc-local-note, .lc-tools button span, .lc-dialog-content p, .lc-player.is-zero output) { color: #000; }
[data-theme="mono"] .lc-player.is-zero output { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
[data-theme="mono"] :is(.lc-step, .lc-flip) { border-color: transparent; }
[data-theme="mono"] .lc-quick button { border-color: #000; }
[data-theme="mono"] dialog { color: #000; background: #fff; border: var(--lc-border-width) solid #000; border-radius: 0; }
[data-theme="mono"] :is(.lc-dialog-content input, .lc-dialog-content select) { color: #000; background: #fff; border-color: #000; border-radius: 0; }
[data-theme="mono"] .lc-primary { color: #fff; background: #000; }
[data-theme="mono"] .lc-primary:hover { background: #222; }
[data-theme="mono"] .lc-notice { color: #000; border-color: #000; border-radius: 0; }
[data-theme="mono"] .lc-install { border-color: #000; }
[data-theme="mono"] .lc-player:nth-child(odd) { --accent: #fff; color: #fff; background: #000; border-color: #fff; }
[data-theme="mono"] .lc-player:nth-child(odd) button { border-color: #fff; }
[data-theme="mono"] .lc-player:nth-child(odd) button:hover { background: #ffffff1a; }
[data-theme="mono"] .lc-player:nth-child(odd) button:active { background: #ffffff33; }
[data-theme="mono"] .lc-player:nth-child(odd) button:focus-visible { outline-color: #fff; }
[data-theme="mono"] .lc-player:nth-child(odd) :is(.lc-step, .lc-flip) { border-color: transparent; }
[data-theme="mono"] .lc-player:nth-child(odd).is-zero output { color: #fff; }
@media (max-width: 599px) {
  .lc-header h1 span { display: block; margin: 2px 0 0; }
  .lc-board:not([data-count="2"]) h2 { white-space: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lc-board:not([data-count="2"]) .lc-readout { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(24px, 1fr) 44px; gap: 2px; }
  .lc-board:not([data-count="2"]) .lc-total { grid-row: 1; grid-column: 1 / -1; }
  .lc-board:not([data-count="2"]) output { font-size: clamp(32px, 10vmin, 64px); }
  .lc-board:not([data-count="2"]) .lc-step { grid-row: 2; min-height: 44px; font-size: 28px; }
  .lc-board:not([data-count="2"]) .lc-quick { gap: 8px; margin-top: 6px; }
  .lc-board:not([data-count="2"]) .lc-quick span { display: none; }
  .lc-board:not([data-count="2"]) .lc-quick button { min-width: 44px; padding: 6px 10px; }
}
@media (orientation: landscape) and (min-width: 600px) {
  .lc-board[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr; }
  .lc-readout output { font-size: clamp(64px, 23vmin, 170px); }
}
.lc-focus-tools { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5; display: flex; gap: 14px; }
.lc-focus-tools button { width: 52px; height: 52px; min-width: 52px; padding: 0; display: grid; place-items: center; background: #1d1d1b; color: #fff; border-color: #fff; font-size: 24px; line-height: 1; }
.lc-focus-tools svg { width: 26px; height: 26px; }
[data-theme="mono"] .lc-focus-tools button { color: #000; background: #fff; border-color: #000; }
.lc-app:not(.is-focused) .lc-focus-tools, .lc-app:not(.is-focused) .lc-restore { display: none; }
.lc-app.is-focused :is(.lc-header, .lc-footer, .lc-player-header, .lc-quick) { display: none; }
.lc-app.is-focused .lc-readout { height: 100%; }
@supports (container-type: size) {
  .lc-readout { container-type: size; }
  .lc-board .lc-player .lc-readout output { font-size: clamp(24px, min(40cqw, 80cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 170px); }
  .lc-board .lc-player .lc-readout output[data-digits="3"] { font-size: clamp(22px, min(28cqw, 80cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 124px); }
  .lc-board .lc-player .lc-readout output:is([data-digits="4"], [data-digits="5"]) { font-size: clamp(18px, min(18cqw, 80cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 80px); }
  @media (max-width: 599px) {
    .lc-board:not([data-count="2"]) .lc-player .lc-readout output { font-size: clamp(24px, min(16cqw, 32cqh), 56px); }
    .lc-app.is-focused .lc-board .lc-player .lc-readout output { font-size: clamp(24px, min(40cqw, 80cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 170px); }
  }
}
@media (max-width: 599px) {
  .lc-header h1 { font-size: 16px; }
  .lc-header h1 span { display: none; }
  .lc-header p { font-size: 12px; }
  .lc-header-actions { gap: 4px; }
  .lc-back { font-size: 14px; white-space: nowrap; }
  .lc-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .lc-tools button { min-width: 0; max-width: none; font-size: 12px; }
}
@media (max-width: 599px) {
  .lc-back { width: 44px; flex: 0 0 44px; padding: 0; }
  .lc-back [data-back-label] { display: none; }
}
@media (max-height: 650px) {
  .lc-header h1 span, .lc-header p, .lc-local-note { display: none; }
  .lc-player-header { flex-shrink: 0; }
  .lc-board:not([data-count="2"]) .lc-quick { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .lc-app { gap: 4px; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .lc-board[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr; }
  .lc-board[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 1fr; }
  .lc-board[data-count="3"] .lc-player:last-child { grid-column: auto; }
  .lc-board:not([data-count="2"]) .lc-readout { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(24px, 1fr) 44px; gap: 2px; }
  .lc-board:not([data-count="2"]) .lc-total { grid-row: 1; grid-column: 1 / -1; }
  .lc-board:not([data-count="2"]) .lc-step { grid-row: 2; }
  .lc-player h2 { font-size: 14px; }
  .lc-player-inner { padding: 4px; }
  .lc-quick { display: none; }
  .lc-step { min-height: 44px; }
}
@media (max-height: 650px) {
  .lc-app { gap: 6px; }
  :root { --lc-panel-radius: 24px; }
  .lc-player-header { min-height: 32px; }
  .lc-flip { min-height: 44px; }
  .lc-player-inner { padding: 6px 10px; }
  .lc-readout output { font-size: clamp(44px, 13vmin, 100px); }
  .lc-tools button { padding: 5px; }
  .lc-tools button span, .lc-local-note { display: none; }
}
/* The numbers are visual only; the two real buttons underneath own each half.
   Header, rotation, quick changes and the central dock retain higher hit layers. */
.lc-board .lc-player .lc-readout { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.lc-board .lc-player .lc-total { grid-column: 1; grid-row: 1; }
.lc-app.is-focused .lc-board:is([data-count="3"], [data-count="4"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.lc-app.is-focused .lc-board[data-count="3"] .lc-player:last-child { grid-column: 1 / -1; }
.lc-app.is-focused { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (display-mode: fullscreen), (display-mode: standalone) {
  .lc-app { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@supports (container-type: size) {
  @media (max-width: 599px) {
    .lc-board:not([data-count="2"]) .lc-player .lc-readout output { font-size: clamp(24px, min(36cqw, 70cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 100px); }
    .lc-board:not([data-count="2"]) .lc-player .lc-readout output:is([data-digits="4"], [data-digits="5"]) { font-size: clamp(18px, min(16cqw, 70cqh, calc(100cqh - var(--lc-delta-space) - 8px)), 56px); }
  }
}
/* Tap feedback is timed in JavaScript, never tied to a sticky mobile :hover. */
.lc-app .lc-board .lc-player button[data-delta],
.lc-app .lc-board .lc-player button[data-delta]:is(:hover, :active) { background: transparent; }
.lc-quick button { position: relative; }
.lc-player button[data-delta]::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--lc-tap-flash, #ffffff1a); opacity: 0; }
.lc-player button[data-delta].is-tap-lit::after { animation: lc-tap-pulse 200ms ease-out both; }
@keyframes lc-tap-pulse { from { opacity: 1; } to { opacity: 0; } }
.lc-player .lc-step { border-width: 0; border-radius: 0; }
[data-theme="mono"] .lc-player { --lc-tap-flash: #00000018; }
[data-theme="mono"] .lc-player:nth-child(odd) { --lc-tap-flash: #ffffff26; }
@media (prefers-reduced-motion: reduce) { .lc-player button[data-delta].is-tap-lit::after { animation: none; opacity: 1; } }

/* Rainbow: saturated auroras on dark surfaces keep the white life totals legible. */
:root[data-theme="rainbow"] { color-scheme: dark; background: #140b25; color: #fff5ff; }
[data-theme="rainbow"] .lc-header h1 { color: #fff0ff; text-shadow: 0 0 18px #ff5ddd70; }
[data-theme="rainbow"] :is(.lc-header h1 span, .lc-header p, .lc-back, .lc-local-note, .lc-fullscreen) { color: #e4c9f7; }
[data-theme="rainbow"] .lc-player { --accent: #fff1ff; --lc-tap-flash: #ffffff2b; border-color: #f2a9ef; background: linear-gradient(140deg, #83184d, #51219a 35%, #164a88 68%, #086052); }
[data-theme="rainbow"] .lc-player[data-color="1"] { --accent: #fff2c1; border-color: #ffd580; background: linear-gradient(140deg, #8c340e, #813052 35%, #5e2595 68%, #214f89); }
[data-theme="rainbow"] .lc-player[data-color="2"] { --accent: #c8ffff; border-color: #73edeb; background: linear-gradient(140deg, #086052, #174d87 35%, #6d259a 68%, #8b245d); }
[data-theme="rainbow"] .lc-player[data-color="3"] { --accent: #ffe0ff; border-color: #d1b0ff; background: linear-gradient(140deg, #5f2499, #8b245d 35%, #8c400f 68%, #17605e); }
[data-theme="rainbow"] .lc-player::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 18% 24%, #fff5 0 1px, transparent 2px), radial-gradient(circle at 78% 18%, #fff4 0 2px, transparent 3px), radial-gradient(circle at 88% 76%, #fff3 0 1px, transparent 2px); }
[data-theme="rainbow"] .lc-player.is-starting { border-color: #fff; }
[data-theme="rainbow"] .lc-readout output { color: #fff; text-shadow: 0 2px 2px #180921, 0 0 24px #ff9fe833; }
[data-theme="rainbow"] :is(.lc-tools button, .lc-focus-tools button, .lc-primary) { color: #fff5ff; background: linear-gradient(125deg, #782467, #3d3586, #174e79); border-color: #dca2f2; }
[data-theme="rainbow"] .lc-tools button span { color: #ffda85; }
[data-theme="rainbow"] dialog { background: #211132; border-color: #dca2f2; }
[data-theme="rainbow"] :is(.lc-dialog-content input, .lc-dialog-content select) { color: #fff5ff; background: #160c24; border-color: #a870c5; }

/* Keep the save action outside the scrollable settings, including short screens. */
#lc-settings { overflow: hidden; }
#lc-settings-form { padding: 0; gap: 0; max-height: calc(90vh - var(--lc-border-width) - var(--lc-border-width)); max-height: calc(90dvh - var(--lc-border-width) - var(--lc-border-width)); }
#lc-settings .lc-dialog-header { padding: 14px 16px 10px; flex-shrink: 0; }
#lc-settings .lc-dialog-header h2 { font-size: 22px; }
.lc-settings-body { overflow-y: auto; min-height: 0; padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 14px; }
#lc-settings .lc-dialog-actions { padding: 10px 16px; border-top: var(--lc-border-width) solid currentColor; flex-shrink: 0; }
#lc-settings :is(input, select) { padding: 8px; min-height: 44px; }
#lc-settings label { gap: 5px; min-width: 0; }
#lc-settings .lc-name-fields { gap: 10px; }
#lc-settings .lc-name-fields legend { margin-bottom: 8px; }
#lc-settings-form:not(.has-colors) .lc-name-row { grid-template-columns: minmax(0, 1fr); }
.lc-settings-help summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.lc-settings-help > p { margin: 8px 0; }

/* Text passes through to the life controls; only the rotate button captures taps. */
.lc-player-header { pointer-events: none; }
.lc-flip { pointer-events: auto; }
.has-round .lc-player-identity { flex: 1; }
.lc-round-clock { display: flex; flex: 0 0 auto; width: 100%; min-width: 0; min-height: 38px; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; gap: 2px; pointer-events: none; user-select: none; color: var(--accent); }
.lc-round-clock small { font-size: 11px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-round-clock strong { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lc-round-clock.is-message strong { font-size: 12px; white-space: normal; }
.lc-round-clock [data-round-sync] { font-size: 10px; }
.lc-round-clock.is-stale [data-round-label] { display: none; }
.has-round.is-focused .lc-board[data-count="2"] { row-gap: 52px; }
@media (orientation: landscape) and (min-width: 480px) {
  .has-round .lc-board[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr; row-gap: 0; }
}
.lc-tournament-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lc-tournament-settings button { flex: 1; }
[data-tournament-return], .lc-login-link { color: inherit; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
#lc-tournament .lc-dialog-content { padding: 16px; gap: 14px; }
#lc-tournament .lc-dialog-header h2 { font-size: 22px; }
[data-theme="rainbow"] .lc-change { text-shadow: 0 1px 4px #160c24; }

/* Panel geometry is independent of metadata: the life total stays at its exact
   center. Named container breakpoints adapt to the panel, not just the screen. */
.lc-player-inner { display: block; padding: 0; container: lc-panel / size; --lc-edge: clamp(8px, 2vmin, 16px); }
.lc-player-header { position: absolute; top: var(--lc-edge); left: var(--lc-edge); right: var(--lc-edge); height: 44px; }
.lc-quick { position: absolute; bottom: var(--lc-edge); left: 0; right: 0; height: 44px; margin: 0; }
.lc-round-clock { position: absolute; z-index: 1; top: calc(var(--lc-edge) + 44px); left: 0; height: 38px; min-height: 0; }
.lc-board .lc-player .lc-readout { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr; gap: 0; --lc-reserve: 92px; --lc-life-width: 40cqw; --lc-life-min: 48px; --lc-life-max: 170px; --lc-delta-side: 0; }
.has-round .lc-player .lc-readout { --lc-reserve: 140px; }
.lc-board .lc-player .lc-total { padding: 0; width: 100%; height: 100%; }
:is(.lc-app, .lc-app.is-focused) .lc-board .lc-player .lc-readout output { font-size: clamp(var(--lc-life-min), min(var(--lc-life-width), 56cqh, calc(100cqh - 2 * var(--lc-reserve) - 8px)), var(--lc-life-max)); }
:is(.lc-app, .lc-app.is-focused) .lc-board .lc-player .lc-readout output[data-digits="3"] { --lc-life-width: 28cqw; --lc-life-min: 28px; --lc-life-max: 124px; }
:is(.lc-app, .lc-app.is-focused) .lc-board .lc-player .lc-readout output:is([data-digits="4"], [data-digits="5"]) { --lc-life-width: 18cqw; --lc-life-min: 18px; --lc-life-max: 80px; }
.lc-board:not([data-count="2"]) .lc-player .lc-readout { --lc-reserve: 52px; --lc-life-min: 24px; --lc-life-max: 100px; --lc-life-width: 36cqw; }
.lc-focus-name { display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); max-width: calc(100cqw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: 13px; font-weight: 500; line-height: 1.2; }
.lc-app.is-focused .lc-focus-name { display: block; }
.lc-app.is-focused .lc-player .lc-readout { --lc-reserve: 32px; }
.has-round.is-focused .lc-player .lc-readout { --lc-reserve: 112px; }
.has-round.is-focused .lc-round-clock { top: 32px; }
.has-round.is-focused .lc-board[data-count="2"] { row-gap: 10px; }
.lc-focus-tools { gap: 14px; }
@container lc-panel (max-height: 440px) {
  .lc-player-header { top: 6px; left: 10px; right: 10px; }
  .lc-round-clock { top: 39px; height: 29px; flex-direction: column; gap: 1px; line-height: 1; }
  .lc-round-clock strong { font-size: 18px; }
  .lc-round-clock small { font-size: 10px; }
  .lc-board .lc-player .lc-readout { --lc-reserve: 44px; --lc-delta-side: 1; }
  .has-round .lc-player .lc-readout { --lc-reserve: 72px; }
  .lc-app.is-focused .lc-player .lc-readout { --lc-reserve: 24px; }
  .has-round.is-focused .lc-player .lc-readout { --lc-reserve: 62px; }
  .lc-change { left: calc(100% + clamp(4px, 2cqw, 8px)); bottom: 50%; transform: translateY(50%); font-size: clamp(12px, 6cqw, 20px); }
  .has-round.is-focused .lc-round-clock { top: 28px; }
}
@container lc-panel (max-height: 220px) {
  .lc-player-header { top: 4px; align-items: flex-start; }
  .lc-player-identity { padding-top: 3px; }
  .lc-player-identity h2 { font-size: 12px; line-height: 14px; white-space: nowrap; display: block; }
  .lc-round-clock { top: 22px; height: 24px; }
  .lc-round-clock small { font-size: 9px; }
  .lc-round-clock strong { font-size: 14px; }
  .lc-quick { display: none; }
  .lc-board .lc-player .lc-readout { --lc-reserve: 30px; }
  .has-round .lc-player .lc-readout { --lc-reserve: 48px; }
  .has-round.is-focused .lc-player .lc-readout { --lc-reserve: 46px; }
  .has-round.is-focused .lc-round-clock { top: 18px; }
  .lc-focus-name { font-size: 11px; top: calc(100% + 4px); }
}
/* Small portrait phones keep the title and all actions on one row. */
@media (max-width: 599px) and (max-height: 720px) and (orientation: portrait) {
  .lc-app { gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .lc-header p, .lc-local-note { display: none; }
}
