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

:root {
  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;
  --color-text: #111;
  --color-text-muted: #333;
  --color-overlay: rgba(0, 0, 0, 0.45);
  --color-overlay-light: rgba(0, 0, 0, 0.3);
  --text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: url("assets/counter.jpg") center / cover no-repeat fixed;
  color: var(--color-text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

/* === App Shell === */
.app {
  width: 100%;
  max-width: 600px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  text-shadow: var(--text-shadow);
}

.tagline {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  text-shadow: var(--text-shadow);
}

main {
  flex: 1;
}

footer {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-shadow: var(--text-shadow);
}

/* === Screens === */
.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* === Counter & Carousel === */
.counter {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.drink-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 2rem 0;
  min-height: 200px;
  align-items: flex-end;
  margin-top: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.drink-carousel::-webkit-scrollbar {
  display: none;
}

.drink-item {
  flex: 0 0 20%;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 3px solid transparent;
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  scroll-snap-align: center;
  color: var(--color-text);
  font-family: inherit;
  text-shadow: var(--text-shadow);
}

.drink-item:hover {
  transform: translateY(-4px);
}

.drink-item.selected {
  border-color: var(--color-primary);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-6px);
}

.drink-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.5;
  object-fit: contain;
  background-color: transparent;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s;
}

.drink-item.selected .drink-img {
  transform: scale(1.05);
}

/* 16oz tall can — stretch the 12oz image slightly */
.img-tall {
  aspect-ratio: 1 / 2.5;
  object-fit: fill;
  width: 80%;
}

/* === Selection Info === */
.selection-info {
  padding: 1rem 1rem 0;
  text-align: center;
}

.selected-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  min-height: 1.5em;
  transition: color 0.2s;
  text-shadow: var(--text-shadow);
}

.selected-name.active {
  color: var(--color-text);
}

/* === Nudge Toggle === */
.nudge-toggle {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.nudge-toggle input {
  display: none;
}

.nudge-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.nudge-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--color-text);
  border-radius: 50%;
  transition: transform 0.2s;
}

.nudge-toggle input:checked + .nudge-slider {
  background: var(--color-primary);
}

.nudge-toggle input:checked + .nudge-slider::after {
  transform: translateX(20px);
}

.nudge-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.nudge-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* === Nudge Reminder === */
.timer-nudge-reminder {
  margin-top: 1.25rem;
  padding: 0.625rem 1rem;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius);
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.9rem;
  animation: nudge-pulse 1s ease-in-out 3;
}

@keyframes nudge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === Timer Screen === */
.timer-display {
  text-align: center;
  padding: 3rem 1rem;
}

.timer-drink-img {
  width: 80px;
  height: auto;
  aspect-ratio: 1 / 1.5;
  object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.timer-drink-name {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  text-shadow: var(--text-shadow);
}

.timer-countdown {
  font-size: 4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1;
  text-shadow: var(--text-shadow);
}

.timer-estimate {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  text-shadow: var(--text-shadow);
}

/* === Done Screen === */
.done-display {
  text-align: center;
  padding: 3rem 1rem;
}

.done-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.done-display h2 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-shadow: var(--text-shadow);
}

.done-message {
  color: var(--color-text-muted);
  text-shadow: var(--text-shadow);
}

/* === Buttons === */
.btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 1.5rem auto 0;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #0f172a;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  color: var(--color-text);
  border: 2px solid rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
  border-color: rgba(0, 0, 0, 0.3);
}
