@font-face {
  font-family: "Barlow Condensed";
  src: url("assets/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #101011;
  --surface: #151516;
  --surface-hover: #202022;
  --line: #2c2b29;
  --line-soft: #232323;
  --text: #f0ede6;
  --muted: #92918b;
  --dim: #82817b;
  --gold: #d6b776;
  --gold-bright: #ebcb88;
  --gold-dim: #928057;
  --green: #8bab93;
  --danger: #ed8677;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  font-size: 14px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, input, select { outline: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: 0.28; }
button, a, input { touch-action: manipulation; }
button { color: inherit; }
button, input, select { border-radius: 6px; }
button { transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease; }
svg { width: 20px; height: 20px; stroke-width: 1.7; flex: 0 0 auto; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.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; }
.app-shell { max-width: 1512px; margin: 0 auto; padding: 0 48px; }

.app-header { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-mark { display: flex; align-items: center; justify-content: center; color: var(--gold); width: 42px; height: 46px; }
.brand-mark svg { width: 36px; height: 36px; fill: var(--gold); stroke-width: 1; }
.brand h1 { font-size: 19px; line-height: 1.4; font-weight: 600; }
.brand p { margin-top: 5px; color: var(--gold-dim); font-size: 9px; font-weight: 500; }
.header-caption { font-size: 10px; color: var(--dim); margin-left: auto; margin-right: 28px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { border: 1px solid transparent; background: transparent; width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--muted); position: relative; }
.icon-button:hover:not(:disabled) { color: var(--text); background: var(--surface-hover); }
.icon-button[aria-expanded="true"] { background: var(--surface-hover); color: var(--gold); }
.fullscreen-button { color: var(--gold); }
.toolbar-divider { height: 18px; width: 1px; background: var(--line); margin: 0 8px; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; z-index: 20; pointer-events: none; top: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(-3px); white-space: nowrap; padding: 7px 9px; background: #30302e; border: 1px solid #45443f; border-radius: 4px; color: var(--text); font-size: 11px; opacity: 0; transition: opacity 120ms ease, transform 120ms ease; }
[data-tooltip]:hover:not(:disabled)::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.fullscreen-button::after { left: auto; right: 0; transform: translateY(-3px); }
.fullscreen-button:hover::after, .fullscreen-button:focus-visible::after { transform: translateY(0); }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: calc(100dvh - 147px); }
.timer-panel { width: min(900px, 100%); min-width: 0; justify-self: center; display: flex; flex-direction: column; padding: 30px 0 34px; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stage-label { display: flex; align-items: center; gap: 14px; }
.eyebrow { font-size: 11px; color: var(--muted); }
.level-indicator { display: flex; gap: 8px; align-items: baseline; }
.level-indicator strong { color: var(--gold); font-family: "Barlow Condensed", sans-serif; font-size: 28px; line-height: 1; font-weight: 600; }
.level-indicator > span { color: var(--dim); font-size: 12px; }
.buyin-state { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--green); }
.buyin-state svg { width: 15px; height: 15px; }
.buyin-state.closed { color: var(--danger); }
.scoreboard { width: 100%; max-width: 640px; align-self: center; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 29px; }
.blinds-display { display: grid; grid-template-columns: minmax(110px, 1fr) 48px minmax(110px, 1fr); align-items: end; text-align: center; min-width: 330px; max-width: 100%; }
.blind { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.blind-label { font-size: 12px; color: #c2bfb8; }
.blind-label > span { font-size: 10px; margin-left: 6px; color: var(--dim); }
.blind-value { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 59px; font-weight: 600; line-height: 1.04; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.blind-slash { color: #555047; font-family: "Barlow Condensed", sans-serif; font-size: 36px; line-height: 1.45; font-weight: 600; }
.clock-face { width: min(420px, 100%); height: 252px; position: relative; margin: 24px 0; flex-shrink: 0; }
.clock-slider { --clock-color: var(--gold); width: min(420px, 100%); height: 44px; position: relative; flex: 0 0 auto; justify-self: center; margin-top: 16px; border-radius: 6px; outline: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.clock-slider:focus-visible { outline: 1px solid var(--gold-dim); outline-offset: 2px; }
.clock-slider-track { position: absolute; top: calc(50% - 2.5px); left: 22px; right: 22px; height: 5px; border-radius: 3px; background: #37342d; pointer-events: none; }
.clock-slider-fill { display: block; width: calc(var(--progress) * 100%); height: 100%; background: var(--clock-color); border-radius: inherit; }
.clock-handle { position: absolute; top: 50%; left: calc(var(--progress) * 100%); transform: translate(-50%, -50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; pointer-events: auto; }
.clock-handle::after { content: ""; width: 14px; height: 14px; border: 2px solid var(--clock-color); border-radius: 50%; background: var(--background); box-shadow: 0 0 0 4px var(--background); }
.clock-slider:hover .clock-handle::after, .clock-slider:focus-visible .clock-handle::after { background: var(--clock-color); }
.is-seeking .clock-slider, .clock-slider.is-seeking { cursor: grabbing; }
.is-seeking .clock-handle::after { background: var(--clock-color); box-shadow: 0 0 0 4px var(--background), 0 0 0 5px var(--gold-dim); }
.clock-slider[aria-disabled="true"] { cursor: not-allowed; }
.clock-slider[aria-disabled="true"] .clock-handle { opacity: 0.4; }
.clock-inner { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.clock-caption { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.clock-digits { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 132px; line-height: 1.08; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; width: 100%; text-align: center; }
.clock-digits.long-time { font-size: 94px; }
.clock-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); min-height: 20px; margin-top: 10px; }
.status-dot { width: 5px; height: 5px; background: var(--muted); border-radius: 50%; }
.stage-duration { font-size: 10px; color: var(--dim); margin-top: 18px; }
.is-running .clock-status { color: var(--green); }
.is-running .status-dot { background: var(--green); }
.is-paused .clock-status { color: var(--gold); }
.is-paused .status-dot { background: var(--gold); }
.is-warning .clock-digits, .is-warning .clock-status { color: var(--gold-bright); }
.is-urgent .clock-slider { --clock-color: var(--danger); }
.is-urgent .clock-digits, .is-urgent .clock-status { color: var(--danger); }
.is-urgent .status-dot { background: var(--danger); }
.is-ringing .clock-slider { --clock-color: var(--gold-bright); }
.is-ringing .clock-digits { color: var(--gold-bright); }
.is-ringing .clock-status, .is-complete .clock-status { color: var(--gold); }
.is-ringing .status-dot, .is-complete .status-dot { background: var(--gold); }
.playback-controls { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.control-button { width: 44px; height: 48px; border-color: var(--line); }
.control-button svg { width: 18px; height: 18px; }
.primary-button, .quiet-button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
.primary-button { background: var(--gold); color: #1c1a15; border-color: var(--gold); }
.primary-button:hover:not(:disabled) { background: var(--gold-bright); border-color: var(--gold-bright); }
.primary-button:active:not(:disabled) { background: #c3a367; }
.primary-button svg, .quiet-button svg { width: 17px; height: 17px; }
.play-button { min-width: 156px; height: 48px; font-weight: 600; }
.play-button:disabled { opacity: 0.72; cursor: wait; }
.button-icon { display: flex; align-items: center; justify-content: center; }
.play-button .button-icon svg { width: 19px; height: 19px; }
.quiet-button { background: #1b1b1b; color: #d2cfc6; border-color: var(--line); }
.quiet-button:hover:not(:disabled) { background: #272624; border-color: #49453c; }
.reset-button { width: 36px; height: 44px; }
.reset-button svg { width: 18px; height: 18px; }
.controls-divider { background: var(--line); width: 1px; height: 21px; margin-left: 3px; }
.next-stage { display: flex; align-items: center; gap: 20px; width: min(420px, 100%); justify-self: center; margin-top: 8px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.next-stage-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.next-stage-label svg { width: 15px; height: 15px; }
.next-stage > strong { font-family: "Barlow Condensed", sans-serif; font-size: 25px; font-weight: 600; color: #d3d0c9; font-variant-numeric: tabular-nums; }
.next-stage > strong span { color: #65635d; margin: 0 5px; }
.next-duration { margin-left: auto; font-family: "Barlow Condensed", sans-serif; font-size: 23px; color: #c7c4bb; white-space: nowrap; }
.next-duration span { font-family: "Segoe UI", sans-serif; font-size: 10px; margin-left: 4px; color: var(--dim); }
.next-notice { color: var(--danger); font-size: 11px; display: flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 18px; }
.next-notice svg { width: 13px; height: 13px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; min-height: 47px; border-top: 1px solid var(--line); font-size: 8px; color: #82817b; }

.sound-anchor { position: relative; }
.sound-popover { position: absolute; z-index: 40; top: calc(100% + 14px); right: -46px; width: 270px; padding: 21px; border: 1px solid #454037; border-radius: 8px; background: #1a1918; box-shadow: 0 16px 50px #0009; }
.popover-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; }
.popover-heading h2 { font-size: 13px; font-weight: 500; }
.subtle { font-size: 10px; color: var(--muted); }
.setting-line { display: flex; justify-content: space-between; align-items: center; min-height: 35px; font-size: 12px; }
.switch { height: 24px; width: 42px; padding: 3px; background: #4a4844; border: 0; border-radius: 20px; display: flex; align-items: center; }
.switch > span { width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform 150ms; }
.switch[aria-checked="true"] { background: var(--gold); }
.switch[aria-checked="true"] > span { transform: translateX(18px); background: #282116; }
.volume-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; margin: 18px 0 8px; }
.volume-label output { color: #d0c5af; }
input[type="range"] { width: 100%; height: 22px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.sound-preview { margin-top: 18px; width: 100%; min-height: 36px; font-size: 11px; }

dialog { padding: 0; color: var(--text); background: #171717; border: 1px solid #494132; border-radius: 8px; box-shadow: 0 28px 100px #0008; }
dialog::backdrop { background: #000b; backdrop-filter: blur(5px); }
.rules-dialog { width: 620px; max-width: calc(100% - 32px); max-height: calc(100dvh - 48px); overflow: hidden; }
.rules-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.dialog-heading .eyebrow { font-size: 9px; color: var(--gold-dim); }
.dialog-heading h2 { font-size: 20px; font-weight: 500; margin-top: 7px; }
.rules-scroll { padding: 23px 28px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4b4437 transparent; }
.rules-columns, .rule-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 66px 28px; gap: 13px; align-items: center; }
.rules-columns { color: var(--muted); font-size: 11px; padding-bottom: 10px; }
.rule-row { margin-bottom: 8px; }
.rule-index { font-size: 11px; color: var(--gold-dim); font-variant-numeric: tabular-nums; }
.rule-row input { width: 100%; min-width: 0; height: 38px; color: #e0dbce; background: #20201f; border: 1px solid #37352f; padding: 0 9px; font-size: 12px; font-variant-numeric: tabular-nums; }
.rule-row input:invalid { border-color: #c07768; }
.rule-row input::-webkit-inner-spin-button { opacity: 0; }
.rule-row input:focus::-webkit-inner-spin-button { opacity: 1; }
.rule-row .icon-button { width: 28px; height: 34px; }
.rule-row .icon-button svg { width: 14px; height: 14px; }
.rule-row .icon-button:hover { color: var(--danger); }
.add-level-button { width: 100%; margin-top: 7px; border-style: dashed; background: transparent; color: var(--muted); font-size: 11px; min-height: 36px; }
.buyin-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--line); }
.buyin-setting label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.buyin-setting label svg { width: 15px; height: 15px; color: var(--gold-dim); }
.buyin-setting select { width: 123px; height: 36px; padding: 0 10px; color: var(--text); background: #25231f; border: 1px solid #443c2e; font-size: 12px; }
.form-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin-top: 14px; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 19px 28px; border-top: 1px solid var(--line); flex-shrink: 0; }
.dialog-actions > div { display: flex; gap: 10px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 8px 0; }
.text-button svg { width: 13px; height: 13px; }
.text-button:hover { color: var(--gold); }
.confirm-dialog { width: 390px; max-width: calc(100% - 32px); padding: 30px; }
.confirm-symbol { display: flex; color: var(--gold); margin-bottom: 18px; }
.confirm-symbol svg { width: 26px; height: 26px; }
.confirm-dialog h2 { font-size: 19px; font-weight: 500; }
.confirm-dialog p { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 12px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 27px; }
.toast { position: fixed; z-index: 100; bottom: max(26px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 14px 20px; border: 1px solid #4c4435; border-radius: 6px; box-shadow: 0 8px 35px #0008; background: #292620; color: #e6dac1; font-size: 12px; line-height: 1.6; }
.toast svg { width: 16px; height: 16px; color: var(--gold); }
.noscript-message { padding: 30px; color: var(--gold); text-align: center; }

.is-fullscreen .app-shell { max-width: none; }
.is-fullscreen .app-footer, .is-fullscreen .header-caption { display: none; }
.is-fullscreen .workbench { grid-template-columns: 1fr; min-height: calc(100dvh - 100px); }
.is-fullscreen .timer-panel { width: min(1050px, 100%); justify-self: center; padding-right: 0; }
.is-fullscreen .scoreboard { padding-top: 16px; max-width: 850px; }
.is-fullscreen .clock-face { width: min(470px, 100%); height: 284px; margin: 20px 0; }
.is-fullscreen .clock-digits { font-size: 156px; }
.is-fullscreen .clock-digits.long-time { font-size: 104px; }
.is-fullscreen .blind-value { font-size: 72px; }
.is-fullscreen .blinds-display { min-width: 390px; }

@media (min-width: 1400px) {
  .app-shell { padding: 0 64px; }
  .clock-face { height: 270px; }
  .clock-digits { font-size: 148px; }
  .scoreboard { padding-top: 30px; }
}

@media (max-width: 1099px) {
  .app-shell { padding: 0 28px; }
  .app-header { min-height: 86px; }
  .header-caption { display: none; }
  .workbench { min-height: calc(100dvh - 133px); }
  .scoreboard { padding-top: 36px; }
  .clock-face { height: 240px; margin: 24px 0; }
  .clock-digits { font-size: 124px; }
  .blinds-display { min-width: 290px; grid-template-columns: minmax(100px, 1fr) 32px minmax(100px, 1fr); }
  .blind-value { font-size: 54px; }
  .playback-controls { gap: 8px; }
  .play-button { min-width: 136px; }
  .control-button { width: 39px; }
  .controls-divider { margin-left: 0; }
  .next-stage { gap: 14px; }
  .next-stage > strong { font-size: 23px; }
  .is-fullscreen .workbench { min-height: calc(100dvh - 86px); }
}

@media (max-width: 760px) {
  .app-shell { padding: 0 22px; padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
  .app-header { min-height: 78px; padding-top: env(safe-area-inset-top); gap: 12px; }
  .brand { gap: 8px; }
  .brand-mark { width: 28px; height: 34px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .brand h1 { font-size: 15px; }
  .brand p { font-size: 7px; margin-top: 4px; }
  .header-actions { gap: 2px; }
  .header-actions .icon-button { width: 34px; height: 40px; }
  .header-actions .icon-button svg { width: 18px; height: 18px; }
  .toolbar-divider { margin: 0 3px; height: 15px; }
  .workbench { min-height: calc(100dvh - 125px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .timer-panel { padding: 24px 0 26px; }
  .stage-toolbar { gap: 8px; }
  .stage-label { gap: 10px; }
  .eyebrow { font-size: 10px; }
  .level-indicator strong { font-size: 25px; }
  .level-indicator > span { font-size: 11px; }
  .buyin-state { font-size: 10px; gap: 5px; }
  .buyin-state svg { width: 13px; height: 13px; }
  .scoreboard { padding-top: 28px; }
  .blinds-display { min-width: 270px; grid-template-columns: minmax(95px, 1fr) 34px minmax(95px, 1fr); }
  .blind-value { font-size: 52px; }
  .blind-label { font-size: 11px; }
  .blind-label > span { font-size: 9px; }
  .blind-slash { font-size: 31px; }
  .clock-face { height: 220px; margin: 20px 0; }
  .clock-digits { font-size: 110px; }
  .clock-digits.long-time { font-size: 79px; }
  .clock-caption { font-size: 10px; }
  .clock-status { font-size: 11px; margin-top: 6px; }
  .stage-duration { font-size: 9px; margin-top: 15px; }
  .playback-controls { gap: 9px; }
  .play-button { min-width: 148px; font-size: 13px; }
  .control-button { width: 40px; }
  .reset-button { width: 34px; }
  .next-stage { margin-top: 6px; padding-top: 16px; gap: 15px; }
  .next-stage > strong { font-size: 24px; }
  .next-duration { font-size: 22px; }
  .next-stage-label { font-size: 10px; gap: 5px; }
  .app-footer { padding-bottom: env(safe-area-inset-bottom); font-size: 7px; min-height: 47px; }
  .sound-popover { right: -79px; top: calc(100% + 12px); }
  .rules-dialog { max-height: calc(100dvh - 24px); max-width: calc(100% - 20px); }
  .rules-dialog form { max-height: calc(100dvh - 26px); }
  .dialog-heading { padding: 20px 18px; }
  .dialog-heading h2 { font-size: 18px; }
  .rules-scroll { padding: 18px; }
  .rules-columns, .rule-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 47px 23px; gap: 7px; }
  .rule-row input { height: 40px; padding: 0 6px; font-size: 16px; }
  .rule-row .icon-button { width: 23px; height: 38px; }
  .rule-row input::-webkit-inner-spin-button { -webkit-appearance: none; }
  .buyin-setting { gap: 8px; }
  .buyin-setting label { font-size: 11px; gap: 6px; }
  .buyin-setting select { width: 142px; font-size: 16px; }
  .dialog-actions { padding: 16px 18px; }
  .dialog-actions > div { gap: 7px; }
  .dialog-actions .primary-button, .dialog-actions .quiet-button { padding: 0 12px; font-size: 12px; gap: 6px; }
  .dialog-actions .text-button { font-size: 10px; }
  .confirm-dialog { padding: 26px; }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); padding: 12px 15px; font-size: 11px; width: max-content; }
  .is-fullscreen .workbench { min-height: calc(100dvh - 78px); }
  .is-fullscreen .scoreboard { padding-top: 28px; }
  .is-fullscreen .blinds-display { min-width: 270px; }
  .is-fullscreen .blind-value { font-size: 54px; }
  .is-fullscreen .clock-face { height: 230px; margin: 22px 0; }
  .is-fullscreen .clock-digits { font-size: 116px; }
  .is-fullscreen .clock-digits.long-time { font-size: 79px; }
}

@media (max-width: 359px) {
  .app-shell { padding-left: 15px; padding-right: 15px; }
  .brand h1 { font-size: 13px; }
  .brand p { font-size: 6px; }
  .brand { gap: 6px; }
  .brand-mark { width: 24px; }
  .brand-mark svg { width: 24px; }
  .header-actions .icon-button { width: 30px; }
  .header-actions { gap: 0; }
  .toolbar-divider { margin: 0 2px; }
  .playback-controls { gap: 7px; }
  .play-button { min-width: 128px; }
  .control-button { width: 36px; }
  .reset-button { width: 32px; }
  .clock-face, .is-fullscreen .clock-face { height: 210px; }
  .clock-digits, .is-fullscreen .clock-digits { font-size: 102px; }
  .blinds-display, .is-fullscreen .blinds-display { min-width: 250px; }
  .blind-value, .is-fullscreen .blind-value { font-size: 48px; }
  .rules-scroll { padding: 16px 12px; }
  .dialog-actions { padding: 14px 12px; }
  .dialog-actions .primary-button, .dialog-actions .quiet-button { padding: 0 9px; }
  .dialog-actions .text-button svg { display: none; }
}

@media (max-width: 760px) and (max-height: 740px) and (orientation: portrait) {
  .app-header { min-height: 68px; }
  .workbench { min-height: calc(100dvh - 115px); }
  .timer-panel { padding: 18px 0 20px; }
  .scoreboard, .is-fullscreen .scoreboard { padding-top: 18px; }
  .blind-value, .is-fullscreen .blind-value { font-size: 46px; }
  .clock-face, .is-fullscreen .clock-face { height: 192px; margin: 14px 0; }
  .clock-digits, .is-fullscreen .clock-digits { font-size: 96px; }
  .clock-digits.long-time, .is-fullscreen .clock-digits.long-time { font-size: 69px; }
  .clock-slider { margin-top: 12px; }
  .next-stage { margin-top: 4px; padding-top: 12px; }
  .is-fullscreen .workbench { min-height: calc(100dvh - 68px); }
}

@media (max-height: 760px) and (min-width: 761px) {
  .app-header { min-height: 68px; }
  .workbench { min-height: calc(100dvh - 115px); }
  .is-fullscreen .workbench { min-height: calc(100dvh - 68px); }
  .timer-panel { padding-top: 16px; padding-bottom: 18px; }
  .scoreboard, .is-fullscreen .scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) 310px; grid-template-rows: 86px 64px 44px 52px; align-content: center; column-gap: 45px; width: min(760px, 100%); max-width: 760px; padding-top: 20px; }
  .blinds-display, .is-fullscreen .blinds-display { grid-column: 1; min-width: 0; align-self: center; }
  .blind-value, .is-fullscreen .blind-value { font-size: 58px; }
  .clock-face, .is-fullscreen .clock-face { grid-column: 2; grid-row: 1 / 5; width: 100%; height: 246px; margin: 0; }
  .clock-digits, .is-fullscreen .clock-digits { font-size: 120px; }
  .playback-controls, .is-fullscreen .playback-controls { grid-column: 1; grid-row: 2; justify-content: center; margin-top: 0; }
  .clock-slider { grid-column: 1; grid-row: 3; margin-top: 0; }
  .next-stage, .is-fullscreen .next-stage { grid-column: 1; grid-row: 4; margin-top: 0; padding-top: 12px; }
  .next-notice, .is-fullscreen .next-notice { grid-column: 1 / 3; justify-content: center; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app-header { min-height: 60px; }
  .timer-panel { padding: 10px 0; }
  .app-footer { display: none; }
  .workbench { min-height: calc(100dvh - 60px); }
  .scoreboard, .is-fullscreen .scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) 220px; grid-template-rows: 64px 54px 44px 40px; align-content: center; column-gap: 28px; width: min(700px, 100%); padding-top: 10px; }
  .blinds-display, .is-fullscreen .blinds-display { grid-column: 1; min-width: 0; grid-template-columns: minmax(85px, 1fr) 28px minmax(85px, 1fr); }
  .blind-value, .is-fullscreen .blind-value { font-size: 45px; }
  .blind-label { font-size: 10px; }
  .clock-face, .is-fullscreen .clock-face { grid-column: 2; grid-row: 1 / 5; width: 100%; height: 202px; margin: 0; }
  .clock-digits, .is-fullscreen .clock-digits { font-size: 88px; }
  .clock-digits.long-time, .is-fullscreen .clock-digits.long-time { font-size: 62px; }
  .clock-status { margin-top: 3px; }
  .stage-duration { margin-top: 10px; }
  .playback-controls, .is-fullscreen .playback-controls { grid-column: 1; grid-row: 2; gap: 7px; justify-content: center; margin-top: 0; }
  .play-button { min-width: 124px; }
  .control-button { width: 35px; }
  .reset-button { width: 30px; }
  .clock-slider { grid-column: 1; grid-row: 3; margin-top: 0; }
  .next-stage, .is-fullscreen .next-stage { grid-column: 1; grid-row: 4; margin-top: 0; padding-top: 8px; }
  .next-notice, .is-fullscreen .next-notice { grid-column: 1 / 3; justify-content: center; }
  .is-fullscreen .workbench { min-height: calc(100dvh - 60px); }
  .is-fullscreen .app-header { min-height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (hover: none) {
  [data-tooltip]::after { display: none; }
}
