/* =============================================
   POMODORO COFFEE — RETRO STYLE
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

:root {
  --bg:           #2B1B0E;
  --bg-alt:       #1a1008;
  --surface:      #F5E6CA;
  --surface-dark: #e8d4b0;
  --accent:       #E87121;
  --accent-dark:  #b85510;
  --tan:          #D4A574;
  --gold:         #8B6914;
  --text-dark:    #3E2723;
  --text-light:   #F5E6CA;
  --text-muted:   #a08060;

  /* Cup colors (overridden per skin) */
  --cup-body:       #D4A574;
  --cup-border:     #8B6914;
  --liquid-top:     #8B6914;
  --liquid-bottom:  #4a2c0a;

  --state-color: var(--accent);
}

body {
  font-family: 'Press Start 2P', monospace;
  background-color: var(--bg);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.8s ease;
  overflow-x: hidden;
}

body.state-work        { --state-color: #E87121; background-color: #2B1B0E; }
body.state-short-break { --state-color: #4caf7d; background-color: #0e2b1a; }
body.state-long-break  { --state-color: #4a90d9; background-color: #0e1a2b; }
body.state-idle        { --state-color: var(--tan); background-color: var(--bg); }

/* --- CRT Overlay --- */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  z-index: 9999;
}

/* --- App Shell --- */
.app-shell {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

/* --- Header --- */
.app-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 0.75rem;
  color: var(--state-color);
  text-shadow: 2px 2px 0 var(--bg-alt);
  line-height: 1.6;
  letter-spacing: 0.05em;
  transition: color 0.8s ease;
}

.app-title span {
  color: var(--text-muted);
  font-size: 0.6rem;
}

/* --- State Label --- */
.state-label {
  font-size: 0.55rem;
  color: var(--state-color);
  letter-spacing: 0.2em;
  text-align: center;
  transition: color 0.8s ease;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--state-color);
  box-shadow: 2px 2px 0 var(--bg-alt);
}

/* --- Time Display --- */
.time-display {
  font-size: 3.5rem;
  color: var(--text-light);
  text-shadow:
    0 0 10px rgba(255, 200, 100, 0.4),
    3px 3px 0 var(--bg-alt);
  letter-spacing: 0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* =============================================
   CUP CONTAINER (shared)
   ============================================= */

.cup-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 220px;
  justify-content: flex-end;
}

/* --- Steam (shared across skins) --- */
.steam {
  display: flex;
  gap: 14px;
  height: 48px;
  align-items: flex-end;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0.6s ease;
  position: absolute;
  top: 0;
}

.steam.active { opacity: 1; }

.steam span {
  width: 6px;
  height: 30px;
  border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, 0.18);
  animation: steam-rise 2s ease-in-out infinite;
  transform-origin: bottom center;
}
.steam span:nth-child(1) { animation-delay: 0s;   height: 24px; }
.steam span:nth-child(2) { animation-delay: 0.4s; height: 32px; }
.steam span:nth-child(3) { animation-delay: 0.8s; height: 20px; }

@keyframes steam-rise {
  0%   { transform: translateY(0) scaleX(1);    opacity: 0.5; }
  50%  { transform: translateY(-12px) scaleX(1.3); opacity: 0.3; }
  100% { transform: translateY(-24px) scaleX(0.8); opacity: 0;   }
}

/* --- Hide all skin divs by default --- */
.skin-mug,
.skin-french-press,
.skin-carafe,
.skin-glass-mug,
.skin-teacup {
  display: none;
  flex-direction: column;
  align-items: center;
}

/* --- Show active skin --- */
.cup-container[data-skin="mug"]          .skin-mug         { display: flex; }
.cup-container[data-skin="french-press"] .skin-french-press { display: flex; }
.cup-container[data-skin="carafe"]       .skin-carafe       { display: flex; }
.cup-container[data-skin="glass-mug"]    .skin-glass-mug    { display: flex; }
.cup-container[data-skin="teacup"]       .skin-teacup       { display: flex; }

/* --- Shared liquid style --- */
.liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--fill-percent, 100) * 1%);
  background: linear-gradient(
    to bottom,
    var(--liquid-top, #8B6914) 0%,
    var(--liquid-bottom, #4a2c0a) 100%
  );
  transition: height 1s linear;
  z-index: 1;
}

.liquid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 5%; right: 5%;
  height: 8px;
  background: linear-gradient(
    to bottom,
    rgba(200, 150, 60, 0.6),
    rgba(140, 80, 20, 0.1)
  );
  border-radius: 50% 50% 0 0;
}

