/* 2026-04-15 Poker Blind Timer — White Elegant Theme */

/* ===== Custom Properties ===== */
:root {
  --gold: #b8960c;
  --gold-light: #d4af37;
  --gold-dim: #9a7d0a;
  --red: #c0392b;
  --red-glow: rgba(192, 57, 43, 0.35);
  --emerald: #1e8449;
  --accent: #6c5ce7;
  --accent-soft: rgba(108, 92, 231, 0.12);
  --warm: #d4a574;
  --bg: #f0ece4;
  --panel-bg: rgba(255, 255, 255, 0.45);
  --panel-bg-solid: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(180, 165, 130, 0.25);
  --glass-blur: 32px;
  --text: #2c2416;
  --text-dim: #8a7e6e;
  --font-display: "Orbitron", sans-serif;
  --font-body: "Rajdhani", sans-serif;
  --radius: 22px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

body {
  position: relative;
}

/* Background image — brighter, softer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../bg.jpg") center/cover no-repeat;
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
  filter: brightness(1.6) saturate(0.4) sepia(0.15);
}

/* Ambient warm gradients */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(212, 175, 55, 0.08), transparent 55%), radial-gradient(ellipse at 75% 70%, rgba(108, 92, 231, 0.05), transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(212, 165, 116, 0.06), transparent 50%), radial-gradient(ellipse at 40% 5%, rgba(255, 255, 255, 0.4), transparent 40%);
  z-index: 0;
  pointer-events: none;
  animation: ambient-shift 10s ease-in-out infinite alternate;
}

@keyframes ambient-shift {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

/* ===== Hero Title Banner ===== */
.hero-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  text-align: center;
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.75) 0%, rgba(42, 36, 22, 0.5) 60%, transparent 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: #d4af37;
  letter-spacing: 6px;
  line-height: 1.1;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(212, 175, 55, 0.35),
    0 0 50px rgba(212, 175, 55, 0.12);
  background: linear-gradient(135deg, #c9a227 0%, #f0d060 40%, #d4af37 55%, #a07c10 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
  animation: hero-shimmer 4s ease-in-out infinite;
}

@keyframes hero-shimmer {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(0.6rem, 1.2vw, 0.85rem);
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero-sub-bottom {
  letter-spacing: 6px;
  margin-top: 2px;
}

.hero-line {
  width: 60%;
  max-width: 480px;
  height: 1px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent 0%, rgba(184, 150, 12, 0.3) 20%, rgba(184, 150, 12, 0.5) 50%, rgba(184, 150, 12, 0.3) 80%, transparent 100%);
}

/* ===== Particles (subtle warm) ===== */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation: particle-float linear infinite;
}

.particle:nth-child(3n) {
  background: radial-gradient(circle, rgba(212, 175, 55, 0.5), transparent);
}
.particle:nth-child(3n + 1) {
  background: radial-gradient(circle, rgba(108, 92, 231, 0.3), transparent);
}
.particle:nth-child(3n + 2) {
  background: radial-gradient(circle, rgba(212, 165, 116, 0.4), transparent);
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) scale(0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 0.35;
    transform: translateY(95vh) scale(1) rotate(30deg);
  }
  50% {
    opacity: 0.18;
    transform: translateY(50vh) scale(0.8) rotate(180deg);
  }
  100% {
    transform: translateY(-5vh) scale(0.2) rotate(360deg);
    opacity: 0;
  }
}

/* ===== Toolbar ===== */
.toolbar {
  position: fixed;
  top: 82px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.tool-btn {
  width: 44px;
  height: 44px;
  background: var(--panel-bg-solid);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--gold);
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tool-btn img {
  width: 26px;
  height: 26px;
  filter: brightness(0.6) sepia(0.3);
}

.tool-btn-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-dim);
}

.tool-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px) scale(1.08);
  box-shadow:
    0 6px 24px rgba(184, 150, 12, 0.15),
    0 0 0 1px rgba(184, 150, 12, 0.1);
}

