:root {
  color-scheme: dark;
  --bg: #02080e;
  --panel: rgba(9, 27, 29, 0.82);
  --panel-strong: rgba(19, 99, 77, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.56);
  --text: #f6f7f5;
  --danger: #ef3f45;
  --accent: #26a07b;
  --footer-h: 92px;
  --status-space: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px));
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

button {
  font: inherit;
}

.shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 32px 32px calc(var(--status-space) + 32px);
  color: var(--text);
  isolation: isolate;
  background:
    radial-gradient(circle at 5% 6%, color-mix(in srgb, var(--accent), transparent 64%), transparent 30%),
    radial-gradient(circle at 57% 54%, color-mix(in srgb, var(--accent), transparent 86%), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(180deg, #070b11, #020409 72%);
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.35));
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.68) 78%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}

.brand {
  display: flex;
  align-items: center;
  width: max-content;
}

.brand-logo {
  display: block;
  width: clamp(210px, 17vw, 286px);
  height: auto;
}

.clock {
  position: absolute;
  top: 18px;
  right: 34px;
  font-size: 44px;
  font-weight: 720;
  letter-spacing: 0;
}

.room-head {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  margin-top: min(19dvh, 210px);
  max-width: 980px;
}

.room-head > div {
  min-width: 0;
}

.coin {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 46px color-mix(in srgb, var(--accent), transparent 48%);
}

.coin-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 4.6vw, 64px);
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0;
}

.room-head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 560;
  overflow-wrap: anywhere;
}

.room-head strong {
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quick-card {
  width: min(73vw, calc(100vw - 420px), 1400px);
  margin-top: clamp(42px, 6dvh, 70px);
  padding: 0;
}

.quick-card h2 {
  margin: 0 0 clamp(36px, 5dvh, 58px);
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1;
  font-weight: 700;
}

.quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3.4vw, 56px);
  width: min(1030px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.quick-btn {
  --button-size: 138px;
  --button-font: 38px;
  display: grid;
  flex: 0 0 var(--button-size);
  width: var(--button-size);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 1px solid color-mix(in srgb, var(--accent), white 18%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.13), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), color-mix(in srgb, var(--accent), transparent 91%)),
    rgba(3, 5, 10, 0.56);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 28px color-mix(in srgb, var(--accent), transparent 72%),
    inset 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -26px 48px rgba(0, 0, 0, 0.24);
  color: #fff;
  cursor: pointer;
  font-size: var(--button-font);
  font-weight: 720;
  letter-spacing: 0;
  touch-action: manipulation;
}

.quick-btn[data-minutes="15"] {
  --button-size: clamp(96px, 7vw, 112px);
  --button-font: clamp(25px, 2.1vw, 31px);
}

.quick-btn[data-minutes="30"] {
  --button-size: clamp(116px, 8.1vw, 134px);
  --button-font: clamp(28px, 2.35vw, 36px);
}

.quick-btn[data-minutes="120"] {
  --button-size: clamp(168px, 11.5vw, 196px);
  --button-font: clamp(38px, 3.1vw, 50px);
}

.quick-btn-main {
  --button-size: clamp(146px, 10.1vw, 172px);
  --button-font: clamp(36px, 2.9vw, 48px);
  border-color: rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.42), transparent 29%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent), white 38%), var(--accent) 58%, color-mix(in srgb, var(--accent), black 22%));
  box-shadow:
    0 0 58px color-mix(in srgb, var(--accent), transparent 38%),
    inset 0 1px rgba(255, 255, 255, 0.34),
    inset 0 -30px 56px rgba(0, 0, 0, 0.18);
}

.quick-btn:active {
  transform: scale(0.97);
}

.quick-btn:disabled {
  cursor: wait;
  opacity: 0.54;
  transform: none;
}

.timeline {
  position: absolute;
  top: 122px;
  right: 30px;
  bottom: calc(var(--status-space) + 40px);
  width: min(22vw, 420px);
  min-width: 300px;
  color: rgba(255, 255, 255, 0.62);
}

.timeline-date {
  margin: 0 0 32px 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 20px;
  font-weight: 700;
}

.timeline-track {
  position: relative;
  height: calc(100% - 62px);
  padding-left: 52px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.timeline-track::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.timeline-canvas {
  position: relative;
  min-height: 100%;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
}

.hour-row {
  position: absolute;
  left: -52px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  transform: translateY(-11px);
  font-size: 16px;
  font-weight: 560;
}

.hour-row-day {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.hour-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.045);
}

.event-block {
  position: absolute;
  left: 22px;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-height: 28px;
  padding: 10px 12px;
  overflow: hidden;
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  appearance: none;
  background: color-mix(in srgb, var(--accent), transparent 84%);
  color: #fff;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.event-title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.event-block-current {
  background:
    linear-gradient(90deg, rgba(7, 10, 16, 0.92), color-mix(in srgb, var(--accent), transparent 62%)),
    color-mix(in srgb, var(--accent), transparent 78%);
}

