/* ------------------------------------------------------------------
   Pomodoro — a three.js focus ritual
   ------------------------------------------------------------------ */

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

:root {
  --bg: #070509;
  --ink: #fff4e8;
  --muted: rgba(255, 244, 232, 0.5);
  --line: rgba(255, 244, 232, 0.1);
  --accent: #ff5f3b;
  --accent-2: #ffb27e;
  --accent-dark: #9b2a14;
  --accent-glow: rgba(255, 95, 59, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --top-h: calc(78px + env(safe-area-inset-top, 0px));
  --dock-h: calc(184px + env(safe-area-inset-bottom, 0px));
  color-scheme: dark;
}

body[data-mode="short"] {
  --accent: #4ee2b5;
  --accent-2: #aef7e0;
  --accent-dark: #13765a;
  --accent-glow: rgba(78, 226, 181, 0.32);
}

body[data-mode="long"] {
  --accent: #67c8ff;
  --accent-2: #bde9ff;
  --accent-dark: #175e85;
  --accent-glow: rgba(103, 200, 255, 0.32);
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background:
    radial-gradient(115% 85% at 50% 20%, #1d0e14 0%, #140b10 30%, #0a070c 58%, #060509 82%);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; }

:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Atmosphere                                                          */
/* ------------------------------------------------------------------ */

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aura {
  position: absolute;
  width: 74vmax;
  height: 74vmax;
  left: 50%;
  top: 41%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 94, 56, 0.12), rgba(255, 94, 56, 0.035) 42%, transparent 66%);
  filter: blur(24px);
  transform: translate(-50%, -50%);
  animation: aura-drift 22s ease-in-out infinite alternate;
}

.cool {
  position: absolute;
  width: 58vmax;
  height: 58vmax;
  left: -12vmax;
  bottom: -22vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 112, 210, 0.09), transparent 64%);
  filter: blur(46px);
}

@keyframes aura-drift {
  from { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
  to   { transform: translate(-49%, -51%) scale(1.1); opacity: 1; }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(125% 95% at 50% 44%, transparent 40%, rgba(0, 0, 0, 0.32) 76%, rgba(0, 0, 0, 0.66) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ------------------------------------------------------------------ */
/* Scene                                                               */
/* ------------------------------------------------------------------ */

.scene {
  position: fixed;
  inset: var(--top-h) 0 var(--dock-h) 0;
  z-index: 1;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.scene-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(255, 244, 232, 0.55);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* Task module — between the clock and the transport                   */
/* ------------------------------------------------------------------ */

.task-module {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--ring-r, 210px) * 1.12);
  z-index: 6;
  width: min(690px, 92vw);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s var(--ease) 0.35s;
}

.is-ready .task-module { opacity: 1; }

.taskbar,
.task-history { pointer-events: auto; }

.taskbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(430px, 100%);
  height: 36px;
  margin: 0 auto;
  padding: 0 8px 0 12px;
  border: 1px solid rgba(255, 244, 232, 0.1);
  border-radius: 999px;
  background: rgba(22, 13, 18, 0.52);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.taskbar:focus-within {
  border-color: rgba(255, 244, 232, 0.24);
  background: rgba(28, 16, 22, 0.68);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--accent-glow);
}

.taskbar.is-locked {
  border-color: rgba(255, 244, 232, 0.13);
  background: rgba(18, 11, 15, 0.58);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.taskbar.is-locked .task-input { color: rgba(255, 244, 232, 0.72); }

.task-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--accent-2);
  opacity: 0.9;
}

.task-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.task-input::placeholder { color: rgba(255, 244, 232, 0.34); }
.task-input[readonly] { cursor: default; }

.task-add {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, transform 0.25s;
}

.task-add:hover,
.task-add:focus-visible {
  color: var(--ink);
  background: rgba(255, 244, 232, 0.09);
  transform: rotate(90deg);
}

.task-add svg { width: 13px; height: 13px; }

