﻿:root {
  color-scheme: dark;
  --bg: #080d12;
  --panel: #101820;
  --panel-2: #121f2a;
  --line: rgba(135, 170, 185, 0.2);
  --text: #eef7f8;
  --muted: #8ea4ae;
  --accent: #24d18f;
  --accent-2: #f1c94c;
  --danger: #ff5d5d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(36, 209, 143, 0.16), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(241, 201, 76, 0.12), transparent 24%),
    linear-gradient(135deg, #070a0f 0%, #0d161f 48%, #071014 100%);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(12px, 2vh, 20px) 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.8vh, 14px);
  margin-bottom: clamp(10px, 1.8vh, 16px);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 209, 143, 0.5);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(36, 209, 143, 0.16), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 24px rgba(36, 209, 143, 0.16);
  font-size: 25px;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: 0;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.mini-toggle {
  border: 1px solid rgba(241, 201, 76, 0.4);
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff4c4;
  background: rgba(241, 201, 76, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(12px, 1.8vw, 18px);
  align-items: stretch;
}

.command,
.side,
.gate-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 31, 42, 0.94), rgba(11, 17, 24, 0.96));
  box-shadow: var(--shadow);
}

.command {
  min-height: min(460px, calc(100vh - 150px));
  padding: clamp(18px, 3.5vw, 38px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.command::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(36, 209, 143, 0.08) 12% 12.3%, transparent 12.3% 100%),
    linear-gradient(0deg, transparent 0 78%, rgba(255, 255, 255, 0.05) 78% 78.3%, transparent 78.3% 100%);
  opacity: 0.85;
}