/* =============================================
   SKIN: CLASSIC MUG
   ============================================= */

.skin-mug .cup-wrap {
  position: relative;
  width: 140px;
}

/* Rim */
.skin-mug .cup-wrap::before {
  content: '';
  position: absolute;
  top: -8px; left: -4px; right: -4px;
  height: 16px;
  background: var(--cup-body);
  border: 3px solid var(--cup-border);
  border-radius: 4px 4px 0 0;
  z-index: 4;
  box-shadow: inset 0 3px 6px rgba(255,255,255,0.2);
}

.skin-mug .cup {
  position: relative;
  width: 140px;
  height: 140px;
  background: var(--cup-body);
  clip-path: polygon(8% 0%, 92% 0%, 84% 100%, 16% 100%);
  overflow: hidden;
  box-shadow: inset -8px 0 16px rgba(0,0,0,0.2);
}

.skin-mug .cup::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  z-index: 3;
}

.skin-mug .cup-handle {
  position: absolute;
  right: -28px;
  top: 28px;
  width: 32px;
  height: 56px;
  border: 6px solid var(--cup-border);
  border-left: none;
  border-radius: 0 28px 28px 0;
}

.skin-mug .saucer {
  width: 180px;
  height: 16px;
  background: var(--cup-body);
  border: 3px solid var(--cup-border);
  border-radius: 50%;
  margin-top: -2px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  position: relative;
}

.skin-mug .saucer::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 6px;
  background: rgba(0,0,0,0.15);
  border-radius: 50%;
}

/* =============================================
   SKIN: FRENCH PRESS
   ============================================= */

.skin-french-press { gap: 0; }

.skin-french-press .fp-knob {
  width: 18px;
  height: 18px;
  background: #606870;
  border: 3px solid #3a4450;
  border-radius: 50%;
  box-shadow: 1px 1px 0 #2a3440, inset 0 2px 3px rgba(255,255,255,0.2);
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}

.skin-french-press .fp-lid {
  width: 122px;
  height: 16px;
  background: linear-gradient(to bottom, #a0b0bc, #7888a0);
  border: 3px solid #5a6878;
  box-shadow: 2px 2px 0 #3a4450, inset 0 2px 4px rgba(255,255,255,0.25);
  position: relative;
  z-index: 2;
}

/* Lid plunger rod continuation */
.skin-french-press .fp-lid::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: #8898a8;
}

.skin-french-press .fp-body {
  width: 106px;
  height: 138px;
  border: 4px solid #7888a0;
  background: rgba(15, 8, 3, 0.55);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset  6px 0 14px rgba(255,255,255,0.04),
    inset -6px 0 14px rgba(0,0,0,0.3),
    2px 2px 0 #3a4450;
}

/* Silver frame strips on sides */
.skin-french-press .fp-body::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 10px;
  background: linear-gradient(to right, #8898a8, rgba(136,152,168,0.4));
  z-index: 4;
}

.skin-french-press .fp-body::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 10px;
  background: linear-gradient(to left, #8898a8, rgba(136,152,168,0.4));
  z-index: 4;
}

.skin-french-press .fp-rod {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: #9aabb8;
  z-index: 5;
  box-shadow: 1px 0 2px rgba(255,255,255,0.2);
}

.skin-french-press .fp-filter {
  position: absolute;
  bottom: 22%;
  left: 0; right: 0;
  height: 7px;
  background: #7888a0;
  z-index: 6;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15), 0 -1px 0 rgba(0,0,0,0.3);
}

/* Mesh pattern on filter */
.skin-french-press .fp-filter::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: repeating-linear-gradient(
    90deg,
    transparent, transparent 4px,
    rgba(0,0,0,0.2) 4px, rgba(0,0,0,0.2) 5px
  );
}

.skin-french-press .liquid {
  --liquid-top: #2c1006;
  --liquid-bottom: #0d0400;
}

