*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --card-bg: #1a1a24;
  --card-top: #1e1e2a;
  --card-bot: #161620;
  --accent: #e8c96d;
  --text: #f0ece0;
  --muted: #5a5870;
  --sep: #0a0a0e;
  --glow: rgba(232,201,109,0.18);
  --radius: 10px;
}

body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  user-select: none;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, #1c1830 0%, #0f0f13 100%);
  z-index: -1;
}

h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-bottom: 48px;
}

@media (max-width: 500px) {
  h1 { margin-bottom: 30px; letter-spacing: 0.2em; }

  .timer-row { gap: 8px; }
  .unit-group { gap: 5px; }

  .flip-unit { width: 70px; height: 90px; }
  .card-face, .flip-top .inner { font-size: 3.4rem; }

  .colon { font-size: 2rem; padding-bottom: 5px; }

  .ctrl-btn { width: 22px; height: 22px; font-size: 0.5rem; border-radius: 5px; }

  .controls { margin-top: 34px; gap: 10px; }
  .btn { padding: 9px 20px; font-size: 0.7rem; }
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 28px;
}

.unit-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flip-unit {
  position: relative;
  width: 110px;
  height: 140px;
  perspective: 600px;
}

.card-face {
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 5.5rem;
  color: var(--text);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-face::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  background: var(--sep);
  z-index: 10;
}

.card-face::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0.15) 50%);
  pointer-events: none;
}

.flip-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  transform-origin: bottom center;
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 5;
  backface-visibility: hidden;
}

.flip-top .inner {
  width: 100%;
  height: 200%;
  background: var(--card-top);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 5.5rem;
  color: var(--text);
}

.flip-top.animate {
  animation: flipTop 0.28s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes flipTop {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

.colon {
  font-family: 'Share Tech Mono', monospace;
  font-size: 3.5rem;
  color: var(--accent);
  opacity: 0.8;
  padding-bottom: 8px;
}

.ctrl-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-btn {
  width: 28px;
  height: 28px;
  background: #1e1e2c;
  border: 1px solid #2e2e42;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}

.ctrl-btn:hover {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.ctrl-btn:active {
  transform: scale(0.9);
}

.label {
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 12px;
}


.sec-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.controls {
  display: flex;
  gap: 14px;
  margin-top: 52px;
}

.btn {
  padding: 10px 32px;
  border-radius: 50px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn:hover { background: var(--accent); color: #111; }
.btn.active { background: var(--accent); color: #111; }

.btn.reset {
  border-color: #2e2e42;
  color: var(--muted);
}
.btn.reset:hover { border-color: #555; color: #aaa; background: transparent; }

.running .flip-unit .card-face {
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px var(--glow), inset 0 1px 0 rgba(255,255,255,0.04);
}

.status {
  margin-top: 20px;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  height: 14px;
  transition: color 0.3s;
}
.status.done { color: var(--accent); }

.name-tag{
  color: var(--accent);
  position: fixed;
  bottom: 01px;
  left: 10px;
  font-size: 1 rem;
}

.zoe{
    color: var(--accent);
  position: fixed;
  bottom: 01px;
  right: 10px;
  font-size: 1 rem;
}