.timer-zone {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.timer-main {
  width: min(100%, 720px);
}

.time {
  margin-top: clamp(10px, 1.8vh, 16px);
  font-size: clamp(4.4rem, 12vw, 9rem);
  line-height: 0.92;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 34px rgba(36, 209, 143, 0.18);
}

.phase {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(36, 209, 143, 0.35);
  border-radius: 8px;
  background: rgba(36, 209, 143, 0.08);
  color: #d9fff0;
  font-weight: 800;
  text-transform: uppercase;
}

.phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.progress-bar {
  position: relative;
  z-index: 1;
  height: 14px;
  margin-top: clamp(18px, 3vh, 26px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.progress-fill {
  height: 100%;
  width: calc(var(--progress, 0) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, #24d18f, #f1c94c);
  box-shadow: 0 0 22px rgba(36, 209, 143, 0.35);
  transition: width 0.25s ease;
}

body.stopwatch-mode .progress-bar {
  visibility: hidden;
}

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: clamp(18px, 3vh, 26px);
}

.btn,
.small-btn {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font-weight: 900;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover,
.small-btn:hover,
.mode-option:hover,
.mini-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.11);
}

.btn.primary {
  color: #052015;
  background: linear-gradient(135deg, #30e49e, #d6ff71);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(36, 209, 143, 0.18);
}

.btn.danger {
  color: #ffe7e7;
  border-color: rgba(255, 93, 93, 0.42);
  background: rgba(255, 93, 93, 0.1);
}

.side {
  padding: clamp(14px, 2vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 14px);
}

.section-title {
  margin: 0 0 8px;
  color: #dbecef;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mode-option {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.mode-option.active {
  border-color: rgba(36, 209, 143, 0.72);
  background: rgba(36, 209, 143, 0.11);
  box-shadow: 0 0 0 1px rgba(36, 209, 143, 0.18) inset;
}

.mode-option strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
  text-transform: uppercase;
}

.mode-option span {
  color: var(--muted);
  font-size: 0.92rem;
}

.custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

select option {
  color: #0d161f;
}

input:focus,
select:focus {
  border-color: rgba(36, 209, 143, 0.65);
  box-shadow: 0 0 0 3px rgba(36, 209, 143, 0.1);
}

.small-btn {
  grid-column: 1 / -1;
  color: #fff5c8;
  border-color: rgba(241, 201, 76, 0.38);
  background: rgba(241, 201, 76, 0.08);
}

.online-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.online-heading .section-title {
  margin: 0;
}

.online-count {
  border: 1px solid rgba(36, 209, 143, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  color: #d9fff0;
  background: rgba(36, 209, 143, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.presence-status {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.online-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.online-list li {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 9px;
  color: #edf8f6;
  font-size: 0.95rem;
  line-height: 1.35;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120px);
  width: min(520px, calc(100% - 32px));
  border: 1px solid rgba(241, 201, 76, 0.48);
  border-radius: 10px;
  padding: 15px 18px;
  color: #fff8da;
  background: rgba(18, 24, 22, 0.96);
  box-shadow: var(--shadow);
  font-weight: 900;
  text-align: center;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 50;
}

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

.credit {
  margin-top: clamp(10px, 1.8vh, 16px);
  color: rgba(238, 247, 248, 0.48);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 18px);
  background: rgba(5, 8, 12, 0.86);
  backdrop-filter: blur(10px);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(430px, 100%);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.gate-card .mark {
  margin: 0 auto;
}

.gate-card h1,
.gate-subtitle {
  text-align: center;
}

.gate-subtitle {
  margin: -8px 0 2px;
  color: var(--muted);
}

.gate-error {
  min-height: 20px;
  margin: 0;
  color: #ffd2d2;
  font-size: 0.9rem;
  text-align: center;
}
.mini-player {
  position: fixed;
  top: 86px;
  right: 22px;
  width: 310px;
  height: 225px;
  min-width: 150px;
  min-height: 110px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  resize: both;
  overflow: hidden;
  border: 1px solid rgba(36, 209, 143, 0.45);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(36, 209, 143, 0.13), transparent 44%),
    linear-gradient(180deg, rgba(15, 27, 35, 0.97), rgba(6, 12, 16, 0.98));
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.58), 0 0 34px rgba(36, 209, 143, 0.12);
  z-index: 60;
}

.mini-player[hidden] {
  display: none;
}

.mini-content-scale {
  width: 310px;
  height: 225px;
  transform: scale(var(--mini-scale, 1));
  transform-origin: top left;
}

.mini-header {
  width: 310px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent);
  cursor: move;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  font-weight: 900;
}

.mini-close {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.mini-body {
  width: 310px;
  height: 180px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.mini-time {
  font-size: 4.4rem;
  line-height: 0.95;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-shadow: 0 0 24px rgba(36, 209, 143, 0.22);
}

.mini-phase {
  justify-self: center;
  border: 1px solid rgba(36, 209, 143, 0.35);
  border-radius: 999px;
  padding: 7px 12px;
  color: #d9fff0;
  background: rgba(36, 209, 143, 0.08);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-controls button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font-weight: 900;
}

.mini-controls .primary {
  color: #052015;
  background: linear-gradient(135deg, #30e49e, #d6ff71);
  border-color: transparent;
}

.mini-hint {
  color: rgba(238, 247, 248, 0.52);
  font-size: 0.72rem;
  text-align: center;
}

body.resting {
  --accent: #49b7ff;
  --accent-2: #79d8ff;
}

body.resting .btn.primary,
body.resting .mini-controls .primary {
  background: linear-gradient(135deg, #62c5ff, #c9f2ff);
  color: #041827;
}

@media (min-width: 901px) {
  body {
    overflow-x: hidden;
  }

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

  .layout {
    flex: 1;
    min-height: 0;
  }

  .command,
  .side {
    min-height: 0;
  }

  .side {
    max-height: calc(100vh - 112px);
  }

  .online-panel {
    min-height: 0;
  }

  .online-list {
    max-height: min(22vh, 150px);
    overflow: auto;
    padding-right: 4px;
  }
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .command {
    min-height: 430px;
  }

  .side {
    order: 2;
  }
}

@media (max-width: 580px) {
  .app {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .controls,
  .custom {
    grid-template-columns: 1fr;
  }

  .time {
    font-size: clamp(4.2rem, 25vw, 6.2rem);
  }

  .command {
    padding: 22px;
  }
}