.skin-french-press .fp-base {
  width: 118px;
  height: 12px;
  background: linear-gradient(to bottom, #8898a8, #6878a0);
  border: 3px solid #5a6878;
  margin-top: -1px;
  box-shadow: 2px 2px 0 #3a4450;
}

/* =============================================
   SKIN: COFFEE CARAFE
   ============================================= */

.skin-carafe { gap: 0; }

.skin-carafe .carafe-neck {
  width: 52px;
  height: 22px;
  background: linear-gradient(to bottom, #4a3020, #3a2015);
  border: 4px solid #2c1808;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 2px 0 6px rgba(255,255,255,0.08), 2px 0 0 #1a0c04;
  position: relative;
}

/* Neck highlight */
.skin-carafe .carafe-neck::before {
  content: '';
  position: absolute;
  top: 3px; left: 6px;
  width: 8px; height: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

.skin-carafe .carafe-wrap {
  position: relative;
  width: 160px;
  display: flex;
  justify-content: center;
}

.skin-carafe .carafe-body {
  width: 140px;
  height: 132px;
  background: linear-gradient(135deg, #6a4020 0%, #4a2c10 60%, #3a1c08 100%);
  border: 4px solid #2c1808;
  border-radius: 12px 12px 50px 50px / 8px 8px 36px 36px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 8px 4px 20px rgba(255,255,255,0.06),
    inset -8px -4px 16px rgba(0,0,0,0.4),
    3px 3px 0 #1a0c04;
}

/* Carafe body gloss */
.skin-carafe .carafe-body::before {
  content: '';
  position: absolute;
  top: 8px; left: 12px;
  width: 22px; height: 50px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transform: rotate(-15deg);
  z-index: 3;
}

.skin-carafe .carafe-handle {
  position: absolute;
  right: 0;
  top: 20px;
  width: 28px;
  height: 60px;
  border: 7px solid #2c1808;
  border-left: none;
  border-radius: 0 24px 24px 0;
  box-shadow: 3px 0 0 #1a0c04;
}

.skin-carafe .liquid {
  --liquid-top: #1a0a04;
  --liquid-bottom: #080200;
}

/* Carafe liquid has a ceramic body tint when low */
.skin-carafe .liquid::after {
  background: linear-gradient(
    to bottom,
    rgba(120, 60, 20, 0.5),
    rgba(80, 30, 10, 0.1)
  );
}

.skin-carafe .carafe-base {
  width: 154px;
  height: 14px;
  background: linear-gradient(to bottom, #3a2010, #2c1808);
  border: 4px solid #1a0c04;
  border-radius: 0 0 8px 8px;
  margin-top: -2px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5), 2px 2px 0 #100804;
}

/* =============================================
   SKIN: GLASS MUG
   ============================================= */

.skin-glass-mug { gap: 0; }

.skin-glass-mug .glass-wrap {
  position: relative;
  width: 150px;
}

/* Glass rim — last in DOM, column-reverse puts it at top */
.skin-glass-mug .glass-rim {
  width: 142px;
  height: 12px;
  background: linear-gradient(to bottom, #a8c8e8, #7898b8);
  border: 3px solid #5878a8;
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 3px 5px rgba(255,255,255,0.4), 2px 2px 0 #3858a0;
}

/* column-reverse: glass-rim (last in DOM) renders at top, glass-wrap renders below */
.skin-glass-mug {
  flex-direction: column-reverse;
}

.skin-glass-mug .glass-body {
  width: 130px;
  height: 138px;
  border: 4px solid #5878a8;
  border-top: none;
  background: rgba(20, 30, 50, 0.45);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset  6px 0 20px rgba(160,200,240,0.08),
    inset -6px 0 20px rgba(0,0,0,0.35),
    2px 2px 0 #3858a0;
}

/* Glass shine stripe */
.skin-glass-mug .glass-shine {
  position: absolute;
  top: 0; bottom: 0;
  left: 8px;
  width: 14px;
  background: linear-gradient(
    to right,
    rgba(160, 210, 255, 0.14),
    rgba(160, 210, 255, 0.05)
  );
  z-index: 3;
  pointer-events: none;
}

/* Frost/ice dots at top */
.skin-glass-mug .glass-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: rgba(180, 220, 255, 0.12);
  z-index: 3;
}

.skin-glass-mug .glass-handle {
  position: absolute;
  right: -2px;
  top: 24px;
  width: 28px;
  height: 52px;
  border: 5px solid #5878a8;
  border-left: none;
  border-radius: 0 22px 22px 0;
  box-shadow: 2px 2px 0 #3858a0;
}

.skin-glass-mug .liquid {
  --liquid-top: #8B6914;
  --liquid-bottom: #4a2c0a;
  border-top: 2px solid rgba(160, 210, 255, 0.15);
}

.skin-glass-mug .liquid::after {
  background: linear-gradient(
    to bottom,
    rgba(180, 220, 255, 0.12),
    transparent
  );
}

/* =============================================
   SKIN: TEA CUP
   ============================================= */

.skin-teacup { gap: 0; }

.skin-teacup .tea-wrap {
  position: relative;
  width: 150px;
}

/* Tea cup rim */
.skin-teacup .tea-wrap::before {
  content: '';
  position: absolute;
  top: -8px; left: -4px; right: -4px;
  height: 16px;
  background: #f0e0c0;
  border: 3px solid #c8a060;
  border-radius: 4px 4px 0 0;
  z-index: 4;
  box-shadow: inset 0 3px 6px rgba(255,255,255,0.4);
}

.skin-teacup .tea-cup {
  position: relative;
  width: 140px;
  height: 116px;
  background: #ecdcbc;
  /* Wider at top, narrower at bottom — more tea-cup like */
  clip-path: polygon(5% 0%, 95% 0%, 87% 100%, 13% 100%);
  overflow: hidden;
  box-shadow: inset -6px 0 14px rgba(0,0,0,0.1);
}

/* Inner glaze highlight */
.skin-teacup .tea-cup::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  z-index: 3;
}

.skin-teacup .tea-handle {
  position: absolute;
  right: -24px;
  top: 20px;
  width: 26px;
  height: 46px;
  border: 5px solid #c8a060;
  border-left: none;
  border-radius: 0 22px 22px 0;
}

/* Teabag string over the rim */
.skin-teacup .teabag-string {
  position: absolute;
  top: -16px;
  left: 40px;
  width: 2px;
  height: 28px;
  background: #8B6914;
  z-index: 5;
}

/* Teabag label */
.skin-teacup .teabag-string::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -4px;
  width: 10px;
  height: 8px;
  background: #c8a060;
  border: 1px solid #8B6914;
}

.skin-teacup .liquid {
  --liquid-top: #c9a050;
  --liquid-bottom: #7a5018;
}

.skin-teacup .liquid::after {
  background: linear-gradient(
    to bottom,
    rgba(220, 180, 80, 0.5),
    rgba(160, 100, 30, 0.1)
  );
}

.skin-teacup .tea-saucer {
  width: 178px;
  height: 16px;
  background: #ecdcbc;
  border: 3px solid #c8a060;
  border-radius: 50%;
  margin-top: -2px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.35);
  position: relative;
}

.skin-teacup .tea-saucer::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
}

