* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-panel: #12121a;
  --primary: #ff6b00;
  --primary-glow: #ff8c33;
  --secondary: #00ff88;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --text: #ffffff;
  --text-dim: #888899;
  --red: #ff3333;
  --led-off: #1a1a2e;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Oswald', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

#app {
  height: 100%;
  overflow: hidden;
}

.screen {
  height: 100%;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Auth Screen */
.auth-container {
  max-width: 100%;
  width: 100%;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.scoreboard-header {
  text-align: center;
  margin-bottom: 30px;
}

.neon-title {
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 700;
  color: var(--primary);
  text-shadow:
    0 0 10px var(--primary),
    0 0 20px var(--primary),
    0 0 40px var(--primary-glow);
  letter-spacing: 3px;
  line-height: 1.1;
}

.goal-badge {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--secondary), #00cc6a);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  letter-spacing: 2px;
}

.auth-form {
  background: var(--bg-panel);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #2a2a3e;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary);
  letter-spacing: 3px;
  font-size: 1.3rem;
}

.auth-form input {
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg-dark);
  border: 2px solid #2a2a3e;
  border-radius: 12px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-form input::placeholder {
  color: var(--text-dim);
}

.btn-primary {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), #cc5500);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
}

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

.switch-text {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.switch-text a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
}

.error-msg {
  margin-top: 15px;
  padding: 14px;
  background: rgba(255, 51, 51, 0.2);
  border: 2px solid var(--red);
  border-radius: 12px;
  color: var(--red);
  text-align: center;
  font-size: 0.95rem;
}

.referrer-banner {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 204, 106, 0.1));
  border: 2px solid var(--secondary);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--secondary);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.referrer-banner .referrer-icon {
  margin-right: 8px;
}

.referrer-banner strong {
  color: #fff;
}

/* Dashboard */
#dashboard-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: var(--bg-panel);
  border-bottom: 3px solid var(--primary);
  flex-shrink: 0;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.player-icon {
  font-size: 1.3rem;
}

.header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-invite, .btn-logout {
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
  white-space: nowrap;
}

.btn-invite:active, .btn-logout:active {
  transform: scale(0.95);
}

.btn-invite {
  background: var(--secondary);
  color: #000;
}

.btn-logout {
  background: #333;
  color: var(--text);
}

.btn-reset {
  background: var(--red);
  color: #fff;
}

.btn-danger {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--red), #cc0000);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
}

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

.reset-modal .reset-warning {
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.scoreboard-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Counter Section - Stadium Scoreboard Style */
.counter-section {
  text-align: center;
  padding: 20px 12px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 50%, #0d0d0d 100%);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 4px solid #444;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.1),
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 8px 20px rgba(0,0,0,0.5);
  position: relative;
}

/* Metal frame effect */
.counter-section::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 2px solid #333;
  border-radius: 8px;
  pointer-events: none;
}

/* Corner rivets */
.counter-section::after {
  content: '● ● ● ●';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  font-size: 8px;
  color: #555;
  letter-spacing: 60px;
  text-align: center;
}

.counter-label {
  font-size: 1rem;
  color: #ff6b00;
  letter-spacing: 6px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

.mega-counter {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(1.8rem, 9vw, 4.5rem);
  font-weight: 700;
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  padding: 8px 4px;
  background: linear-gradient(180deg, #0a0a0a 0%, #000 100%);
  border-radius: 8px;
  border: 3px solid #222;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.8);
  overflow: hidden;
}

.digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 8px 4px;
  border-radius: 4px;
  color: #ff0000;
  font-weight: 900;
  text-shadow:
    0 0 5px #ff0000,
    0 0 10px #ff0000,
    0 0 20px #ff0000,
    0 0 40px #ff0000,
    0 0 60px #ff0000;
  min-width: clamp(20px, 7vw, 50px);
  position: relative;
  /* LED segment look */
  font-family: 'Roboto Mono', monospace;
  animation: counterFlash 0.5s ease-in-out infinite;
}

@keyframes counterFlash {
  0%, 100% {
    opacity: 1;
    text-shadow:
      0 0 5px #ff0000,
      0 0 10px #ff0000,
      0 0 20px #ff0000,
      0 0 40px #ff0000,
      0 0 60px #ff0000;
  }
  50% {
    opacity: 0.7;
    text-shadow:
      0 0 10px #ff0000,
      0 0 20px #ff0000,
      0 0 40px #ff0000,
      0 0 80px #ff0000,
      0 0 100px #ff0000;
  }
}

/* Stop flashing when counter hits zero */
.counter-zero .digit {
  animation: none;
  color: #00ff00;
  text-shadow:
    0 0 10px #00ff00,
    0 0 20px #00ff00,
    0 0 40px #00ff00;
}

/* Nuclear explosion effect */
.nuclear-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 9999;
  animation: nuclearFlash 3s ease-out forwards;
  pointer-events: none;
}