/* ===== Tooltips ===== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 36, 22, 0.9);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  border: 1px solid rgba(212, 175, 55, 0.3);
  animation: tooltip-in 0.2s ease;
}

.toolbar [data-tooltip]:hover::after {
  bottom: auto;
  top: calc(100% + 8px);
}

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== App Layout ===== */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  width: 100vw;
  justify-content: center;
  align-items: center;
  gap: 0;
  perspective: 1800px;
  padding: 20px;
}

/* ===== Panels (Frosted Glass — White) ===== */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--panel-border);
  transition:
    transform 0.5s cubic-bezier(0.4, 2, 0.6, 1),
    box-shadow 0.3s;
  will-change: transform;
}

.panel-timer {
  flex: 1 1 55%;
  max-width: 60vw;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 30px 16px;
  border-radius: var(--radius) 0 0 var(--radius);
  transform: perspective(1800px) rotateY(5deg) scale(1.02);
  box-shadow:
    -4px 0 30px rgba(0, 0, 0, 0.06),
    0 8px 40px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 0 60px rgba(255, 255, 255, 0.15);
  z-index: 2;
  max-height: 94vh;
  overflow: hidden;
  animation: panel-breathe 6s ease-in-out infinite alternate;
}

.panel-structure {
  flex: 0 1 30%;
  max-width: 28vw;
  min-width: 240px;
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  transform: perspective(1800px) rotateY(-5deg) scale(1.01);
  box-shadow:
    4px 0 30px rgba(0, 0, 0, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 0 40px rgba(255, 255, 255, 0.1);
  z-index: 1;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes panel-breathe {
  0% {
    border-color: rgba(180, 165, 130, 0.2);
    box-shadow:
      -4px 0 30px rgba(0, 0, 0, 0.06),
      0 8px 40px rgba(0, 0, 0, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.7),
      inset 0 0 50px rgba(255, 255, 255, 0.12);
  }
  50% {
    border-color: rgba(212, 175, 55, 0.18);
    box-shadow:
      -4px 0 30px rgba(0, 0, 0, 0.06),
      0 8px 50px rgba(212, 175, 55, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      inset 0 0 60px rgba(255, 255, 255, 0.18);
  }
  100% {
    border-color: rgba(180, 165, 130, 0.25);
    box-shadow:
      -4px 0 30px rgba(0, 0, 0, 0.06),
      0 8px 40px rgba(0, 0, 0, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.75),
      inset 0 0 55px rgba(255, 255, 255, 0.15);
  }
}

/* ===== Progress Bar ===== */
.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius) 0 0 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--accent), var(--emerald));
  background-size: 200% 100%;
  animation: progress-shimmer 3s linear infinite;
  border-radius: 2px;
  transition: width 1s linear;
  box-shadow: 0 0 6px rgba(184, 150, 12, 0.2);
}

@keyframes progress-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.progress-fill.warning {
  background: linear-gradient(90deg, var(--red), #e67e22);
}

/* ===== Title ===== */
.title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: var(--gold-dim);
  text-align: center;
  letter-spacing: 3px;
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(184, 150, 12, 0.12);
  border-bottom: 1px solid var(--panel-border);
  padding: 10px 0 8px;
  margin-bottom: 4px;
  width: 100%;
  animation: title-glow 4s ease-in-out infinite alternate;
}

@keyframes title-glow {
  0% {
    text-shadow:
      0 1px 2px rgba(255, 255, 255, 0.8),
      0 0 15px rgba(184, 150, 12, 0.1);
  }
  50% {
    text-shadow:
      0 1px 2px rgba(255, 255, 255, 0.9),
      0 0 25px rgba(184, 150, 12, 0.18);
    color: var(--gold);
  }
  100% {
    text-shadow:
      0 1px 2px rgba(255, 255, 255, 0.8),
      0 0 20px rgba(184, 150, 12, 0.14);
  }
}

/* ===== Timer Area ===== */
.timer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  justify-content: center;
  gap: 2px;
}