.event-block-selected {
  z-index: 3;
  overflow: hidden;
  border-left-color: var(--accent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent), white 24%),
    0 0 28px color-mix(in srgb, var(--accent), transparent 38%);
}

.event-release {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
  transform: translateY(-50%);
  white-space: nowrap;
}

.event-block:active .event-release {
  transform: translateY(-50%) scale(0.98);
}

.event-block-selected .event-title {
  padding-right: 92px;
}

.now-line {
  position: absolute;
  left: -9px;
  right: 0;
  z-index: 2;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent), transparent 30%);
  pointer-events: none;
}

.now-line::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.status-bar {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  height: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 40px env(safe-area-inset-bottom, 0px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent), white 18%), color-mix(in srgb, var(--accent), black 14%));
  color: #fff;
  font-size: clamp(20px, 2.15vw, 28px);
  font-weight: 640;
}

.status-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
}

#status-title,
#status-detail {
  flex: 0 0 auto;
  white-space: nowrap;
}

#status-title {
  font-weight: 760;
}

#status-detail {
  font-weight: 620;
}

.release-btn {
  height: 56px;
  min-width: 178px;
  margin-left: auto;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
  cursor: pointer;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 740;
  letter-spacing: 0;
  touch-action: manipulation;
}

.release-btn[hidden] {
  display: none;
}

.release-btn:active {
  transform: scale(0.98);
}

