/* ==========================================================================
   VINYO — Complete Modern Daytime Design System & UI/UX Styles
   ========================================================================== */

:root {
  /* Core Colors */
  --bg-app: #FAFAF9;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4F2EE;
  --bg-input: #F7F5F0;
  --border-light: #EFECE6;
  --border-focus: #D4CDBC;

  /* Typography */
  --text-main: #1C1917;
  --text-muted: #78716C;
  --text-dim: #A8A29E;
  --text-inverse: #FFFFFF;

  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;

  /* Vibrant Signature Themes per Wine Type */
  --rose-card-bg: #B5728D;
  --rose-card-light: #FCEEF2;
  --amber-card-bg: #E7A93B;
  --amber-card-light: #FAF2DF;
  --rot-card-bg: #8E3447;
  --rot-card-light: #F9EBEF;
  --orange-card-bg: #DE7B47;
  --orange-card-light: #FDF1E8;
  --sage-card-bg: #6E9B89;
  --sage-card-light: #EDF5F1;

  /* Radii & Shadows */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --radius-pill: 9999px;

  --shadow-card: 0 10px 24px -4px rgba(28, 25, 23, 0.07), 0 2px 6px -1px rgba(28, 25, 23, 0.04);
  --shadow-sheet: 0 -12px 36px rgba(0, 0, 0, 0.15);
  --shadow-pill: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Master PIN Gate (Zero-Friction Welcome Screen) */
.pin-gate-screen {
  position: fixed;
  inset: 0;
  background: #FAFAF9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
}

.pin-gate-card {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  padding: 36px 26px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gate-logo {
  font-size: 3.2rem;
  margin-bottom: 8px;
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.gate-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-form input {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-input);
  font-size: 1.1rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  outline: none;
}

.gate-form input:focus {
  border-color: var(--text-main);
  background: #FFF;
}

/* Main Viewport Container */
.app-viewport {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--bg-surface);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
  padding-bottom: 86px;
}

/* Top App Bar */
.app-top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(239, 236, 230, 0.6);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.nav-icon-btn {
  background: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-icon-btn:hover {
  background: var(--bg-subtle);
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.user-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 2px solid var(--border-light);
  background: var(--rose-card-light);
}

/* Search Bar Container */
.search-bar-container {
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFF;
  border-bottom: 1px solid var(--border-light);
}

.search-bar-inner {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  gap: 10px;
}

.search-bar-inner input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
}

.clear-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.search-filters-row {
  display: flex;
  gap: 8px;
}

.sub-filter-select {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
}

/* App Body & Tabs */
.app-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Live Session Banner */
.live-tasting-banner {
  background: #1C1917;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.live-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ECC71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.35);
  animation: pulse 1.6s infinite;
}

.live-banner-content {
  flex: 1;
}

.live-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  font-weight: 700;
}

.live-wine-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

/* Featured Hero Card (The Vinyo Choice) */
.featured-card {
  position: relative;
  background-color: var(--rose-card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  min-height: 155px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FFFFFF;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s ease;
  overflow: hidden;
}

.featured-card:hover {
  transform: translateY(-2px);
}

.featured-card-bg-blob {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.featured-card-info {
  max-width: 60%;
  z-index: 2;
}

.featured-wine-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 4px;
}

.featured-wine-sub { font-size: 0.78rem; opacity: 0.9; }
.featured-wine-meta { font-size: 0.72rem; opacity: 0.75; margin-bottom: 12px; }

.price-pill-white {
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
}

.featured-bottle-wrapper {
  position: absolute;
  right: 18px;
  bottom: -6px;
  height: 180px;
  width: 100px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 3;
}

.featured-bottle-img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.25));
}