@keyframes nuclearFlash {
  0% {
    background: #fff;
    opacity: 1;
  }
  10% {
    background: #ffff00;
    opacity: 1;
  }
  30% {
    background: #ff6600;
    opacity: 0.9;
  }
  50% {
    background: #ff0000;
    opacity: 0.7;
  }
  100% {
    background: #000;
    opacity: 0;
  }
}

.nuclear-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  text-align: center;
  animation: messageAppear 1s ease-out 2s forwards;
  opacity: 0;
}

@keyframes messageAppear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.nuclear-message h1 {
  font-size: clamp(2rem, 10vw, 5rem);
  color: #ff0000;
  text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
  margin-bottom: 20px;
  animation: textShake 0.1s infinite;
}

@keyframes textShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.nuclear-message p {
  font-size: clamp(1rem, 4vw, 2rem);
  color: var(--gold);
  letter-spacing: 3px;
}

.digit:nth-child(4), .digit:nth-child(8) {
  background: none;
  padding: 8px 2px;
  min-width: auto;
  color: #ff3333;
  text-shadow: 0 0 8px #ff3333;
}

.goal-tracker {
  margin-top: 20px;
}

.goal-bar {
  height: 20px;
  background: var(--led-off);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #2a2a3e;
}

.goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 10px;
}

.goal-text {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: 2px;
}

/* Admin Badge */
.admin-badge {
  background: linear-gradient(135deg, var(--gold), #cc9900);
  color: #000;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Drink Section */
.drink-section {
  text-align: center;
  padding: 20px 0;
}

.beer-type-input {
  margin-bottom: 16px;
  padding: 0 10px;
}

.beer-type-input input {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-panel);
  border: 3px solid #2a2a3e;
  border-radius: 30px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  text-align: center;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
}

.beer-type-input input:focus {
  outline: none;
  border-color: var(--primary);
}

.beer-type-input input::placeholder {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 14px;
}

/* Photo Upload */
.photo-upload {
  margin-bottom: 20px;
}

.photo-upload input[type="file"] {
  display: none;
}

.photo-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--bg-panel);
  border: 3px dashed var(--secondary);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--secondary);
  min-height: 60px;
}

.photo-label:active {
  transform: scale(0.98);
  background: rgba(0, 255, 136, 0.1);
}

.photo-label span:first-child {
  font-size: 1.5rem;
}

.photo-preview {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}

.photo-preview img {
  max-width: 160px;
  max-height: 120px;
  border-radius: 12px;
  border: 3px solid var(--secondary);
}