.release-btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.shell[data-state="busy"] .status-bar {
  background: linear-gradient(180deg, #ff5b61, #c91f2d);
  color: #fff;
}

.shell[data-state="busy"] .status-dot {
  background: #fff;
}

.toast {
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 24px;
  align-items: center;
  width: min(640px, calc(100vw - 56px));
  padding: 18px 24px;
  border-radius: 10px;
  background: var(--danger);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  color: white;
  font-size: 20px;
  line-height: 1.35;
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

.toast button {
  min-height: 72px;
  border: 0;
  border-radius: 7px;
  background: rgba(112, 0, 0, 0.25);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 1120px) {
  .shell {
    padding: 26px 24px calc(var(--status-space) + 24px);
  }

  .room-head {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 22px;
    margin-top: 16dvh;
    max-width: 62vw;
  }

  .coin {
    width: 98px;
    height: 98px;
  }

  .quick-card {
    width: min(69vw, calc(100vw - 360px));
  }

  .quick-actions {
    gap: clamp(16px, 2.8vw, 34px);
  }

  .timeline {
    min-width: 260px;
  }
}

@media (max-height: 780px) and (orientation: landscape) {
  :root {
    --footer-h: 66px;
  }

  .shell {
    padding: 24px 32px calc(var(--status-space) + 18px);
  }

  .brand-logo {
    width: 238px;
  }

  .clock {
    top: 20px;
    font-size: 38px;
  }

  .room-head {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 22px;
    margin-top: 132px;
  }

  .coin {
    width: 98px;
    height: 98px;
  }

  h1 {
    font-size: clamp(40px, 4.35vw, 56px);
  }

  .room-head p {
    margin-top: 12px;
    font-size: 19px;
  }

  .quick-card {
    margin-top: 32px;
  }

  .quick-card h2 {
    margin-bottom: 26px;
    font-size: 29px;
  }

  .quick-actions {
    width: min(760px, 100%);
  }

  .quick-btn[data-minutes="15"] {
    --button-size: 86px;
    --button-font: 24px;
  }

  .quick-btn[data-minutes="30"] {
    --button-size: 104px;
    --button-font: 29px;
  }

  .quick-btn-main {
    --button-size: 130px;
    --button-font: 36px;
  }

  .quick-btn[data-minutes="120"] {
    --button-size: 154px;
    --button-font: 41px;
  }

  .timeline {
    top: 108px;
    bottom: calc(var(--status-space) + 24px);
  }

  .status-bar {
    padding: 0 38px env(safe-area-inset-bottom, 0px);
    font-size: 26px;
  }

  .release-btn {
    height: 46px;
    min-width: 158px;
    padding: 0 18px;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  :root {
    --footer-h: 60px;
  }

  .shell {
    padding: 16px 20px calc(var(--status-space) + 12px);
  }

  .brand-logo {
    width: 168px;
  }

  .clock {
    top: 16px;
    right: 20px;
    font-size: 30px;
  }

  .room-head {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 16px;
    max-width: calc(100vw - 340px);
    margin-top: clamp(82px, 20dvh, 112px);
  }

  .coin {
    width: 68px;
    height: 68px;
  }

  h1 {
    font-size: clamp(30px, 4.4vw, 42px);
  }

  .room-head p {
    margin-top: 8px;
    font-size: clamp(13px, 1.8vw, 15px);
  }

  .quick-card {
    width: calc(100vw - 340px);
    margin-top: clamp(18px, 5dvh, 28px);
  }

  .quick-card h2 {
    margin-bottom: 16px;
    font-size: clamp(21px, 3vw, 25px);
  }

  .quick-actions {
    gap: 10px;
  }

  .quick-btn[data-minutes="15"] {
    --button-size: 64px;
    --button-font: 20px;
  }

  .quick-btn[data-minutes="30"] {
    --button-size: 76px;
    --button-font: 24px;
  }

  .quick-btn-main {
    --button-size: 88px;
    --button-font: 29px;
  }

  .quick-btn[data-minutes="120"] {
    --button-size: 102px;
    --button-font: 32px;
  }

  .timeline {
    top: 88px;
    right: 20px;
    bottom: calc(var(--status-space) + 14px);
    width: min(31vw, 300px);
    min-width: 240px;
  }

  .timeline-date {
    margin: 0 0 16px 12px;
    font-size: 16px;
  }

  .timeline-track {
    height: calc(100% - 42px);
    padding-left: 42px;
  }

  .hour-row {
    left: -42px;
    font-size: 14px;
  }

  .event-block {
    left: 16px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .event-release {
    right: 8px;
    min-height: 30px;
    padding: 0 12px;
    font-size: 12px;
  }

  .event-block-selected .event-title {
    padding-right: 82px;
  }

  .status-bar {
    gap: 16px;
    padding-right: 20px;
    padding-left: 20px;
    font-size: 22px;
  }

  .status-dot {
    width: 16px;
    height: 16px;
  }

  .release-btn {
    height: 42px;
    min-width: 138px;
    padding: 0 14px;
    font-size: 17px;
  }
}

@media (max-width: 980px) and (max-height: 430px) and (orientation: landscape) {
  :root {
    --footer-h: 56px;
  }

  .brand-logo {
    width: 154px;
  }

  .clock {
    font-size: 28px;
  }

  .room-head {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    margin-top: 58px;
  }

  .coin {
    width: 62px;
    height: 62px;
  }

  h1 {
    font-size: clamp(30px, 4.2vw, 38px);
  }

  .room-head p {
    margin-top: 6px;
    font-size: 13px;
  }

  .quick-card {
    margin-top: 10px;
  }

  .quick-card h2 {
    margin-bottom: 10px;
    font-size: 22px;
  }

  .quick-btn[data-minutes="15"] {
    --button-size: 54px;
    --button-font: 18px;
  }

  .quick-btn[data-minutes="30"] {
    --button-size: 64px;
    --button-font: 21px;
  }

  .quick-btn-main {
    --button-size: 78px;
    --button-font: 27px;
  }

  .quick-btn[data-minutes="120"] {
    --button-size: 88px;
    --button-font: 29px;
  }

  .timeline {
    top: 76px;
    bottom: calc(var(--status-space) + 10px);
    width: min(31vw, 280px);
    min-width: 224px;
  }

  .timeline-date {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .timeline-track {
    height: calc(100% - 36px);
  }

  .status-bar {
    font-size: 20px;
  }

  .release-btn {
    height: 40px;
    min-width: 132px;
    font-size: 16px;
  }
}

@media (max-width: 820px), (orientation: portrait) {
  :root {
    --footer-h: 78px;
  }

  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 24px 20px calc(var(--status-space) + 24px);
  }

  .brand-logo {
    width: 202px;
  }

  .clock {
    top: 22px;
    right: 20px;
    font-size: 32px;
  }

  .room-head {
    grid-template-columns: 76px minmax(0, 1fr);
    max-width: none;
    margin-top: 92px;
  }

  .coin {
    width: 76px;
    height: 76px;
  }

  .room-head p {
    font-size: 16px;
  }

  .quick-card {
    width: 100%;
    min-height: 0;
    margin-top: 34px;
  }

  .quick-card h2 {
    margin-bottom: 28px;
  }

  .quick-actions {
    justify-content: space-between;
    gap: 12px;
  }

  .quick-btn[data-minutes="15"] {
    --button-size: clamp(62px, 16vw, 86px);
    --button-font: clamp(20px, 5vw, 28px);
  }

  .quick-btn[data-minutes="30"] {
    --button-size: clamp(72px, 18vw, 98px);
    --button-font: clamp(22px, 5.4vw, 30px);
  }

  .quick-btn-main {
    --button-size: clamp(86px, 22vw, 116px);
    --button-font: clamp(27px, 6.4vw, 36px);
  }

  .quick-btn[data-minutes="120"] {
    --button-size: clamp(94px, 24vw, 128px);
    --button-font: clamp(28px, 6.6vw, 38px);
  }

  .timeline {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
    height: 280px;
    margin-top: 26px;
  }

  .status-bar {
    gap: 10px;
    padding: 0 20px env(safe-area-inset-bottom, 0px);
    font-size: clamp(17px, 4.8vw, 20px);
  }

  .status-dot {
    width: 16px;
    height: 16px;
  }

  #status-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .release-btn {
    height: 44px;
    min-width: 114px;
    padding: 0 12px;
    font-size: clamp(15px, 3.8vw, 18px);
  }

  .toast {
    top: 76px;
    grid-template-columns: 1fr;
    gap: 14px;
    font-size: 18px;
  }

  .toast button {
    min-height: 52px;
  }
}