.task-lock {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  opacity: 0.85;
}

.task-lock svg { width: 14px; height: 14px; }

/* Task history ------------------------------------------------------ */

.task-history {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(660px, 100%);
  min-height: 24px;
  margin: 6px auto 0;
  padding: 0 2px;
}

.task-history-label {
  flex: none;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.32);
}

.task-history-count {
  flex: none;
  margin-left: -4px;
  font-size: 7px;
  font-weight: 500;
  color: var(--accent-2);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.task-list {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 2px;
  white-space: nowrap;
  scrollbar-width: none;
}

.task-list::-webkit-scrollbar { display: none; }

.task-list-empty {
  flex: none;
  padding: 0 2px;
  font-size: 8px;
  letter-spacing: 0.04em;
  color: rgba(255, 244, 232, 0.27);
}

.task-chip {
  flex: none;
  display: flex;
  align-items: center;
  height: 24px;
  border: 1px solid rgba(255, 244, 232, 0.1);
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.035);
  transition: border-color 0.25s, background 0.25s, opacity 0.25s;
}

.task-chip:hover { border-color: rgba(255, 244, 232, 0.2); }

.task-chip-main {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  min-width: 0;
  max-width: 170px;
  padding: 0 6px 0 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 232, 0.62);
  font: inherit;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.25s;
}

.task-chip-main:hover { color: var(--ink); }
.task-chip-main:disabled { opacity: 1; cursor: default; }

.task-chip-status {
  width: 10px;
  height: 10px;
  flex: none;
  display: grid;
  place-items: center;
  color: rgba(255, 244, 232, 0.4);
}

.task-chip-status svg { width: 10px; height: 10px; }

.task-chip-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.task-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-chip.is-active {
  border-color: var(--accent);
  background: rgba(255, 244, 232, 0.075);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.task-chip.is-active .task-chip-main { color: var(--ink); }

.task-chip.is-done { opacity: 0.55; }

.task-chip.is-done .task-chip-text {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 244, 232, 0.4);
}

.task-chip.is-done .task-chip-status { color: var(--accent-2); }

.task-chip-delete {
  width: 21px;
  height: 100%;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
  color: rgba(255, 244, 232, 0.28);
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}

.task-chip-delete:hover,
.task-chip-delete:focus-visible {
  color: #ff9a7c;
  background: rgba(255, 100, 70, 0.12);
}

.task-chip-delete svg { width: 9px; height: 9px; }

.task-module.is-locked .task-chip-delete { display: none; }
.task-module.is-locked .task-chip-main { cursor: default; }
.task-module.is-locked .task-chip:hover { border-color: rgba(255, 244, 232, 0.1); }

/* ------------------------------------------------------------------ */
/* Readout inside the ring                                             */
/* ------------------------------------------------------------------ */

.dial {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.readout {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--ring-r, 210px) * 0.55);
  height: clamp(60px, calc(var(--ring-r, 210px) * 0.38), 96px);
  transform: translate(-50%, 5px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 18px);
  opacity: 0;
  transition: opacity 1s var(--ease) 0.4s, transform 1s var(--ease) 0.4s;
}

.is-ready .readout { opacity: 1; transform: translate(-50%, 0); }

.clock-slot {
  position: relative;
  width: clamp(104px, calc(var(--ring-r, 210px) * 0.7), 176px);
  height: 100%;
  display: grid;
  place-items: center;
}

.clock-face {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}

.clock-digital { opacity: 1; visibility: visible; transform: none; }
.clock-analog { opacity: 0; visibility: hidden; transform: scale(0.94); }

body[data-clock="analog"] .clock-digital { opacity: 0; visibility: hidden; transform: scale(0.96); }
body[data-clock="analog"] .clock-analog { opacity: 1; visibility: visible; transform: none; }