/* Gamification Row (Roulette & Mini cards) */
.gamification-row-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-trigger-card {
  background: linear-gradient(135deg, #2D2722, #1C1917);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}

.game-trigger-card:hover { transform: translateY(-2px); }

.game-card-icon { font-size: 1.8rem; }
.game-trigger-card h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.game-trigger-card p { font-size: 0.78rem; opacity: 0.8; }
.game-action-arrow { margin-left: auto; font-size: 1.3rem; font-weight: 700; }

.game-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-mini-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.game-mini-card:hover { background: var(--bg-subtle); }
.mini-game-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.mini-game-title { font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-game-stat { font-size: 0.78rem; color: #26593B; font-weight: 700; }

/* Category Pills */
.categories-section {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -20px;
  padding: 0 20px;
}
.categories-section::-webkit-scrollbar { display: none; }

.category-pills { display: flex; gap: 10px; }

.cat-pill {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.cat-pill.active {
  background: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

/* Wine Card Grid */
.wine-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.mini-wine-card {
  position: relative;
  background-color: var(--amber-card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FFFFFF;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s ease;
  overflow: hidden;
}

.mini-wine-card:hover { transform: translateY(-3px); }

.mini-card-blob {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.mini-bottle-stage {
  position: relative;
  height: 125px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  margin-bottom: 8px;
}

.mini-bottle-img {
  height: 100%;
  max-width: 80px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
}

.mini-card-text { z-index: 2; padding-right: 32px; }
.mini-wine-name { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-wine-price { font-size: 0.82rem; font-weight: 600; opacity: 0.92; }

.mini-card-action-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: #1C1917;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.mini-card-blacklisted-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #DC3545;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  z-index: 6;
}

.mini-rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #1C1917;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 6;
}

/* Themes */
.theme-rose { background-color: var(--rose-card-bg); }
.theme-amber { background-color: var(--amber-card-bg); }
.theme-rot { background-color: var(--rot-card-bg); }
.theme-orange { background-color: var(--orange-card-bg); }

/* ================= STATS & MATCHMAKING STYLES ================= */
.stats-header { margin-bottom: 4px; }
.stats-sub { font-size: 0.82rem; color: var(--text-muted); }

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.matchmaking-box {
  background: linear-gradient(180deg, #FBF8F3 0%, #FFFFFF 100%);
  border: 1.5px solid #EBE4D5;
}

.match-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #9C6424;
  letter-spacing: 0.05em;
}

.match-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.guest-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guest-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.guest-chip.selected {
  background: #1C1917;
  color: #FFFFFF;
  border-color: #1C1917;
}

.match-result-container {
  background: #EDF5F1;
  border: 1px solid #D1E5D9;
  border-radius: var(--radius-md);
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.match-result-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #26593B;
  line-height: 1.45;
}

/* Awards & Badges */
.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.award-item {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px;
}

.award-badge-title { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.award-wine-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; margin: 3px 0; }
.award-desc { font-size: 0.75rem; color: var(--text-muted); }

.badges-list { display: flex; flex-direction: column; gap: 8px; }

.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.badge-icon { font-size: 1.5rem; }
.badge-title { font-size: 0.85rem; font-weight: 700; }
.badge-user { font-size: 0.78rem; color: var(--text-muted); }

.stat-table-list { display: flex; flex-direction: column; gap: 8px; }

.stat-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.wordcloud-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ================= ADMIN & HOST STYLES ================= */
.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.admin-profile-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

.admin-blacklist-list { display: flex; flex-direction: column; gap: 8px; }

.admin-blacklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #FFF5F5;
  border: 1px solid #FED7D7;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* ================= BOTTOM NAVIGATION ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 68px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  z-index: 60;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-item.active { color: var(--text-main); }

.nav-add-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--text-main);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-pill);
  margin-top: -12px;
}

/* ================= FULLSCREEN DETAIL SHEET ================= */
.detail-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  justify-content: center;
}

.detail-sheet-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: #FFFFFF;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUpFull 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-hero-banner {
  background-color: var(--amber-card-bg);
  min-height: 380px;
  padding: 16px 20px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.detail-top-nav { display: flex; align-items: center; justify-content: space-between; z-index: 5; }

.detail-nav-btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  cursor: pointer;
}

.detail-eyebrow { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: #FFFFFF; }

.detail-hero-content {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 16px;
  z-index: 5;
}

.detail-bottle-stage {
  position: relative;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottle-glow-halo {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.detail-bottle-img {
  height: 100%;
  max-width: 110px;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28));
  z-index: 2;
}

.detail-quick-specs { color: #FFFFFF; display: flex; flex-direction: column; gap: 8px; }
.detail-wine-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.spec-label { font-size: 0.72rem; opacity: 0.8; }
.spec-val { font-size: 0.9rem; font-weight: 700; }

.detail-price-pill {
  align-self: flex-start;
  background: #FFFFFF;
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: var(--shadow-pill);
  margin-top: 4px;
}

.detail-body-white {
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #FFFFFF;
}

.detail-rating-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
}

.rating-badge-large {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
}

.star-icon { color: #E5A100; }
.rating-sub-title { font-size: 0.85rem; font-weight: 700; }
.rating-count-sub { font-size: 0.75rem; color: var(--text-muted); }

.detail-heading { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }

.detail-ratings-feed { display: flex; flex-direction: column; gap: 10px; }

.detail-rating-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-card-header { display: flex; align-items: center; justify-content: space-between; }
.rating-card-user { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 700; }
.rating-pill-grade { font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; padding: 3px 10px; border-radius: var(--radius-pill); background: #FFFFFF; }
.rating-card-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* ================= MODALS & DRAWERS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 500px) {
  .modal-backdrop { align-items: center; padding: 20px; }
}

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 22px 30px;
  box-shadow: var(--shadow-sheet);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 500px) {
  .modal-card { border-radius: var(--radius-xl); }
}

.modal-card-sm { max-width: 380px; }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.modal-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.modal-header h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.modal-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 18px; }

.close-modal-btn {
  background: var(--bg-subtle);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }

.modal-form input, .modal-form select, .modal-form textarea, .modal-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
}

.modal-form input:focus, .modal-form textarea:focus { border-color: var(--text-main); background: #FFFFFF; }

/* Large Pastel Avatar Grid ("Wer bist du heute?") */
.avatar-grid-large {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.avatar-pastel-card {
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.avatar-pastel-card:hover, .avatar-pastel-card.active {
  transform: scale(1.03);
  background: #FFFFFF;
  border-color: #1C1917;
  box-shadow: var(--shadow-card);
}

.avatar-huge { width: 56px; height: 56px; border-radius: var(--radius-pill); }
.avatar-card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

/* Grade Selector */
.grade-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.grade-btn {
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.grade-btn .grade-num { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.grade-btn .grade-desc { font-size: 0.62rem; color: var(--text-muted); font-weight: 600; }

.grade-btn.active { background: #FFFFFF; border-color: #1C1917; box-shadow: var(--shadow-card); }
.grade-btn.grade-6.active { border-color: #DC3545; background: #FFF5F5; }
.grade-btn.grade-6.active .grade-num { color: #DC3545; }

/* Warning Callout */
.warning-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FEECEB;
  border: 1px solid #FECDCA;
  border-radius: var(--radius-md);
  padding: 12px;
  animation: shake 0.3s ease;
}

.warning-callout-icon { font-size: 1.3rem; }
.warning-callout-text { font-size: 0.8rem; color: #B42318; line-height: 1.4; }

/* Vibe Chips */
.vibe-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.vibe-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.vibe-chip.active { background: #1C1917; color: #FFFFFF; border-color: #1C1917; }

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-dark { background: #1C1917; color: #FFFFFF; box-shadow: var(--shadow-pill); }
.btn-dark:hover { background: #000000; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-main); }
.btn-pill-outline { background: transparent; border: 1.5px solid var(--text-main); border-radius: var(--radius-pill); padding: 6px 14px; font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-text { background: none; border: none; color: #DC3545; text-decoration: underline; cursor: pointer; font-weight: 700; }

/* Roulette Slot Stage */
.roulette-slot-stage {
  height: 90px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.slot-spinning-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.roulette-winner-box {
  background: #EDF5F1;
  border: 1.5px solid #D1E5D9;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

/* User Taste DNA */
.taste-dna-body { display: flex; flex-direction: column; gap: 14px; }
.dna-stat-row { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--bg-input); border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 700; }

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 350;
  pointer-events: none;
}

.toast {
  background: #1C1917;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.25s ease;
}

.toast.toast-error { background: #DC3545; }
.toast.toast-success { background: #26593B; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideUpFull { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.screen-shake {
  animation: shake 0.45s ease-in-out !important;
}