.level-badge {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 5px;
  padding: 4px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(212, 175, 55, 0.08));
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  animation: badge-float 4s ease-in-out infinite alternate;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

@keyframes badge-float {
  0% {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border-color: rgba(180, 165, 130, 0.2);
  }
  100% {
    box-shadow: 0 4px 18px rgba(184, 150, 12, 0.08);
    border-color: rgba(184, 150, 12, 0.25);
  }
}

/* Countdown (main display) */
.countdown {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 11vw, 9rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.05;
  text-shadow:
    0 2px 4px rgba(255, 255, 255, 0.7),
    0 0 40px rgba(44, 36, 22, 0.06);
  transition:
    color 0.5s,
    text-shadow 0.5s;
}

.countdown.warning {
  color: var(--red);
  text-shadow:
    0 0 20px var(--red-glow),
    0 0 50px var(--red-glow);
  animation: cd-pulse 1s ease-in-out infinite;
}

@keyframes cd-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

/* Elapsed time */
.elapsed {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--red);
  font-weight: 400;
  text-shadow: 0 0 8px var(--red-glow);
  padding: 4px 0;
  border-top: 1px solid rgba(192, 57, 43, 0.15);
  border-bottom: 1px solid rgba(192, 57, 43, 0.15);
  width: 100%;
  text-align: center;
}

/* Blinds display */
.blinds-display {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0;
}

.blind-group,
.ante-group {
  text-align: center;
}

.blind-label,
.ante-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  font-weight: 600;
}

.blind-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.ante-value {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 700;
  color: var(--emerald);
  text-shadow: 0 0 8px rgba(30, 132, 73, 0.15);
}

.next-info {
  font-size: clamp(0.85rem, 1.5vw, 1.2rem);
  color: var(--text-dim);
  text-align: center;
  width: 100%;
  padding: 6px 0;
  border-top: 1px solid var(--panel-border);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ===== Player Tracker ===== */
.player-tracker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--panel-border);
  width: 100%;
  justify-content: center;
}

.player-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  font-weight: 600;
}

.player-count {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 44px;
  text-align: center;
  text-shadow: 0 0 8px rgba(184, 150, 12, 0.15);
}

.player-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-solid);
  color: var(--gold-dim);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.player-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(184, 150, 12, 0.1);
}

/* ===== Controls ===== */
.controls {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 8px 0;
  border-top: 1px solid rgba(180, 165, 130, 0.2);
  width: 100%;
}

.ctrl-btn {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-solid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.ctrl-btn img {
  width: 65%;
  height: 65%;
  filter: brightness(0.5) sepia(0.2);
}

.ctrl-btn:hover {
  border-color: var(--gold);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 8px 28px rgba(184, 150, 12, 0.1),
    0 0 0 1px rgba(184, 150, 12, 0.08);
}

.ctrl-btn:active {
  transform: translateY(0) scale(0.95);
}

.ctrl-main {
  width: 68px;
  height: 68px;
  border-color: rgba(184, 150, 12, 0.3);
  box-shadow: 0 4px 18px rgba(184, 150, 12, 0.08);
  animation: play-btn-soft 3s ease-in-out infinite;
}

@keyframes play-btn-soft {
  0%,
  100% {
    box-shadow: 0 4px 18px rgba(184, 150, 12, 0.08);
  }
  50% {
    box-shadow:
      0 4px 24px rgba(184, 150, 12, 0.14),
      0 0 0 2px rgba(184, 150, 12, 0.06);
  }
}

/* ===== Structure Panel ===== */
.structure-head {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.structure-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.structure-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.action-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.action-btn.save {
  background: var(--gold);
  color: #fff;
}
.action-btn.load {
  background: var(--emerald);
  color: #fff;
}
.action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.structure-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.level-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
  font-weight: 600;
  transition: var(--transition);
  align-items: center;
  color: var(--text);
}

.level-row span:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-dim);
  font-size: 0.9em;
}

