:root {
  color-scheme: light;
  --blue: #0066cc;
  --blue-bright: #1685f8;
  --blue-soft: #e9f3ff;
  --navy: #061c33;
  --navy-soft: #0c2d4d;
  --ink: #0b1f33;
  --muted: #617184;
  --line: #d8e2ed;
  --surface: #ffffff;
  --canvas: #f3f7fb;
  --shadow: 0 16px 38px rgba(13, 41, 69, 0.1);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(22, 133, 248, 0.13), transparent 30rem),
    var(--canvas);
}

button,
a {
  font: inherit;
}

button,
a[href] {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 104px;
  padding: 16px clamp(20px, 3vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(167, 187, 207, 0.75);
  backdrop-filter: blur(18px);
}

.brand-lockup,
.topbar-tools,
.room-identity,
.focus-actions,
.footer-bar,
.local-clock {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: clamp(18px, 2vw, 30px);
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(150px, 15vw, 210px);
  height: 72px;
  object-fit: contain;
  object-position: left center;
  border-right: 1px solid var(--line);
  padding-right: clamp(18px, 2vw, 30px);
}

.event-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1;
}

.topbar-tools {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
}

.local-clock {
  flex-direction: column;
  align-items: flex-end;
  min-width: 120px;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.local-clock time {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.local-clock span {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.connection-pill,
.room-operator,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-pill {
  min-height: 40px;
  padding: 0 15px;
  color: #39526a;
  background: #edf2f7;
  border: 1px solid #d5e0eb;
  white-space: nowrap;
}

.connection-pill.is-ready {
  color: #005f42;
  background: #e6f7f0;
  border-color: #b9e8d6;
}

.status-dot,
.mini-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(22, 133, 248, 0.12);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover {
  color: var(--blue);
  border-color: #a8c9eb;
  box-shadow: 0 8px 18px rgba(13, 41, 69, 0.08);
  transform: translateY(-1px);
}

.icon-button svg,
.room-operator svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dashboard {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 3vw, 50px) clamp(16px, 2.5vw, 40px) 30px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 2.5vw, 2.55rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.section-note {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 24px);
}

.timer-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #cfdbe7;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.room-identity {
  min-width: 0;
  gap: 10px;
}

.room-number {
  color: var(--blue);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.room-header h3 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(0.88rem, 1vw, 1rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-operator {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.room-operator:hover {
  background: #0058b2;
  transform: translateY(-1px);
}

.room-operator.is-disabled {
  color: #627487;
  background: #eff3f7;
  border-color: #d6e0e9;
  cursor: default;
}

.room-operator.is-disabled .mini-dot {
  width: 6px;
  height: 6px;
  background: #91a1b1;
  box-shadow: none;
}

.timer-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  color: inherit;
  background: var(--navy);
  border: 0;
  cursor: zoom-in;
}

.timer-frame,
.focus-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.pending-panel {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 320px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  color: #dcecff;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(22, 133, 248, 0.16), transparent 48%),
    radial-gradient(circle at 80% 15%, rgba(40, 154, 255, 0.22), transparent 26%),
    var(--navy);
}

.pending-panel-compact {
  min-height: 0;
  padding: 18px;
}

.pending-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 66px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(141, 201, 255, 0.45);
  border-radius: 999px;
  background: rgba(4, 29, 54, 0.48);
}

.pending-mark span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 10px rgba(22, 133, 248, 0.8);
}

.pending-mark span:nth-child(2) {
  opacity: 0.58;
}

.pending-mark span:nth-child(3) {
  opacity: 0.28;
}

.pending-kicker {
  margin-bottom: 8px;
  color: #7fc0ff;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pending-panel h3 {
  margin-bottom: 8px;
  color: #fff;
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  letter-spacing: -0.03em;
}

.pending-panel p:last-child {
  max-width: 360px;
  margin-bottom: 0;
  color: #9eb5cc;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pending-panel-compact .pending-mark {
  width: 54px;
  height: 34px;
  margin-bottom: 10px;
}

.pending-panel-compact .pending-kicker {
  margin-bottom: 5px;
}

.pending-panel-compact h3 {
  margin-bottom: 5px;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
}

.pending-panel-compact p:last-child {
  font-size: 0.72rem;
}

.footer-bar {
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding: 14px clamp(20px, 3vw, 48px);
  color: #627487;
  background: #eaf1f7;
  border-top: 1px solid #d4e0eb;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.footer-bar p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.focus-dialog {
  width: min(1500px, calc(100vw - 34px));
  height: min(920px, calc(100vh - 34px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #b9cadd;
  border-radius: 20px;
  box-shadow: 0 35px 90px rgba(0, 20, 42, 0.35);
}

.focus-dialog::backdrop {
  background: rgba(1, 14, 27, 0.74);
  backdrop-filter: blur(6px);
}

.focus-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 16px 15px 24px;
  border-bottom: 1px solid var(--line);
}

.focus-header h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.focus-actions {
  gap: 9px;
}

.text-button {
  min-height: 40px;
  padding: 0 15px;
  text-decoration: none;
}

.operator-button {
  color: #fff;
  background: var(--blue);
}

.output-button {
  color: var(--navy);
  background: var(--blue-soft);
  border: 1px solid #c9e2fb;
}

.text-button.is-disabled {
  color: #77889a;
  background: #eff3f7;
  border: 1px solid #d5e0eb;
  cursor: default;
}

.focus-stage {
  min-height: 0;
  background: var(--navy);
}

.focus-stage .pending-panel {
  min-height: 100%;
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
  }

  .brand-logo {
    width: 150px;
  }

  .event-copy {
    display: none;
  }

  .timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    flex-direction: column;
    gap: 14px;
    padding: 15px 16px;
  }

  .brand-lockup,
  .topbar-tools {
    width: 100%;
  }

  .brand-logo {
    width: 160px;
    height: 58px;
    padding-right: 0;
    border-right: 0;
  }

  .topbar-tools {
    justify-content: flex-start;
  }

  .local-clock {
    align-items: flex-start;
    margin-right: auto;
    padding-right: 12px;
  }

  .connection-pill {
    display: none;
  }

  .dashboard {
    padding-top: 24px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .timer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .focus-dialog {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .focus-header {
    align-items: flex-start;
    padding-left: 16px;
  }

  .focus-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .output-button {
    display: none;
  }
}

@media (max-width: 430px) {
  .room-operator span:last-child {
    display: none;
  }

  .room-operator {
    width: 34px;
    padding: 0;
  }

  .room-operator .mini-dot {
    display: block;
  }
}

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