/* =============================================
   PROGRESS DOTS
   ============================================= */

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

.progress-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--gold);
  border-radius: 0;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.progress-dot.active {
  background: var(--state-color);
  border-color: var(--state-color);
  box-shadow: 0 0 6px var(--state-color);
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  cursor: pointer;
  border: 3px solid;
  padding: 0.7rem 1.2rem;
  letter-spacing: 0.1em;
  transition: transform 0.05s, box-shadow 0.05s;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 4px 4px 0 var(--accent-dark);
}

.btn-primary:hover { background: #f08030; }
.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--accent-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-dark);
  border-color: var(--gold);
  box-shadow: 3px 3px 0 var(--gold);
}

.btn-secondary:hover { background: var(--surface-dark); }
.btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--gold);
}

.btn-secondary.muted {
  color: var(--text-muted);
  border-color: var(--text-muted);
  box-shadow: 3px 3px 0 rgba(160, 128, 96, 0.4);
}

.icon-btn {
  font-family: inherit;
  font-size: 1rem;
  background: none;
  border: 2px solid var(--gold);
  color: var(--tan);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--gold);
  transition: transform 0.05s, box-shadow 0.05s;
}

.icon-btn:hover { background: rgba(139, 105, 20, 0.2); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.controls-secondary {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* =============================================
   SETTINGS PANEL
   ============================================= */

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
  padding: 1rem 0;
}

.settings-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.settings-box {
  background: var(--surface);
  color: var(--text-dark);
  border: 4px solid var(--gold);
  box-shadow: 6px 6px 0 var(--text-dark), inset 1px 1px 0 rgba(255,255,255,0.5);
  padding: 1.5rem;
  width: 90%;
  max-width: 380px;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

.settings-overlay.open .settings-box { transform: translateY(0); }

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--gold);
}

.settings-header h2 {
  font-size: 0.7rem;
  color: var(--text-dark);
  letter-spacing: 0.1em;
}

