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

/* ---- App Modal ---- */
.app-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease;
}
.app-modal-overlay.hidden { display: none; }
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.app-modal {
  background: linear-gradient(180deg, #2a0a0a, #1a0505);
  border: 2px solid #cc0000;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px; width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.app-modal-icon { font-size: 48px; margin-bottom: 12px; }
.app-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px; color: #ff4444;
  letter-spacing: 0.03em; margin-bottom: 8px;
}
.app-modal-body {
  font-size: 15px; color: #e8c4c4;
  line-height: 1.5; margin-bottom: 20px;
}
.app-modal-input {
  width: 100%; padding: 10px 14px;
  border: 2px solid #3a1515; border-radius: 8px;
  background: #1a0505; color: #e8c4c4;
  font-size: 15px; outline: none;
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
}
.app-modal-input:focus { border-color: #cc0000; }
.app-modal-input.hidden { display: none; }
.app-modal-actions {
  display: flex; gap: 10px; justify-content: center;
}
.app-modal-btn {
  padding: 10px 24px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.03em;
  transition: all 0.2s;
}
.app-modal-btn-primary {
  background: #cc0000; color: white;
}
.app-modal-btn-primary:hover { background: #ee0000; }
.app-modal-btn-secondary {
  background: #3a1515; color: #b08888;
}
.app-modal-btn-secondary:hover { background: #4a2020; color: #e8c4c4; }

/* ---- Custom Scrollbars ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cc0000, #880000);
  border-radius: 10px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ee0000, #aa0000); background-clip: padding-box;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #1a0a0a;
  height: 100vh;
  height: 100dvh;
  display: flex;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ---- Auth Gate ---- */
.auth-gate {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1a0a0a 0%, #2a0505 50%, #1a0a0a 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 24px;
}
.auth-gate.hidden { display: none; }

.auth-box {
  background: linear-gradient(180deg, #2a0a0a, #1a0505);
  border: 2px solid #cc0000;
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 60px rgba(204,0,0,0.15);
}
.auth-box .logo-big { font-size: 64px; margin-bottom: 16px; }
.auth-box h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px; color: #ff4444;
  letter-spacing: 0.05em; margin-bottom: 4px;
}
.auth-box .tagline {
  color: #884444; font-size: 14px; margin-bottom: 28px;
  font-style: italic;
}
.google-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: white; color: #333; border: none; padding: 14px 28px;
  border-radius: 8px; font-size: 16px; font-weight: 600;
  cursor: pointer; width: 100%; transition: all 0.2s;
}
.google-signin-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); transform: translateY(-1px); }
.google-signin-btn img { width: 20px; height: 20px; }

/* ---- Signup Form (shown after first Google sign-in) ---- */
.signup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.signup-overlay.hidden { display: none; }

.signup-box {
  background: linear-gradient(180deg, #2a0a0a, #1a0505);
  border: 2px solid #cc0000;
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 400px; width: 90%;
}
.signup-box h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; color: #ff4444;
  text-align: center; margin-bottom: 20px;
}
.signup-box label {
  display: block; color: #b08888; font-size: 13px;
  font-weight: 600; margin-bottom: 4px; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.signup-box input {
  width: 100%; padding: 10px 14px; border: 2px solid #3a1515;
  border-radius: 8px; background: #1a0505; color: #e8c4c4;
  font-size: 15px; margin-bottom: 14px; outline: none;
  font-family: 'Inter', sans-serif;
}
.signup-box input:focus { border-color: #cc0000; }
.signup-box button {
  width: 100%; padding: 12px; background: #cc0000; color: white;
  border: none; border-radius: 8px; font-size: 16px;
  font-weight: 700; cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.05em; margin-top: 4px;
}
.signup-box button:hover { background: #ee0000; }

/* ---- App Shell ---- */
.app-shell { display: flex; width: 100%; height: 100vh; }
.app-shell.hidden { display: none; }

/* ---- Sidebar ---- */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1a0505 0%, #2a0a0a 100%);
  color: #e8c4c4;
  display: flex; flex-direction: column;
  border-right: 3px solid #cc0000;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 3px solid #cc0000;
  text-align: center;
  background: linear-gradient(180deg, #330000, #1a0505);
}
.sidebar-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; font-weight: 400;
  color: #ff4444; letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(255,0,0,0.3);
}
.sidebar-header .subtitle {
  font-size: 11px; color: #884444;
  text-transform: uppercase; letter-spacing: 0.15em; margin-top: 2px;
}

.sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  padding: 8px;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: #b08888;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
  min-height: 44px;
}
.nav-item:hover { background: #3a1515; color: #e8c4c4; }
.nav-item.active { background: #cc0000; color: white; font-weight: 600; }
.nav-item.hidden { display: none; }
.nav-item .nav-icon {
  font-size: 18px; width: 28px; min-width: 28px;
  text-align: center; display: inline-flex;
  align-items: center; justify-content: center;
}

.sidebar-user {
  padding: 12px;
  border-top: 2px solid #3a1515;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background 0.15s;
  border-radius: 0;
}
.sidebar-user:hover { background: #3a1515; }
.sidebar-user img {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #cc0000;
}
.sidebar-user .user-name {
  font-size: 13px; font-weight: 600; color: #e8c4c4;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; background: #faf5ee;
}

/* ---- Tab Header ---- */
.tab-header {
  background: linear-gradient(135deg, #cc0000 0%, #8b0000 50%, #660000 100%);
  color: white;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  position: relative; overflow: hidden;
}
.tab-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 20px,
    rgba(255,255,255,0.02) 20px, rgba(255,255,255,0.02) 40px);
}
.tab-header .logo {
  width: 48px; height: 48px; background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); position: relative;
}
.tab-header .header-text { position: relative; }
.tab-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; font-weight: 400; letter-spacing: 0.05em;
}
.tab-header p { font-size: 13px; opacity: 0.8; letter-spacing: 0.03em; }
.tab-header .greek {
  position: relative; margin-left: auto;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px; opacity: 0.15; letter-spacing: 0.1em;
}

/* ---- Tab Panels ---- */
.tab-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.tab-panel.active { display: flex; }

/* ---- Chat Tab ---- */
.chat-container {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  background:
    radial-gradient(circle at 20% 80%, rgba(204,0,0,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(204,0,0,0.03) 0%, transparent 50%),
    #faf5ee;
}

.welcome {
  text-align: center; padding: 50px 20px; color: #666;
}
.welcome .cup-hero {
  font-size: 90px; margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.welcome h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 46px; color: #cc0000;
  margin-bottom: 6px; letter-spacing: 0.05em;
}
.welcome .tagline {
  font-size: 18px; color: #999;
  margin-bottom: 24px; font-style: italic;
}
.welcome .quick-prompts {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; max-width: 500px; margin: 0 auto;
}
.welcome .quick-prompts span {
  background: white; border: 2px solid #e8d5c4;
  padding: 10px 20px; border-radius: 20px;
  font-size: 16px; color: #8b6914; cursor: pointer; transition: all 0.2s;
}
.welcome .quick-prompts span:hover {
  border-color: #cc0000; color: #cc0000; background: #fff5f5;
}

.message { display: flex; gap: 12px; max-width: 720px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.message .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.message.assistant .avatar {
  background: linear-gradient(135deg, #cc0000, #8b0000);
  color: white; box-shadow: 0 2px 6px rgba(204,0,0,0.3);
}
.message.user .avatar {
  background: linear-gradient(135deg, #f0e6d4, #e0d0b8); color: #6b4423;
}

.message .bubble {
  padding: 14px 18px; border-radius: 16px;
  line-height: 1.6; font-size: 17px;
  white-space: pre-wrap; word-break: break-word;
}
.message.assistant .bubble {
  background: white; color: #1a1a1a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 3px solid #cc0000;
}
.message.user .bubble {
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(204,0,0,0.25);
}

/* Markdown in chat bubbles */
.message.assistant .bubble h1,
.message.assistant .bubble h2,
.message.assistant .bubble h3 {
  font-family: 'Bebas Neue', sans-serif;
  color: #cc0000; margin: 12px 0 6px;
  letter-spacing: 0.02em;
}
.message.assistant .bubble h1 { font-size: 22px; }
.message.assistant .bubble h2 { font-size: 19px; }
.message.assistant .bubble h3 { font-size: 17px; }
.message.assistant .bubble p { margin: 6px 0; }
.message.assistant .bubble ul,
.message.assistant .bubble ol {
  margin: 6px 0; padding-left: 20px;
}
.message.assistant .bubble li { margin: 3px 0; }
.message.assistant .bubble code {
  background: #f0e6d4; padding: 2px 6px;
  border-radius: 4px; font-size: 14px;
}
.message.assistant .bubble pre {
  background: #1a1a1a; color: #e8c4c4;
  padding: 12px; border-radius: 8px;
  overflow-x: auto; margin: 8px 0;
}
.message.assistant .bubble pre code {
  background: none; padding: 0; font-size: 13px;
}
.message.assistant .bubble strong { color: #cc0000; }
.message.assistant .bubble blockquote {
  border-left: 3px solid #cc0000;
  padding-left: 12px; margin: 8px 0;
  color: #666; font-style: italic;
}

.typing-cursor {
  display: inline-block; width: 2px; height: 16px;
  background: #cc0000; margin-left: 2px;
  vertical-align: text-bottom; animation: blink 0.8s infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.input-area {
  padding: 14px 24px; background: white;
  border-top: 3px solid #cc0000;
}
.input-row {
  display: flex; gap: 12px; max-width: 720px; margin: 0 auto;
}
.input-row input, .input-row textarea {
  flex: 1; padding: 14px 20px;
  border: 2px solid #e0d0c0; border-radius: 24px;
  font-size: 17px; outline: none; transition: border-color 0.2s;
  background: #faf7f2; font-family: 'Inter', sans-serif;
  resize: none;
}
.input-row input:focus, .input-row textarea:focus {
  border-color: #cc0000;
  box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
}
.input-row input::placeholder, .input-row textarea::placeholder { color: #bba88a; }
.input-row button {
  padding: 14px 32px;
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; border: none; border-radius: 24px;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
  text-transform: uppercase; font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.12em;
}
.input-row button:hover { box-shadow: 0 4px 12px rgba(204,0,0,0.4); }
.input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
  background: #fee2e2; color: #dc2626;
  padding: 12px 16px; border-radius: 12px;
  font-size: 14px; text-align: center; margin: 8px 24px;
}

/* ---- Tool Panels (Party, Text, Games) ---- */
.tool-panel {
  flex: 1; overflow-y: auto; padding: 32px;
  display: flex; flex-direction: column; align-items: center;
}
.tool-card {
  background: white; border-radius: 16px;
  padding: 32px; max-width: 640px; width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid #cc0000;
}
.tool-card h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; color: #cc0000;
  margin-bottom: 20px; letter-spacing: 0.03em;
}
.tool-card label {
  display: block; font-weight: 600; font-size: 13px;
  color: #666; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 6px; margin-top: 14px;
}
.tool-card label:first-of-type { margin-top: 0; }
.tool-card input, .tool-card select, .tool-card textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid #e0d0c0; border-radius: 8px;
  font-size: 15px; font-family: 'Inter', sans-serif;
  background: #faf7f2; outline: none;
}
.tool-card input:focus, .tool-card select:focus, .tool-card textarea:focus {
  border-color: #cc0000;
}
.tool-card textarea { min-height: 80px; resize: vertical; }

.tool-btn {
  display: inline-block; margin-top: 20px;
  padding: 12px 28px; background: linear-gradient(135deg, #cc0000, #990000);
  color: white; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.05em;
  transition: all 0.2s;
}
.tool-btn:hover { box-shadow: 0 4px 12px rgba(204,0,0,0.4); transform: translateY(-1px); }
.tool-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.result-box {
  margin-top: 24px; background: #faf7f2;
  border: 2px solid #e0d0c0; border-radius: 12px;
  padding: 20px; white-space: pre-wrap;
  line-height: 1.6; font-size: 15px;
  color: #333; min-height: 60px;
  display: none;
}
.result-box.active { display: block; }

.copy-btn {
  margin-top: 10px; padding: 8px 16px;
  background: #333; color: white; border: none;
  border-radius: 6px; font-size: 13px; cursor: pointer;
  font-weight: 600; display: none;
}
.copy-btn.active { display: inline-block; }
.copy-btn:hover { background: #555; }

/* ---- Text Generator recipient grid ---- */
.recipient-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.recipient-btn {
  padding: 14px 10px; background: #faf7f2;
  border: 2px solid #e0d0c0; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: center; transition: all 0.2s;
  color: #666;
}
.recipient-btn:hover { border-color: #cc0000; color: #cc0000; }
.recipient-btn.selected {
  border-color: #cc0000; background: #fff0f0;
  color: #cc0000; box-shadow: 0 0 0 2px rgba(204,0,0,0.15);
}

/* ---- Drinking Games ---- */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; width: 100%; max-width: 800px;
  margin-bottom: 24px;
}
.game-card {
  background: white; border-radius: 12px;
  padding: 20px; cursor: pointer;
  border-left: 4px solid #cc0000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all 0.2s;
}
.game-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.game-card .game-emoji { font-size: 32px; margin-bottom: 8px; }
.game-card h3 { font-size: 16px; color: #333; margin-bottom: 4px; }
.game-card p { font-size: 13px; color: #888; }

.game-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000;
}
.game-modal.hidden { display: none; }
.game-modal-content {
  background: white; border-radius: 16px;
  padding: 32px; max-width: 560px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.game-modal-content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; color: #cc0000; margin-bottom: 4px;
}
.game-modal-content .game-meta {
  font-size: 13px; color: #888; margin-bottom: 16px;
}
.game-modal-content .game-rules {
  line-height: 1.7; font-size: 15px; color: #333;
  white-space: pre-wrap;
}
.game-modal-close {
  float: right; background: none; border: none;
  font-size: 24px; cursor: pointer; color: #999;
  padding: 4px 8px;
}
.game-modal-close:hover { color: #333; }

/* ---- Social Tab ---- */
.social-container {
  flex: 1; display: flex; overflow: hidden;
}
.social-sidebar {
  width: 260px; background: white;
  border-right: 2px solid #e0d0c0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.social-sidebar h3 {
  padding: 16px 16px 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; color: #cc0000;
  letter-spacing: 0.03em;
}
.bros-list {
  flex: 1; overflow-y: auto; padding: 0 8px 8px;
}
.bro-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 8px;
  transition: background 0.15s;
}
.bro-item:hover { background: #faf5ee; }
.bro-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  position: relative;
}
.bro-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bro-status-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid white;
}
.bro-status-dot.online { background: #22c55e; }
.bro-status-dot.offline { background: #999; }
.bro-info { flex: 1; min-width: 0; }
.bro-info .bro-name { font-size: 14px; font-weight: 600; color: #333; }
.bro-info .bro-status-text { font-size: 12px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-picker {
  padding: 12px;
  border-top: 2px solid #e0d0c0;
}
.status-picker select {
  width: 100%; padding: 8px 10px;
  border: 2px solid #e0d0c0; border-radius: 8px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  background: #faf7f2; outline: none;
}
.status-picker select:focus { border-color: #cc0000; }

.social-chat {
  flex: 1; display: flex; flex-direction: column;
  background: #faf5ee;
}
.group-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.gc-message {
  display: flex; gap: 8px; align-items: flex-start;
  animation: fadeIn 0.2s ease;
}
.gc-message img {
  width: 28px; height: 28px; border-radius: 50%; margin-top: 2px;
}
.gc-message .gc-bubble {
  background: white; padding: 8px 12px;
  border-radius: 12px; border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  max-width: 400px;
}
.gc-message .gc-name { font-size: 12px; font-weight: 700; color: #cc0000; }
.gc-message .gc-text { font-size: 14px; color: #333; line-height: 1.4; }
.gc-message .gc-time { font-size: 11px; color: #aaa; margin-top: 2px; }

.gc-input-area {
  padding: 12px 16px; background: white;
  border-top: 2px solid #e0d0c0;
  display: flex; gap: 10px;
}
.gc-input-area input {
  flex: 1; padding: 10px 16px;
  border: 2px solid #e0d0c0; border-radius: 20px;
  font-size: 14px; outline: none; background: #faf7f2;
  font-family: 'Inter', sans-serif;
}
.gc-input-area input:focus { border-color: #cc0000; }
.gc-input-area button {
  padding: 10px 20px; background: #cc0000;
  color: white; border: none; border-radius: 20px;
  font-weight: 700; cursor: pointer; font-size: 14px;
}
.gc-input-area button:hover { background: #ee0000; }
.gc-input-area.hidden { display: none; }

/* Own messages — right-aligned */
.gc-message.gc-mine {
  flex-direction: row-reverse;
}
.gc-message.gc-mine .gc-bubble {
  background: #cc0000;
  color: white;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 12px;
}
.gc-message.gc-mine .gc-name { display: none; }
.gc-message.gc-mine .gc-text { color: white; }
.gc-message.gc-mine .gc-time { color: rgba(255,255,255,0.6); }

/* Free-user locked overlay */
.gc-chat-locked {
  position: absolute;
  inset: 0;
  background: rgba(250,245,238,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.gc-locked-content {
  text-align: center;
  max-width: 360px;
  padding: 32px;
}
.gc-locked-emoji { font-size: 56px; margin-bottom: 12px; }
.gc-locked-content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: #cc0000;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.gc-locked-content p {
  color: #666;
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ---- Paywall Overlay ---- */
.paywall-overlay {
  position: absolute; inset: 0;
  background: rgba(250,245,238,0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.tab-panel { position: relative; }

.paywall-box {
  text-align: center; max-width: 400px; padding: 40px;
}
.paywall-emoji { font-size: 64px; margin-bottom: 16px; }
.paywall-box h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px; color: #cc0000;
  margin-bottom: 8px; letter-spacing: 0.03em;
}
.paywall-box p {
  color: #666; font-size: 15px; margin-bottom: 24px; line-height: 1.5;
}
.upgrade-btn {
  display: inline-block; padding: 14px 32px;
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.05em;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(204,0,0,0.3);
}
.upgrade-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(204,0,0,0.4); }

.paywall-features {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 20px;
}
.paywall-features div {
  background: white; border: 1px solid #e0d0c0;
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; color: #666;
}

/* ---- Pro Badge & Lock ---- */
.pro-badge {
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pro-lock {
  margin-left: auto;
  background: #3a1515; color: #884444;
  font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.nav-item.active .pro-lock { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.7); }

/* ---- Profile Page ---- */
.profile-card {
  text-align: center;
  max-width: 480px !important;
}
.profile-photo-wrap {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto 20px;
  cursor: pointer;
}
.profile-photo {
  width: 120px; height: 120px;
  border-radius: 50%; object-fit: cover;
  border: 4px solid #cc0000;
  box-shadow: 0 4px 12px rgba(204,0,0,0.2);
}
.profile-photo-overlay {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white; font-weight: 700;
  font-size: 14px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  cursor: pointer;
}
.profile-photo-wrap:hover .profile-photo-overlay { opacity: 1; }
.profile-disabled {
  background: #eee !important;
  color: #999 !important;
  cursor: not-allowed;
}
.profile-subscription {
  padding: 8px 0 4px;
  margin-bottom: 8px;
}
.profile-sub-status {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.profile-sub-label {
  font-size: 14px; color: #666;
}
.profile-manage-btn {
  width: 100%; padding: 10px 20px;
  background: #333; color: white; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.03em; transition: all 0.2s;
}
.profile-manage-btn:hover { background: #555; }
.profile-upgrade-btn {
  width: 100%; padding: 10px 20px;
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.03em;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(204,0,0,0.3);
}
.profile-upgrade-btn:hover { box-shadow: 0 4px 12px rgba(204,0,0,0.4); transform: translateY(-1px); }
.profile-signout-btn {
  width: 100%; padding: 12px 20px;
  background: none; color: #cc0000;
  border: 2px solid #cc0000; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.05em;
  transition: all 0.2s;
}
.profile-signout-btn:hover { background: #cc0000; color: white; }

/* ---- Fratify Preview ---- */
.fratify-preview {
  padding: 12px 16px;
  background: #fff5ee;
  border-top: 2px solid #ff8c00;
  border-bottom: 2px solid #ff8c00;
}
.fratify-preview.hidden { display: none; }
.fratify-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; color: #ff8c00;
  margin-bottom: 8px; letter-spacing: 0.03em;
}
.fratify-preview textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid #ffc078; border-radius: 8px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  background: white; outline: none; resize: vertical;
  min-height: 60px;
}
.fratify-preview textarea:focus { border-color: #ff8c00; }
.fratify-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.fratify-send-btn {
  padding: 8px 18px; background: #ff8c00;
  color: white; border: none; border-radius: 8px;
  font-weight: 700; cursor: pointer; font-size: 13px;
  text-transform: uppercase; transition: all 0.2s;
}
.fratify-send-btn:hover { background: #e67e00; }
.fratify-send-btn:disabled {
  opacity: 0.6; cursor: not-allowed;
  animation: fratifyPulse 1.2s ease-in-out infinite;
}
@keyframes fratifyPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.fratify-label { transition: color 0.2s; }
.fratify-preview textarea::placeholder {
  color: #ff8c00; font-weight: 600; font-style: italic;
}
.fratify-cancel-btn {
  padding: 8px 18px; background: #eee;
  color: #666; border: none; border-radius: 8px;
  font-weight: 600; cursor: pointer; font-size: 13px;
}
.fratify-cancel-btn:hover { background: #ddd; }

/* Fratify button in input area */
.fratify-btn {
  width: 40px; height: 40px;
  background: #fff5ee; border: 2px solid #ffc078;
  border-radius: 50%; font-size: 18px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fratify-btn:hover { background: #ff8c00; border-color: #ff8c00; }
.fratify-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- GC Message Delete Button ---- */
.gc-delete-btn {
  position: absolute; top: 4px; right: 4px;
  background: none; border: none;
  color: #cc0000; font-size: 16px;
  cursor: pointer; opacity: 0;
  transition: opacity 0.15s;
  padding: 0 4px; line-height: 1;
}
.gc-message:hover .gc-delete-btn { opacity: 0.6; }
.gc-delete-btn:hover { opacity: 1 !important; }
.gc-message.gc-mine .gc-delete-btn {
  right: auto; left: 4px;
  color: rgba(255,255,255,0.7);
}
.gc-message.gc-mine:hover .gc-delete-btn { opacity: 0.8; }
.gc-message.gc-mine .gc-delete-btn:hover { color: white; }

/* Make gc-bubble relative for delete btn positioning */
.gc-message .gc-bubble { position: relative; }

/* ---- Admin Panel ---- */
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  table-layout: fixed;
}
.admin-table th:nth-child(1) { width: 18%; }
.admin-table th:nth-child(2) { width: 12%; }
.admin-table th:nth-child(3) { width: 20%; }
.admin-table th:nth-child(4) { width: 8%; }
.admin-table th:nth-child(5) { width: 10%; }
.admin-table th:nth-child(6) { width: 32%; }
.admin-table th {
  text-align: left; padding: 10px 8px;
  border-bottom: 2px solid #cc0000;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: #888;
}
.admin-table td {
  padding: 0 8px; border-bottom: 1px solid #eee;
  vertical-align: middle; height: 70px;
}
.admin-table tr:hover td { background: #faf7f2; }
.admin-table td:first-child {
  font-weight: 600;
}
.admin-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  vertical-align: middle; margin-right: 8px;
}
.admin-tier-pro {
  background: linear-gradient(135deg, #cc0000, #990000);
  color: white; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
}
.admin-tier-free {
  background: #e0d0c0; color: #666;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
}
.admin-actions {
  display: flex; gap: 4px; flex-wrap: nowrap;
}
.admin-btn {
  padding: 4px 10px; border: 1px solid #ddd;
  border-radius: 4px; font-size: 11px;
  cursor: pointer; background: white;
  font-weight: 600; transition: all 0.15s;
}
.admin-btn:hover { background: #f5f5f5; }
.admin-btn-good {
  border-color: #22c55e; color: #22c55e;
}
.admin-btn-good:hover { background: #f0fdf4; }
.admin-btn-warn {
  border-color: #f59e0b; color: #f59e0b;
}
.admin-btn-warn:hover { background: #fffbeb; }
.admin-btn-danger {
  border-color: #dc2626; color: #dc2626;
}
.admin-btn-danger:hover { background: #fef2f2; }

/* ---- Mobile Header ---- */
.mobile-header {
  display: none;
  background: linear-gradient(135deg, #1a0505, #2a0a0a);
  color: #ff4444;
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
  border-bottom: 3px solid #cc0000;
  z-index: 1000;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}
.mobile-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.05em;
  flex: 1;
}
.mobile-header .mobile-icon { font-size: 22px; }
.hamburger {
  background: none; border: none;
  color: #ff4444; font-size: 28px;
  cursor: pointer; padding: 0;
  line-height: 1;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar-overlay:not(.hidden) { display: block; }

  .app-shell {
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* use dynamic viewport height on mobile */
    overflow: hidden;
  }

  .sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0;
    width: 250px; z-index: 2000;
    transition: left 0.3s ease;
  }
  .sidebar.open { left: 0; }

  .main-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Tab header */
  .tab-header { padding: 10px 16px; gap: 10px; flex-shrink: 0; }
  .tab-header .logo { width: 36px; height: 36px; font-size: 20px; }
  .tab-header h1 { font-size: 20px; }
  .tab-header p { font-size: 11px; }
  .tab-header .greek { font-size: 28px; }

  /* Tab panels fill remaining space */
  .tab-panel.active {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Chat */
  .chat-container { padding: 12px; flex: 1; min-height: 0; }
  .welcome { padding: 30px 16px; }
  .welcome .cup-hero { font-size: 50px; }
  .welcome h2 { font-size: 26px; }
  .welcome .tagline { font-size: 13px; margin-bottom: 16px; }
  .welcome .quick-prompts span {
    padding: 10px 16px; font-size: 13px;
    min-height: 44px; display: flex; align-items: center;
  }

  .message { max-width: 95%; }
  .message .avatar { width: 32px; height: 32px; font-size: 16px; }
  .message .bubble { padding: 10px 14px; font-size: 15px; }

  .input-area { padding: 10px 12px; flex-shrink: 0; }
  .input-row { gap: 8px; }
  .input-row input { padding: 10px 14px; font-size: 16px; } /* 16px prevents iOS zoom */
  .input-row button { padding: 10px 18px; font-size: 18px; min-height: 44px; }

  /* Tool panels (party, texts, games, profile, admin) */
  .tool-panel { padding: 16px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .tool-card { padding: 20px; }
  .tool-card h2 { font-size: 22px; }
  .tool-card input, .tool-card select, .tool-card textarea { font-size: 16px; } /* 16px prevents iOS zoom */
  .tool-btn { min-height: 48px; width: 100%; font-size: 16px; }

  /* Text generator */
  .recipient-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .recipient-btn { padding: 12px 8px; font-size: 13px; min-height: 48px; }

  /* Drinking games — bigger tap targets */
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-card {
    padding: 16px;
    min-height: 48px;
    -webkit-tap-highlight-color: rgba(204,0,0,0.1);
    cursor: pointer;
    user-select: none;
  }
  .game-card:active { transform: scale(0.97); background: #fff5f5; }

  /* Game modal — mobile friendly close */
  .game-modal { align-items: flex-end; } /* slide up from bottom on mobile */
  .game-modal-content {
    padding: 24px 20px; width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: 32px;
    -webkit-overflow-scrolling: touch;
  }
  .game-modal-close {
    font-size: 32px; padding: 8px 12px;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Social tab — stack on mobile */
  .social-container { flex-direction: column; flex: 1; min-height: 0; }
  .social-sidebar {
    width: 100%; border-right: none;
    border-bottom: 2px solid #e0d0c0;
    max-height: 140px; flex-shrink: 0;
  }
  .bros-list { max-height: 80px; -webkit-overflow-scrolling: touch; }
  .social-chat { min-height: 0; flex: 1; display: flex; flex-direction: column; }
  .group-chat-messages { flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }

  .gc-input-area { padding: 8px 10px; gap: 6px; flex-shrink: 0; }
  .gc-input-area input { padding: 10px 14px; font-size: 16px; min-height: 44px; } /* 16px prevents iOS zoom */
  .gc-input-area button { padding: 10px 14px; font-size: 13px; min-height: 44px; min-width: 44px; }
  .fratify-btn { width: 44px; height: 44px; font-size: 18px; }
  .fratify-preview { flex-shrink: 0; }

  .gc-message .gc-bubble { max-width: 280px; }

  /* Show delete button always on mobile (no hover) */
  .gc-delete-btn {
    opacity: 0.5 !important;
    min-width: 32px; min-height: 32px;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Profile */
  .profile-card { max-width: 100% !important; }
  .profile-photo-wrap { width: 90px; height: 90px; }
  .profile-photo { width: 90px; height: 90px; }
  .profile-photo-overlay { opacity: 1; font-size: 12px; } /* always visible on mobile */

  /* Admin table scroll */
  .admin-table { font-size: 11px; }
  .tool-card:has(.admin-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-actions { flex-wrap: wrap; gap: 3px; }
  .admin-btn { padding: 6px 10px; font-size: 11px; min-height: 36px; }

  /* Paywall */
  .paywall-box { padding: 24px 16px; }
  .paywall-box h2 { font-size: 24px; }
  .upgrade-btn { padding: 14px 24px; font-size: 14px; min-height: 48px; }

  /* Modal */
  .app-modal { padding: 24px 20px; max-width: 90%; }
  .app-modal-btn { min-height: 44px; padding: 12px 20px; }

  /* Status picker */
  .status-picker select { font-size: 16px; min-height: 44px; } /* 16px prevents iOS zoom */

  /* Ensure all interactive elements have proper tap targets */
  .nav-item { min-height: 48px; }
  .sidebar-user { min-height: 52px; }
  .google-signin-btn { min-height: 48px; }
  .signup-box button { min-height: 48px; }
  .signup-box input { min-height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */
  .copy-btn { min-height: 44px; padding: 10px 16px; }
}

@media (max-width: 420px) {
  .recipient-grid { grid-template-columns: 1fr 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { padding: 16px; }
  .welcome .quick-prompts { gap: 6px; }
  .welcome .quick-prompts span { padding: 8px 14px; font-size: 12px; }
  .input-row button { padding: 10px 14px; font-size: 16px; letter-spacing: 0.05em; }
  .gc-message .gc-bubble { max-width: 240px; }
  .app-modal { max-width: 95%; }
}