.clear-photo {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verification-status {
  margin: 16px 10px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.verification-status.verifying {
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid var(--gold);
  color: var(--gold);
}

.verification-status.success {
  background: rgba(0, 255, 136, 0.2);
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.verification-status.failed {
  background: rgba(255, 51, 51, 0.2);
  border: 2px solid var(--red);
  color: var(--red);
}

.mega-drink-btn {
  width: clamp(140px, 40vw, 180px);
  height: clamp(140px, 40vw, 180px);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), #cc4400);
  border: 4px solid var(--primary-glow);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  box-shadow:
    0 0 30px rgba(255, 107, 0, 0.5),
    inset 0 -5px 20px rgba(0, 0, 0, 0.3);
  -webkit-appearance: none;
  margin: 10px 0;
}

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

.mega-drink-btn:disabled {
  opacity: 0.6;
}

.mega-drink-btn .beer-icon {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
}

.mega-drink-btn .drink-text {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.your-count {
  margin-top: 16px;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: 2px;
}

.your-count span {
  color: var(--secondary);
  font-weight: 700;
  text-shadow: 0 0 10px var(--secondary);
}

/* Recent Drinks */
.recent-section {
  background: var(--bg-panel);
  border-radius: 16px;
  border: 2px solid #2a2a3e;
  overflow: hidden;
  margin-bottom: 16px;
}

.recent-header {
  background: linear-gradient(135deg, #1a1a2e, #12121a);
  padding: 14px 16px;
  border-bottom: 2px solid var(--secondary);
}

.recent-header h2 {
  color: var(--secondary);
  letter-spacing: 3px;
  font-size: 1rem;
}

.recent-drinks {
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.recent-drink {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-dark);
  border-radius: 10px;
  margin-bottom: 6px;
}

.recent-drink:last-child {
  margin-bottom: 0;
}

.recent-drink-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.recent-drink-user {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.95rem;
}

.recent-drink-beer {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-drink-time {
  color: var(--text-dim);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-left: 10px;
}

/* Leaderboard */
.leaderboard-section {
  background: var(--bg-panel);
  border-radius: 16px;
  border: 2px solid #2a2a3e;
  overflow: hidden;
}

.leaderboard-header {
  background: linear-gradient(135deg, #1a1a2e, #12121a);
  padding: 16px;
  text-align: center;
  border-bottom: 2px solid var(--primary);
}

.leaderboard-header h2 {
  color: var(--gold);
  letter-spacing: 3px;
  font-size: 1.1rem;
}

.leaderboard-table {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a3e;
}

.leaderboard-rank {
  width: 40px;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-rank.gold { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.leaderboard-rank.silver { color: var(--silver); }
.leaderboard-rank.bronze { color: var(--bronze); }

.leaderboard-name {
  flex: 1;
  font-size: 1rem;
  letter-spacing: 1px;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-score {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  flex-shrink: 0;
  margin-left: 10px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-panel);
  padding: 28px 24px;
  border-radius: 20px;
  border: 2px solid var(--primary);
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.modal-content h3 {
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
  font-size: 1.2rem;
}

.modal-content p {
  color: var(--text-dim);
  margin-bottom: 8px;
}

.modal-content input {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  background: var(--bg-dark);
  border: 2px solid #2a2a3e;
  border-radius: 10px;
  color: var(--text);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  text-align: center;
}

.btn-secondary {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  background: #333;
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  -webkit-appearance: none;
}

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

/* Animations - reduced for mobile */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.mega-drink-btn {
  animation: pulse 2s infinite;
}

@keyframes drinkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.drink-animation {
  animation: drinkPop 0.3s ease !important;
}

/* AI Roast Popup */
.roast-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  animation: roastIn 0.3s ease;
  width: calc(100% - 40px);
  max-width: 400px;
}

.roast-content {
  background: linear-gradient(135deg, #1a1a2e, #0d0d15);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.roast-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.roast-text {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

@keyframes roastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.roast-popup.fade-out {
  animation: roastOut 0.4s ease forwards;
}

@keyframes roastOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Hide scrollbars but keep functionality */
.scoreboard-main::-webkit-scrollbar,
.leaderboard-table::-webkit-scrollbar,
.recent-drinks::-webkit-scrollbar {
  display: none;
}

.scoreboard-main,
.leaderboard-table,
.recent-drinks {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Prevent overscroll bounce */
@supports (-webkit-touch-callout: none) {
  body {
    position: fixed;
    width: 100%;
  }
}

/* Profile Styles */
.header-profile-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.header-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-profile-photo span {
  font-size: 1.2rem;
}

.profile-modal {
  text-align: center;
}

.profile-photo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
  cursor: pointer;
}

.profile-photo-circle.large {
  width: 100px;
  height: 100px;
  border-width: 4px;
}

.profile-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-circle span {
  font-size: 2rem;
  color: var(--text-dim);
}

.profile-photo-upload {
  margin-bottom: 16px;
}

.photo-upload-label {
  display: inline-block;
  margin-top: 8px;
  color: var(--secondary);
  font-size: 0.9rem;
  cursor: pointer;
}

.profile-modal input[type="file"] {
  display: none;
}

.profile-modal textarea {
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--bg-dark);
  border: 2px solid #2a2a3e;
  border-radius: 10px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  resize: none;
  min-height: 80px;
}

.profile-modal textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.profile-modal textarea::placeholder {
  color: var(--text-dim);
}

.profile-admin-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), #cc9900);
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
}

.profile-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.profile-fact-section {
  background: var(--bg-dark);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.profile-fact-section h4 {
  color: var(--primary);
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.profile-fact-section p {
  color: var(--text);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.4;
}

.leaderboard-name {
  cursor: pointer;
}

.leaderboard-name:active {
  opacity: 0.7;
}

/* Countdown Styles */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
  text-align: center;
}

.countdown-title {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  color: var(--primary);
  letter-spacing: 4px;
  margin-bottom: 10px;
  text-shadow: 0 0 20px var(--primary);
}

.countdown-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.countdown-timer {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
}

.countdown-unit {
  background: var(--bg-panel);
  border: 2px solid var(--secondary);
  border-radius: 12px;
  padding: 20px 15px;
  min-width: 70px;
}

.countdown-value {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--secondary);
  text-shadow: 0 0 15px var(--secondary);
}

.countdown-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-top: 5px;
}

.countdown-goal {
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: 3px;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  justify-content: space-around;
  background: var(--bg-panel);
  border-top: 2px solid #2a2a3e;
  padding: 8px 0;
  padding-bottom: calc(8px + var(--safe-bottom));
  flex-shrink: 0;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: 'Oswald', sans-serif;
  -webkit-appearance: none;
}

.tab-item.active {
  color: var(--primary);
}

.tab-icon {
  font-size: 1.5rem;
}

.tab-label {
  font-size: 0.7rem;
  letter-spacing: 1px;
}

/* Chat View */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--bg-panel);
  padding: 16px;
  text-align: center;
  border-bottom: 2px solid var(--secondary);
  flex-shrink: 0;
}

.chat-header h2 {
  color: var(--secondary);
  letter-spacing: 3px;
  font-size: 1.1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.chat-message.mine {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar span {
  font-size: 1rem;
}

.chat-bubble {
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 10px 14px;
  border: 1px solid #2a2a3e;
}

.chat-message.mine .chat-bubble {
  background: rgba(255, 107, 0, 0.2);
  border-color: var(--primary);
}

.chat-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.chat-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  cursor: pointer;
}

.chat-time {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.chat-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border-top: 1px solid #2a2a3e;
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-dark);
  border: 2px solid #2a2a3e;
  border-radius: 25px;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-send {
  padding: 14px 20px;
  background: var(--primary);
  border: none;
  border-radius: 25px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  -webkit-appearance: none;
}

.btn-send:active {
  transform: scale(0.95);
}

/* Drunk AI Button */
.btn-drunk-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
}

.btn-drunk-ai:active {
  transform: scale(0.95);
}

.btn-drunk-ai span {
  font-size: 1.3rem;
}

/* Drunk AI Modal */
.drunk-ai-modal {
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.drunk-ai-header {
  text-align: center;
  margin-bottom: 16px;
}

.drunk-ai-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.drunk-ai-header h3 {
  color: #8b5cf6;
  letter-spacing: 3px;
}

.drunk-ai-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

.drunk-ai-messages {
  flex: 1;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drunk-ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.drunk-ai-msg.ai {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid #8b5cf6;
  align-self: flex-start;
}

.drunk-ai-msg.user {
  background: rgba(255, 107, 0, 0.2);
  border: 1px solid var(--primary);
  align-self: flex-end;
}

.drunk-ai-msg.typing {
  opacity: 0.7;
}

.drunk-ai-msg p {
  margin: 0;
  color: var(--text);
}

.drunk-ai-input-area {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.drunk-ai-input-area input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 2px solid #2a2a3e;
  border-radius: 20px;
  color: var(--text);
  font-size: 16px;
}

.drunk-ai-input-area input:focus {
  outline: none;
  border-color: #8b5cf6;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .dashboard-header {
    padding: 8px 10px;
    padding-top: calc(8px + var(--safe-top));
  }

  .team-info {
    font-size: 0.75rem;
    gap: 4px;
  }

  .header-profile-photo {
    width: 30px;
    height: 30px;
  }

  .admin-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  .btn-invite, .btn-logout {
    padding: 6px 8px;
    font-size: 0.65rem;
  }

  .counter-section {
    padding: 12px 8px;
  }

  .counter-label {
    font-size: 0.8rem;
    letter-spacing: 3px;
  }

  .mega-counter {
    font-size: 1.5rem;
    gap: 1px;
    padding: 6px 2px;
  }

  .digit {
    min-width: 18px;
    padding: 6px 2px;
  }

  .goal-text {
    font-size: 0.9rem;
  }

  .mega-drink-btn {
    width: 120px;
    height: 120px;
  }

  .mega-drink-btn .beer-icon {
    font-size: 2rem;
  }

  .mega-drink-btn .drink-text {
    font-size: 1rem;
    letter-spacing: 2px;
  }

  .your-count {
    font-size: 1rem;
  }

  .btn-drunk-ai {
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .tab-icon {
    font-size: 1.2rem;
  }

  .tab-label {
    font-size: 0.6rem;
  }
}

/* Medium phones (iPhone 12/13/14) */
@media (min-width: 376px) and (max-width: 428px) {
  .mega-counter {
    font-size: clamp(1.6rem, 8vw, 2.5rem);
  }

  .digit {
    min-width: clamp(18px, 6vw, 28px);
  }

  .counter-label {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }
}

/* Large phones (iPhone Plus, Pro Max) */
@media (min-width: 429px) and (max-width: 480px) {
  .mega-counter {
    font-size: 2.2rem;
  }

  .digit {
    min-width: 28px;
  }
}

/* Tablets and larger */
@media (min-width: 481px) {
  .dashboard-header {
    padding: 16px 24px;
  }

  .team-info {
    font-size: 1.1rem;
  }

  .btn-invite, .btn-logout {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .scoreboard-main {
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
  }

  .counter-section {
    padding: 24px 20px;
  }

  .mega-counter {
    font-size: 3.5rem;
  }

  .digit {
    min-width: 40px;
    padding: 12px 8px;
  }

  .mega-drink-btn {
    width: 180px;
    height: 180px;
  }
}

/* Landscape mode on phones */
@media (max-height: 500px) and (orientation: landscape) {
  .counter-section {
    padding: 10px 8px;
    margin-bottom: 8px;
  }

  .counter-label {
    margin-bottom: 4px;
    font-size: 0.8rem;
  }

  .mega-counter {
    padding: 4px 2px;
  }

  .goal-tracker {
    margin-top: 10px;
  }

  .goal-bar {
    height: 14px;
  }

  .goal-text {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .drink-section {
    padding: 10px 0;
  }

  .mega-drink-btn {
    width: 100px;
    height: 100px;
  }

  .mega-drink-btn .beer-icon {
    font-size: 1.8rem;
  }

  .mega-drink-btn .drink-text {
    font-size: 0.9rem;
  }

  .your-count {
    margin-top: 8px;
    font-size: 0.95rem;
  }

  .recent-section, .leaderboard-section {
    margin-bottom: 8px;
  }

  .tab-bar {
    padding: 4px 0;
  }

  .tab-icon {
    font-size: 1.2rem;
  }

  .tab-label {
    font-size: 0.6rem;
  }
}

/* Fix for notched iPhones */
@supports (padding-top: env(safe-area-inset-top)) {
  .dashboard-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .tab-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .auth-container {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Ensure touch targets are large enough */
@media (pointer: coarse) {
  .btn-invite, .btn-logout, .btn-primary, .btn-secondary, .btn-danger {
    min-height: 44px;
  }

  .tab-item {
    min-height: 50px;
  }

  .leaderboard-row {
    min-height: 50px;
  }

  .chat-input-area input {
    min-height: 44px;
  }

  .btn-send {
    min-height: 44px;
    min-width: 60px;
  }
}