.time {
  position: relative;
  display: flex;
  align-items: baseline;
  font-family: "Segoe UI Variable Display", "SF Pro Display", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, calc(var(--ring-r, 210px) * 0.245), 62px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: #fff6ea;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 26px rgba(0, 0, 0, 0.55),
    0 2px 44px rgba(0, 0, 0, 0.35);
}

.time .colon {
  display: inline-block;
  margin: 0 0.045em;
  opacity: 0.7;
  transform: translateY(-0.05em);
}

body.is-running .time .colon { animation: colon-pulse 2s ease-in-out infinite; }

@keyframes colon-pulse {
  0%, 100% { opacity: 0.72; }
  50%      { opacity: 0.3; }
}

.analog-svg {
  width: clamp(58px, calc(var(--ring-r, 210px) * 0.37), 96px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.07));
}

.analog-rim {
  fill: rgba(255, 244, 232, 0.05);
  stroke: rgba(255, 244, 232, 0.22);
  stroke-width: 0.8;
}

.analog-tick {
  stroke: rgba(255, 244, 232, 0.36);
  stroke-width: 0.9;
  stroke-linecap: round;
}

.analog-tick.major {
  stroke: rgba(255, 244, 232, 0.7);
  stroke-width: 1.2;
}

.analog-hand {
  stroke-linecap: round;
  transition: transform 0.2s linear;
}

.analog-minute { stroke: #fff4e8; stroke-width: 2.3; }
.analog-second { stroke: var(--accent); stroke-width: 1.1; opacity: 0.85; }
.analog-center { fill: var(--accent-2); }

.readout-divider {
  width: 1px;
  height: 58%;
  flex: none;
  background: rgba(255, 244, 232, 0.13);
}

.percent-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-bottom: 1px;
}

.percent-value {
  display: flex;
  align-items: flex-start;
  font-size: clamp(20px, calc(var(--ring-r, 210px) * 0.13), 34px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.percent-sign {
  margin-left: 1px;
  margin-top: 0.12em;
  font-size: 0.52em;
  font-weight: 500;
  color: var(--accent-2);
}

.percent-label {
  margin-top: 2px;
  font-size: clamp(7px, calc(var(--ring-r, 210px) * 0.036), 9px);
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.44);
}

.session {
  position: static;
  display: flex;
  gap: 5px;
  margin-top: 6px;
  transform: none;
}

.pip {
  width: clamp(5px, calc(var(--ring-r, 210px) * 0.028), 7px);
  height: clamp(5px, calc(var(--ring-r, 210px) * 0.028), 7px);
  border-radius: 50%;
  background: rgba(255, 244, 232, 0.38);
  box-shadow: 0 0 0 1px rgba(8, 4, 8, 0.22);
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease), transform 0.45s var(--ease);
}

.pip.on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.16);
}

/* ------------------------------------------------------------------ */
/* Top bar                                                             */
/* ------------------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-h);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: env(safe-area-inset-top, 0px) clamp(16px, 3.4vw, 40px) 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 1s var(--ease) 0.1s, transform 1s var(--ease) 0.1s;
}

.is-ready .topbar {
  opacity: 1;
  transform: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 21px;
  height: 21px;
  flex: none;
  filter: drop-shadow(0 2px 10px rgba(255, 80, 40, 0.35));
}

.brand-name {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.82);
  white-space: nowrap;
}

.brand-sub {
  margin-left: 2px;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.28);
  white-space: nowrap;
}

/* Mode switcher ---------------------------------------------------- */

.modes {
  justify-self: center;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 244, 232, 0.08);
  border-radius: 999px;
  background: rgba(20, 12, 17, 0.34);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mode {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.48);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.35s, background 0.35s, box-shadow 0.35s;
}

.mode::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 244, 232, 0.13);
  transition: background 0.35s, box-shadow 0.35s;
}