.settings-header .icon-btn {
  color: var(--text-dark);
  border-color: var(--gold);
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

/* Section labels */
.setting-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  padding: 0.4rem 0 0.2rem;
  border-bottom: 1px solid var(--surface-dark);
}

/* --- Skin Selector Grid --- */
.skin-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0.4rem 0;
}

.skin-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  letter-spacing: 0.05em;
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid #4a3820;
  box-shadow: 2px 2px 0 #2a1808;
  cursor: pointer;
  padding: 6px 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, box-shadow 0.05s, transform 0.05s;
  flex: 1;
  min-width: 56px;
}

.skin-btn:hover {
  border-color: var(--gold);
  color: var(--text-light);
}

.skin-btn.active {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent-dark);
  color: var(--accent);
}

.skin-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #2a1808;
}

/* =============================================
   SKIN THUMBNAILS (pixel art CSS)
   ============================================= */

.skin-thumb {
  display: block;
  position: relative;
}

/* -- MUG thumb -- */
.skin-thumb-mug {
  width: 30px;
  height: 32px;
  background: #8B6914;
  clip-path: polygon(10% 0%, 90% 0%, 82% 100%, 18% 100%);
  position: relative;
}

/* Handle via shadow trick */
.skin-thumb-mug::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 6px;
  width: 8px;
  height: 16px;
  border: 3px solid #8B6914;
  border-left: none;
  border-radius: 0 6px 6px 0;
}

/* Saucer */
.skin-thumb-mug::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -4px; right: -4px;
  height: 5px;
  background: #8B6914;
  border-radius: 50%;
}

/* -- FRENCH PRESS thumb -- */
.skin-thumb-french-press {
  width: 24px;
  height: 36px;
  border: 3px solid #7888a0;
  background: rgba(10, 6, 3, 0.7);
  position: relative;
}

/* Silver lid on top */
.skin-thumb-french-press::before {
  content: '';
  position: absolute;
  top: -7px; left: -4px; right: -4px;
  height: 7px;
  background: #8898a8;
  border: 2px solid #5a6878;
}

/* Filter line */
.skin-thumb-french-press::after {
  content: '';
  position: absolute;
  bottom: 25%;
  left: 0; right: 0;
  height: 3px;
  background: #7888a0;
}

/* -- CARAFE thumb -- */
.skin-thumb-carafe {
  width: 28px;
  height: 36px;
  background: linear-gradient(135deg, #6a4020, #3a1c08);
  border: 3px solid #2c1808;
  border-radius: 4px 4px 14px 14px / 2px 2px 10px 10px;
  position: relative;
}

/* Narrow neck */
.skin-thumb-carafe::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%; transform: translateX(-50%);
  width: 12px; height: 8px;
  background: #4a3020;
  border: 2px solid #2c1808;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}

/* Handle */
.skin-thumb-carafe::after {
  content: '';
  position: absolute;
  right: -9px;
  top: 6px;
  width: 8px; height: 16px;
  border: 3px solid #2c1808;
  border-left: none;
  border-radius: 0 6px 6px 0;
}

/* -- GLASS MUG thumb -- */
.skin-thumb-glass-mug {
  width: 28px;
  height: 34px;
  border: 3px solid #5878a8;
  background: rgba(10, 15, 30, 0.6);
  position: relative;
}

/* Glass rim */
.skin-thumb-glass-mug::before {
  content: '';
  position: absolute;
  top: -6px; left: -2px; right: -2px;
  height: 6px;
  background: #7898b8;
  border: 2px solid #5878a8;
}

/* Handle */
.skin-thumb-glass-mug::after {
  content: '';
  position: absolute;
  right: -9px; top: 6px;
  width: 8px; height: 14px;
  border: 3px solid #5878a8;
  border-left: none;
  border-radius: 0 6px 6px 0;
}

/* -- TEA CUP thumb -- */
.skin-thumb-teacup {
  width: 30px;
  height: 26px;
  background: #ecdcbc;
  clip-path: polygon(6% 0%, 94% 0%, 86% 100%, 14% 100%);
  position: relative;
}

/* Saucer */
.skin-thumb-teacup::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -5px; right: -5px;
  height: 5px;
  background: #ecdcbc;
  border-radius: 50%;
  border: 2px solid #c8a060;
}

/* Handle */
.skin-thumb-teacup::after {
  content: '';
  position: absolute;
  right: -8px; top: 4px;
  width: 7px; height: 12px;
  border: 3px solid #c8a060;
  border-left: none;
  border-radius: 0 5px 5px 0;
}

