* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

main {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

h1 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 8px;
  color: #e0e0e0;
}

.date {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 40px;
}

.drink-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin-bottom: 50px;
}

.drink-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  border: 3px solid #333;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 140px;
}

.drink-btn .emoji {
  font-size: 3rem;
  margin-bottom: 10px;
}

.drink-btn .label {
  font-size: 1.3rem;
  font-weight: 500;
  color: #ccc;
}

.drink-btn.no-drink {
  border-color: #2d5a3d;
}

.drink-btn.no-drink.active {
  background: rgba(45, 90, 61, 0.4);
  border-color: #4ade80;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.3);
}

.drink-btn.no-drink.active .label {
  color: #4ade80;
}

.drink-btn.no-drink.active .emoji {
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.5));
}

.drink-btn.had-drink {
  border-color: #5a3d2d;
}

.drink-btn.had-drink.active {
  background: rgba(90, 61, 45, 0.4);
  border-color: #f59e0b;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.drink-btn.had-drink.active .label {
  color: #f59e0b;
}

.drink-btn.had-drink.active .emoji {
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.drink-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.drink-btn:active {
  transform: scale(0.98);
}

.stats {
  text-align: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  width: 100%;
}

.stats h2 {
  font-size: 1rem;
  font-weight: 400;
  color: #888;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.percent {
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.stat-detail {
  font-size: 0.9rem;
  color: #666;
}

/* Prevent text selection on buttons */
.drink-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

.calendar-link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #4ade80;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.calendar-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-email {
  font-size: 0.85rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.logout-link {
  font-size: 0.85rem;
  color: #f87171;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.logout-link:hover {
  background: rgba(248, 113, 113, 0.1);
}

.percent-green {
  color: #4ade80;
}

.percent-amber {
  color: #f59e0b;
}

.percent-red {
  color: #f87171;
}