.level-row.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.03));
  color: var(--gold-dim);
  border-radius: 8px;
  box-shadow:
    0 0 12px rgba(184, 150, 12, 0.06),
    inset 0 0 16px rgba(212, 175, 55, 0.04);
  animation: active-row-breathe 3s ease-in-out infinite alternate;
}

.level-row.active span:first-child {
  color: var(--gold);
}

/* Break row in structure panel */
.break-row {
  grid-template-columns: 1fr;
  text-align: center;
  font-size: 0.85rem;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
  border-bottom: 1px solid rgba(192, 57, 43, 0.12);
  letter-spacing: 2px;
}

.break-row.active {
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.15), rgba(192, 57, 43, 0.04));
  color: #e74c3c;
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.12);
  animation: break-row-breathe 2s ease-in-out infinite alternate;
}

@keyframes break-row-breathe {
  from {
    box-shadow: 0 0 12px rgba(192, 57, 43, 0.12);
  }
  to {
    box-shadow: 0 0 18px rgba(192, 57, 43, 0.2);
  }
}

@keyframes active-row-breathe {
  from {
    box-shadow:
      0 0 12px rgba(184, 150, 12, 0.06),
      inset 0 0 16px rgba(212, 175, 55, 0.04);
  }
  to {
    box-shadow:
      0 0 18px rgba(184, 150, 12, 0.1),
      inset 0 0 24px rgba(212, 175, 55, 0.06);
  }
}

/* ===== Modals ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(240, 236, 228, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.open {
  display: flex;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 0.3s ease;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-wide {
  max-width: 700px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--panel-border);
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 2px;
}

.modal-x {
  width: 36px;
  height: 36px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.modal-x:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(192, 57, 43, 0.06);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  padding: 12px 24px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Settings form */
.setting-group {
  margin-bottom: 14px;
}

.setting-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 6px;
}

.setting-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}

.setting-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 12, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.level-header {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr 36px;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 2px;
}

.level-inputs {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

/* Break toggle checkbox in settings */
.break-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.break-toggle input {
  display: none;
}

.break-toggle span {
  font-size: 1.1rem;
  opacity: 0.3;
  transition: var(--transition);
  filter: grayscale(1);
}

.break-toggle input:checked + span {
  opacity: 1;
  filter: grayscale(0);
  text-shadow: 0 0 8px rgba(184, 150, 12, 0.4);
}

.level-inputs span {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

.level-inputs input {
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: center;
  transition: var(--transition);
  width: 100%;
}

.level-inputs input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 12, 0.08);
  background: rgba(255, 255, 255, 0.75);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
.btn-primary {
  background: var(--gold);
  color: #fff;
}
.btn-add {
  background: var(--emerald);
  color: #fff;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}

/* ===== Help Content ===== */
.help-content section {
  margin-bottom: 18px;
}

.help-content h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
}

.help-table td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 0.85rem;
  vertical-align: top;
  color: var(--text);
}

.help-table td:first-child {
  font-weight: 700;
  color: var(--gold-dim);
  white-space: nowrap;
  width: 35%;
}

.help-content p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}
.help-content ul {
  padding-left: 20px;
  font-size: 0.85rem;
}
.help-content li {
  margin-bottom: 4px;
}

.help-content code {
  background: rgba(184, 150, 12, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-dim);
  font-size: 0.8rem;
}

/* ===== Flash Overlay ===== */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
}

.flash-overlay.active {
  animation: level-flash 0.8s ease-out forwards;
}

@keyframes level-flash {
  0% {
    opacity: 0;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), rgba(108, 92, 231, 0.1) 50%, transparent 70%);
  }
  15% {
    opacity: 1;
  }
  40% {
    opacity: 0.4;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 60%);
  }
  100% {
    opacity: 0;
  }
}

/* ===== Break Overlay (EVA style) ===== */
.break-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.break-overlay.active {
  display: flex;
  animation: break-appear 0.4s ease-out;
}

@keyframes break-appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.break-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px);
  pointer-events: none;
  z-index: 1;
}