/* =============================================
   SETTINGS ROWS
   ============================================= */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.setting-row label {
  font-family: 'VT323', 'Press Start 2P', monospace;
  font-size: 1.1rem;
  color: var(--text-dark);
  flex: 1;
}

.setting-row input {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  width: 64px;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  color: var(--text-light);
  border: 2px solid var(--gold);
  text-align: center;
  outline: none;
}

.setting-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 113, 33, 0.3);
}

.setting-row input::-webkit-outer-spin-button,
.setting-row input::-webkit-inner-spin-button { -webkit-appearance: none; }
.setting-row input[type=number] { -moz-appearance: textfield; }

.settings-footer {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  padding-top: 0.8rem;
  border-top: 2px solid var(--surface-dark);
}

/* =============================================
   RADIO SECTION
   ============================================= */

.radio-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gold);
}

.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.radio-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

/* Pulsing indicator dot */
.radio-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 1px solid var(--gold);
  transition: background 0.3s ease;
}

.radio-dot.active {
  background: #4caf7d;
  border-color: #4caf7d;
  box-shadow: 0 0 6px #4caf7d;
  animation: radio-pulse 1.4s ease-in-out infinite;
}

@keyframes radio-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.radio-station-label {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--state-color);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.8s ease;
}

/* Radio play/stop button */
.btn-radio-toggle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  cursor: pointer;
  border: 3px solid;
  padding: 0.55rem 1rem;
  letter-spacing: 0.1em;
  transition: transform 0.05s, box-shadow 0.05s, background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 3px 3px 0 var(--accent-dark);
}

.btn-radio-toggle:hover { background: #f08030; }
.btn-radio-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--accent-dark);
}

.btn-radio-toggle.playing {
  background: #4caf7d;
  border-color: #2e7d52;
  box-shadow: 3px 3px 0 #2e7d52;
}

.btn-radio-toggle.playing:hover { background: #5dca8e; }
.btn-radio-toggle.playing:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #2e7d52;
}

/* Station prev/next nav buttons */
.btn-station-nav {
  font-size: 0.65rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted);
  border: 2px solid #4a3820;
  box-shadow: 2px 2px 0 #2a1808;
  cursor: pointer;
  padding: 3px 6px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, transform 0.05s, box-shadow 0.05s;
}

.btn-station-nav:hover {
  border-color: var(--gold);
  color: var(--text-light);
}

.btn-station-nav:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #2a1808;
}

/* Volume row */
.radio-volume-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.radio-volume-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.radio-volume {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-alt);
  border: 2px solid var(--gold);
  outline: none;
  cursor: pointer;
}

.radio-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  cursor: pointer;
}

.radio-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  cursor: pointer;
  border-radius: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 420px) {
  .app-shell { padding-top: 0.6rem; padding-bottom: 0.8rem; }
  .time-display { font-size: 2.8rem; }
  .app-title { font-size: 0.6rem; }
  .skin-btn { min-width: 48px; font-size: 0.34rem; }
}

@media (max-width: 360px) {
  .time-display { font-size: 2.2rem; }
  .controls-secondary { gap: 0.4rem; }
  .btn { font-size: 0.5rem; padding: 0.6rem 0.9rem; }
}

/* --- Layout wrapper (app + history) --- */
.layout-wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 680px;
  width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* --- History panel --- */
.history-panel {
  width: 200px;
  flex-shrink: 0;
  padding: 1rem;
  border: 2px solid var(--gold);
  box-shadow: 4px 4px 0 #1a1008;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: sticky;
  top: 1rem;
}

.history-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gold);
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.history-entry {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  align-items: center;
  gap: 0.3rem;
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  line-height: 1.2;
}

.history-num {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
}

.history-time {
  color: var(--state-color);
  transition: color 0.8s ease;
}

.history-duration {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.history-summary {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--gold);
  text-align: right;
  padding: 0.3rem 0 0.5rem;
  opacity: 0.8;
}

.history-empty {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.8rem 0;
}

@media (max-width: 640px) {
  .layout-wrapper {
    flex-direction: column;
    align-items: center;
    padding: 1.2rem;
    gap: 0;
  }
  .history-panel {
    width: 100%;
    max-width: 420px;
    position: static;
    border-top: none;
    box-shadow: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 2px solid var(--gold);
    padding: 0.8rem 1rem;
  }
  .history-list {
    max-height: none;
  }
}