.mode em {
  font-style: normal;
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.mode:hover { color: rgba(255, 244, 232, 0.82); }

.mode.is-active {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mode.is-active::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.mode.is-active em { color: var(--accent-2); opacity: 0.9; }

/* Top actions ------------------------------------------------------ */

.top-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 244, 232, 0.09);
  background: rgba(255, 244, 232, 0.035);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: rgba(255, 244, 232, 0.65);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.35s, background 0.35s, border-color 0.35s, transform 0.35s var(--ease);
}

.icon-btn:hover {
  color: var(--ink);
  background: rgba(255, 244, 232, 0.08);
  border-color: rgba(255, 244, 232, 0.18);
  transform: translateY(-1px);
}

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn .sound-off { display: none; }
body.is-muted .icon-btn .sound-on { display: none; }
body.is-muted .icon-btn .sound-off { display: block; }

/* Clock face picker ------------------------------------------------ */

.clock-wrap { position: relative; }

.clock-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: 214px;
  padding: 12px;
  border: 1px solid rgba(255, 244, 232, 0.12);
  border-radius: 16px;
  background: rgba(20, 12, 17, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: popover-in 0.2s var(--ease);
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.popover-title {
  margin: 0 0 8px 4px;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.4);
}

.clock-options { display: flex; flex-direction: column; gap: 3px; }

.clock-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 244, 232, 0.62);
  font: inherit;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}

.clock-option:hover {
  color: var(--ink);
  background: rgba(255, 244, 232, 0.06);
}

.clock-option[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(255, 244, 232, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.clock-sample {
  width: 38px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 244, 232, 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 244, 232, 0.55);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.clock-sample svg { width: 17px; height: 17px; }

.clock-option[aria-pressed="true"] .clock-sample {
  border-color: var(--accent);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.clock-option-label {
  flex: 1;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Dock / controls                                                     */
/* ------------------------------------------------------------------ */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dock-h);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s var(--ease) 0.3s, transform 1s var(--ease) 0.3s;
}

.is-ready .dock { opacity: 1; transform: none; }

.controls {
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
}

.round {
  position: relative;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 244, 232, 0.12);
  background: rgba(255, 244, 232, 0.035);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: rgba(255, 244, 232, 0.62);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s, color 0.35s, border-color 0.35s;
}

.round:hover {
  transform: translateY(-2px);
  background: rgba(255, 244, 232, 0.08);
  border-color: rgba(255, 244, 232, 0.2);
  color: var(--ink);
}

.round:active { transform: scale(0.95); }
.round svg { width: 19px; height: 19px; }

.primary {
  position: relative;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #200a05;
  background:
    radial-gradient(110% 110% at 32% 20%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 42%),
    linear-gradient(158deg, var(--accent-2) 0%, var(--accent) 46%, var(--accent-dark) 100%);
  box-shadow:
    0 20px 50px -12px var(--accent-glow),
    0 4px 14px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -10px 22px rgba(0, 0, 0, 0.22);
  transition: transform 0.4s var(--ease), box-shadow 0.6s var(--ease), background 0.6s var(--ease);
}

.primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 26px 64px -12px var(--accent-glow),
    0 6px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -10px 22px rgba(0, 0, 0, 0.2);
}

.primary:active { transform: scale(0.96); }

.primary::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

body.is-running .primary::after {
  opacity: 0.3;
  animation: ring-pulse 3.2s ease-out infinite;
}

@keyframes ring-pulse {
  0%   { transform: scale(0.98); opacity: 0.32; }
  70%  { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}

.primary .icon { width: 27px; height: 27px; fill: currentColor; }
.primary .icon-pause { display: none; }
body.is-running .primary .icon-play { display: none; }
body.is-running .primary .icon-pause { display: block; }

body.is-running .primary {
  background:
    radial-gradient(110% 110% at 32% 20%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%),
    linear-gradient(158deg, var(--accent-2) 0%, var(--accent) 46%, var(--accent-dark) 100%);
}

.hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 244, 232, 0.3);
  pointer-events: auto;
}