.break-border-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.break-border-lines span {
  position: absolute;
  background: #c0392b;
}

.break-border-lines span:nth-child(1) {
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  animation: break-line-h 1.5s ease-in-out infinite alternate;
}
.break-border-lines span:nth-child(2) {
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  animation: break-line-h 1.5s ease-in-out infinite alternate-reverse;
}
.break-border-lines span:nth-child(3) {
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  animation: break-line-v 1.5s ease-in-out infinite alternate;
}
.break-border-lines span:nth-child(4) {
  top: 0;
  bottom: 0;
  right: 0;
  width: 3px;
  animation: break-line-v 1.5s ease-in-out infinite alternate-reverse;
}

@keyframes break-line-h {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
@keyframes break-line-v {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.break-content {
  position: relative;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.break-warning-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 8px;
  color: #c0392b;
  border: 1px solid #c0392b;
  padding: 4px 24px;
  animation: break-blink 1.2s step-end infinite;
}

@keyframes break-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.break-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 6px;
  line-height: 1;
  text-shadow:
    0 0 40px rgba(192, 57, 43, 0.4),
    0 0 80px rgba(192, 57, 43, 0.15);
}

.break-sub {
  font-family: "Yu Gothic", "YuGothic", "Hiragino Sans", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 16px;
}

.break-next {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  margin-top: 8px;
}

.break-resume-btn {
  margin-top: 24px;
  background: transparent;
  border: 2px solid #c0392b;
  color: #c0392b;
  padding: 16px 52px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.break-resume-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #c0392b;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.break-resume-btn:hover::before {
  opacity: 1;
}

.break-resume-btn:hover {
  color: #fff;
  box-shadow:
    0 0 30px rgba(192, 57, 43, 0.5),
    0 0 60px rgba(192, 57, 43, 0.2);
}

.break-resume-en {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 6px;
}

.break-resume-ja {
  position: relative;
  z-index: 1;
  font-family: "Yu Gothic", "YuGothic", "Hiragino Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 4px;
  opacity: 0.8;
}

/* ===== NO Marquee in custom theme ===== */

/* ===== Footer ===== */
.footer {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}

.footer a {
  color: var(--gold-dim);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--gold);
  text-decoration: underline;
}
.sep {
  color: rgba(0, 0, 0, 0.12);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(180, 165, 130, 0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-banner {
    padding: 12px 16px 10px;
  }
  .hero-title {
    letter-spacing: 4px;
  }
  .hero-sub {
    letter-spacing: 5px;
  }
  .app-layout {
    flex-direction: column;
    padding: 60px 10px 30px;
    gap: 10px;
    perspective: none;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .panel-timer,
  .panel-structure {
    max-width: 100%;
    min-width: auto;
    width: 100%;
    transform: none;
    border-radius: var(--radius);
    max-height: none;
  }

  .panel-timer {
    flex: none;
  }
  .panel-structure {
    flex: none;
    max-height: 35vh;
  }
  html,
  body {
    overflow-y: auto;
  }

  .blinds-display {
    flex-direction: column;
    gap: 8px;
  }
  .footer {
    position: static;
    margin: 10px 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-banner {
    padding: 8px 12px 6px;
  }
  .hero-title {
    letter-spacing: 2px;
  }
  .hero-sub {
    letter-spacing: 3px;
    font-size: 0.55rem;
  }
  .hero-line {
    width: 80%;
    margin-top: 6px;
  }
  .countdown {
    font-size: 3.5rem;
  }
  .ctrl-btn {
    width: 48px;
    height: 48px;
  }
  .ctrl-main {
    width: 54px;
    height: 54px;
  }
  .controls {
    gap: 10px;
  }
  .toolbar {
    top: 68px;
    left: 6px;
  }
  .tool-btn {
    width: 36px;
    height: 36px;
  }
  .tool-btn img {
    width: 20px;
    height: 20px;
  }
  .tool-btn-text {
    font-size: 16px;
  }
  [data-tooltip]:hover::after {
    display: none;
  }
}
