:root {
  --bg: #f5efe6;
  --ink: #2b1d17;
  --tea: #7a3b2e;
  --tea-2: #a4583f;
  --cream: #fff8ee;
  --gold: #c89b4a;
  --shadow: 0 10px 30px rgba(80, 40, 20, .15);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #ffe8c9 0%, transparent 60%),
    radial-gradient(800px 500px at -10% 30%, #ffd9c0 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 56px 20px 28px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 8px 0 6px;
  letter-spacing: -0.02em;
  color: var(--tea);
}
.tagline {
  margin: 0;
  font-size: 1.05rem;
  color: #6b4a3c;
}
.flag { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }

/* Cup */
.cup {
  position: relative;
  width: 110px;
  height: 90px;
  margin: 0 auto 8px;
}
.cup-body {
  position: absolute;
  inset: 8px 18px 18px 18px;
  background: linear-gradient(180deg, #fff 0%, #f3e7d4 100%);
  border-radius: 8px 8px 36px 36px / 8px 8px 28px 28px;
  box-shadow: inset 0 -10px 0 #e8d7bd, var(--shadow);
}
.cup-body::after {
  content: '';
  position: absolute;
  inset: 6px 6px auto 6px;
  height: 10px;
  background: linear-gradient(180deg, var(--tea-2), var(--tea));
  border-radius: 4px;
}
.cup-handle {
  position: absolute;
  right: 0;
  top: 28px;
  width: 22px;
  height: 30px;
  border: 6px solid #f3e7d4;
  border-left: 0;
  border-radius: 0 18px 18px 0;
}
.saucer {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 12px;
  background: #f3e7d4;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

/* Steam */
.steam {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
}
.steam span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  filter: blur(2px);
  animation: rise 3s ease-in-out infinite;
}
.steam span:nth-child(1) { left: 30%; animation-delay: .0s; }
.steam span:nth-child(2) { left: 50%; animation-delay: .8s; }
.steam span:nth-child(3) { left: 70%; animation-delay: 1.6s; }
@keyframes rise {
  0%   { transform: translate(-50%, 0) scale(.6); opacity: 0; }
  20%  { opacity: .9; }
  100% { transform: translate(-50%, -50px) scale(1.6); opacity: 0; }
}

/* ---------- Layout ---------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 60px;
  display: grid;
  gap: 28px;
}

section h2 {
  font-size: 1.25rem;
  color: var(--tea);
  margin: 0 0 12px;
  letter-spacing: .02em;
}

/* ---------- Tea picker ---------- */
.teas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.tea {
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow);
}
.tea:hover { transform: translateY(-2px); }
.tea[aria-checked="true"] {
  border-color: var(--tea);
  box-shadow: 0 0 0 4px rgba(122,59,46,.12), var(--shadow);
}
.tea .emoji { font-size: 1.6rem; display: block; margin-bottom: 2px; }
.tea .name  { font-weight: 700; color: var(--tea); }
.tea .meta  { font-size: .85rem; color: #7a5a4b; margin-top: 2px; }

/* ---------- Timer ---------- */
.timer-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.timer-display {
  font-family: 'Courier New', monospace;
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  color: var(--tea);
  letter-spacing: .04em;
}
.timer-meta {
  color: #6b4a3c;
  margin-bottom: 14px;
  font-size: .98rem;
}
.timer-meta .dot { margin: 0 8px; color: var(--gold); }
.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.btn {
  font: inherit;
  font-size: 1rem;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid var(--tea);
  cursor: pointer;
  transition: transform .1s ease, background .15s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.primary { background: var(--tea); color: #fff8ee; }
.btn.primary:not(:disabled):hover { background: var(--tea-2); }
.btn.ghost { background: transparent; color: var(--tea); }
.btn.ghost:not(:disabled):hover { background: rgba(122,59,46,.08); }

.progress {
  height: 8px;
  background: rgba(122,59,46,.12);
  border-radius: 999px;
  overflow: hidden;
}
#bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--tea-2));
  transition: width .3s linear;
}

/* ---------- Tips ---------- */
.tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.tip-list li {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.tip-list strong { color: var(--tea); }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 20px;
  font-size: .9rem;
  color: #6b4a3c;
}
footer a { color: var(--tea); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--tea);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  font-size: .95rem;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .steam span { animation: none; display: none; }
  * { transition: none !important; }
}