.hint kbd {
  padding: 2px 5px;
  border: 1px solid rgba(255, 244, 232, 0.12);
  border-radius: 4px;
  background: rgba(255, 244, 232, 0.03);
  color: rgba(255, 244, 232, 0.5);
  font: inherit;
  letter-spacing: 0.08em;
}

.hint .sep { opacity: 0.4; }

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--top-h) + 16px);
  bottom: auto;
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 232, 0.12);
  background: rgba(24, 14, 19, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: rgba(255, 244, 232, 0.86);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ */
/* Misc                                                                */
/* ------------------------------------------------------------------ */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: #070509;
  color: #fff4e8;
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 760px) {
  :root {
    --top-h: calc(64px + env(safe-area-inset-top, 0px));
    --dock-h: calc(158px + env(safe-area-inset-bottom, 0px));
  }

  .brand-name { font-size: 9.5px; letter-spacing: 0.28em; }
  .brand-sub { display: none; }
  .brand-mark { width: 19px; height: 19px; }

  .modes { padding: 3px; }
  .mode { padding: 9px 10px; font-size: 8.5px; letter-spacing: 0.13em; gap: 5px; }
  .mode em { display: none; }

  .primary { width: 68px; height: 68px; }
  .primary .icon { width: 23px; height: 23px; }
  .round { width: 46px; height: 46px; }
  .round svg { width: 18px; height: 18px; }
  .controls { gap: 16px; }
  .hint { display: none; }

  .task-module {
    width: 94vw;
    top: calc(50% + var(--ring-r, 210px) * 1.3);
  }

  .taskbar {
    height: 34px;
    gap: 8px;
    padding: 0 7px 0 11px;
  }

  .task-icon { width: 14px; height: 14px; }
  .task-input { font-size: 10.5px; }
  .task-add,
  .task-lock { width: 22px; height: 22px; }
  .task-add svg { width: 12px; height: 12px; }
  .task-lock svg { width: 13px; height: 13px; }
  .task-history { margin-top: 5px; gap: 6px; }
  .task-history-label { font-size: 6.5px; }
  .task-history-count { font-size: 6.5px; }
  .task-list { gap: 4px; }
  .task-chip { height: 22px; }
  .task-chip-main { max-width: 132px; font-size: 8px; }
  .task-chip-delete { width: 19px; }
  .toast { top: calc(var(--top-h) + 10px); font-size: 8.5px; }
}

@media (max-width: 620px) {
  .brand-name { display: none; }
}

@media (max-width: 430px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .brand { gap: 8px; }
  .modes { gap: 0; }
  .mode { padding: 9px 8px; letter-spacing: 0.1em; }
  .icon-btn { width: 34px; height: 34px; }
  .task-module { width: calc(100vw - 20px); }
}

@media (max-height: 720px) {
  .taskbar {
    height: 32px;
    gap: 7px;
    padding: 0 7px 0 10px;
  }
  .task-input { font-size: 10px; }
  .task-add,
  .task-lock { width: 22px; height: 22px; }
  .task-icon { width: 14px; height: 14px; }
  .task-history { margin-top: 4px; min-height: 22px; }
  .task-chip { height: 22px; }
  .task-chip-main { max-width: 140px; font-size: 8px; }
  .task-chip-delete { width: 19px; }
}

@media (max-height: 640px) {
  :root {
    --top-h: calc(58px + env(safe-area-inset-top, 0px));
    --dock-h: calc(142px + env(safe-area-inset-bottom, 0px));
  }
  .primary { width: 60px; height: 60px; }
  .primary .icon { width: 21px; height: 21px; }
  .round { width: 42px; height: 42px; }
  .hint { display: none; }
  .taskbar { height: 30px; }
  .task-input { font-size: 9.5px; }
  .task-history { margin-top: 3px; min-height: 20px; }
  .task-chip { height: 20px; }
  .task-chip-main { font-size: 7.5px; max-width: 120px; }
  .task-chip-delete { width: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
