/* L'Amour Style Sheet - Gentle Pink Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Soft pink color palette */
  --bg-gradient: linear-gradient(135deg, #FFF5F7 0%, #FFEBEF 50%, #F5E6FA 100%);
  --color-primary: #FFB6C1; /* Light pink */
  --color-secondary: #FFC0CB; /* Pink */
  --color-dark-plum: #4A0E17; /* Dark text */
  --color-rose-gold: #B76E79; /* Accent gold */
  --color-accent-pink: #FF69B4; /* Hot pink */
  --color-soft-lavender: #E8D7F1;
  --color-spicy-red: #D11D44;
  
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 12px 40px 0 rgba(244, 63, 94, 0.08);
  --glass-shadow-hover: 0 16px 48px 0 rgba(244, 63, 94, 0.15);
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --transition-card: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset and Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--color-dark-plum);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Floating Particles Container */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: floatUp 6s linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(105vh) scale(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.6;
  }
  85% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) scale(1.2) rotate(360deg);
    opacity: 0;
  }
}

/* App Wrapper */
.app-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header styling */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: calc(4.5rem + env(safe-area-inset-top));
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-dark-plum);
  letter-spacing: 2px;
  display: inline-block;
  position: relative;
  margin-bottom: 0.25rem;
}

.brand-logo span {
  color: var(--color-accent-pink);
  font-style: italic;
}

.brand-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-rose-gold);
  font-weight: 500;
}

/* Screens System */
.screen {
  display: none;
  flex-direction: column;
  flex-grow: 1;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Panel Common Card */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  border: var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 1.75rem;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  box-shadow: var(--glass-shadow-hover);
  background: var(--glass-bg-hover);
}

/* --- HOME SCREEN --- */
.hero-banner {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hero-banner h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--color-dark-plum);
  margin-bottom: 0.5rem;
}

.hero-banner p {
  font-size: 0.9rem;
  color: var(--color-rose-gold);
  line-height: 1.4;
}

/* Deck Selector */
.deck-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.deck-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  cursor: pointer;
  border-radius: 20px;
  background: var(--glass-bg);
  border: var(--glass-border);
  transition: var(--transition-smooth);
}

.deck-item:hover {
  transform: translateY(-3px);
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
}

.deck-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
}

.deck-info {
  flex-grow: 1;
}

.deck-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--color-dark-plum);
}

.deck-desc {
  font-size: 0.8rem;
  color: var(--color-dark-plum);
  opacity: 0.82;
  line-height: 1.3;
}

.deck-arrow {
  font-size: 1.2rem;
  color: var(--color-rose-gold);
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.deck-item:hover .deck-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Home Buttons Panel */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-menu {
  background: var(--glass-bg);
  border: var(--glass-border);
  padding: 1rem;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-dark-plum);
  font-size: 0.85rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.btn-menu:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.1);
}

.btn-menu i {
  font-size: 1.4rem;
}

/* --- GAME SCREEN --- */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.btn-back {
  background: var(--glass-bg);
  border: var(--glass-border);
  color: var(--color-dark-plum);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition-smooth);
  box-shadow: var(--glass-shadow);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.game-title-container {
  text-align: center;
}

.game-deck-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-dark-plum);
}

.game-progress-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-rose-gold);
  margin-top: 0.1rem;
}

/* Card Arena Area */
.card-arena {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  padding: 1rem 0 2rem 0;
  min-height: 420px;
}

.card-container {
  perspective: 1200px;
  width: 100%;
  max-width: 320px;
  height: 420px;
  cursor: pointer;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: var(--transition-card);
  transform-style: preserve-3d;
}

.card-container.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 15px 35px rgba(74, 14, 23, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: var(--transition-smooth);
}

.card-front {
  background: var(--glass-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.card-back {
  transform: rotateY(180deg);
  justify-content: center;
  background: white; /* Will be overridden dynamically per deck */
  overflow: hidden;
}

.truth-dare-choice {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.btn-choice {
  width: 90%;
  padding: 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(74, 14, 23, 0.05);
}

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

.btn-choice.btn-truth {
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
}

.btn-choice.btn-truth:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 15px rgba(255, 182, 193, 0.35);
}

.btn-choice.btn-dare {
  background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
  color: white;
}

.btn-choice.btn-dare:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 20, 147, 0.35);
}

.revealed-content {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
  animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.revealed-content.active {
  display: flex;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.btn-reset-choice {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  transition: var(--transition-smooth);
}

.btn-reset-choice:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.03);
}

/* Card Visual Details */
.card-logo-mini {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: rgba(74, 14, 23, 0.4);
}

.card-logo-mini span {
  color: var(--color-accent-pink);
}

.card-tap-hint {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-rose-gold);
  opacity: 0.85;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.03); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.5; }
}

.card-icon-big {
  font-size: 3.5rem;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.05));
  margin-bottom: 0.5rem;
}

.card-category-badge {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.6;
  font-weight: 600;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

/* Card Type Badges on Back */
.badge-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  align-self: center;
}

.badge-type.question {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

.badge-type.dare {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  color: inherit;
}

/* Card Control Actions */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.btn-action {
  background: var(--glass-bg);
  border: var(--glass-border);
  color: var(--color-dark-plum);
  padding: 0.9rem 1.4rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  box-shadow: var(--glass-shadow);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.btn-action-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
}

/* --- DICE SCREEN --- */
.dice-instructions {
  text-align: center;
  margin-bottom: 2rem;
}

.dice-instructions h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.dice-instructions p {
  font-size: 0.85rem;
  color: var(--color-rose-gold);
}

.dice-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0;
}

/* 3D Dice Simulation */
.dice-container {
  display: flex;
  gap: 3rem;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.scene {
  width: 110px;
  height: 110px;
  perspective: 600px;
}

.dice {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.8s cubic-bezier(0.2, 0.8, 0.3, 1.05);
}

.dice-face {
  position: absolute;
  width: 110px;
  height: 110px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.75rem;
  backface-visibility: visible;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: inset 0 0 20px rgba(255, 182, 193, 0.35), 0 8px 25px rgba(74, 14, 23, 0.08);
  transition: var(--transition-smooth);
}

/* Action Dice Face Colors */
.action-dice .dice-face {
  background: rgba(255, 240, 243, 0.9);
  color: #8A1C30;
}

/* Body Dice Face Colors */
.body-dice .dice-face {
  background: rgba(243, 240, 255, 0.9);
  color: #3B1C8A;
}

/* Dice Coordinates */
.face-1 { transform: rotateY(0deg) translateZ(55px); }
.face-2 { transform: rotateY(90deg) translateZ(55px); }
.face-3 { transform: rotateY(180deg) translateZ(55px); }
.face-4 { transform: rotateY(-90deg) translateZ(55px); }
.face-5 { transform: rotateX(90deg) translateZ(55px); }
.face-6 { transform: rotateX(-90deg) translateZ(55px); }

.dice-face p {
  line-height: 1.25;
  margin: 0;
}

/* Dice Result Banner */
.dice-result-box {
  background: rgba(255, 255, 255, 0.6);
  border: var(--glass-border);
  padding: 1.25rem;
  border-radius: 18px;
  width: 100%;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition-smooth);
}

.dice-result-box.show {
  opacity: 1;
  transform: translateY(0);
}

.dice-result-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-dark-plum);
}

.dice-result-sub {
  font-size: 0.8rem;
  color: var(--color-rose-gold);
  margin-top: 0.25rem;
}

.btn-roll {
  background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
  color: white;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 20, 147, 0.3);
  transition: var(--transition-smooth);
}

.btn-roll:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(255, 20, 147, 0.45);
}

.btn-roll:active {
  transform: translateY(0) scale(1);
}

/* --- CUSTOM CARDS SCREEN --- */
.custom-card-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-dark-plum);
}

.input-text, .select-input, .textarea-input {
  background: var(--input-bg, rgba(255, 255, 255, 0.5));
  border: 1px solid var(--input-border, rgba(255, 255, 255, 0.8));
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 16px; /* Explicitly set to 16px to prevent iOS auto-zoom on keyboard focus */
  color: var(--color-dark-plum);
  outline: none;
  transition: var(--transition-smooth);
}

.input-text:focus, .select-input:focus, .textarea-input:focus {
  background: white;
  border-color: var(--color-accent-pink);
  box-shadow: 0 0 10px rgba(255, 105, 180, 0.15);
}

.textarea-input {
  resize: vertical;
  min-height: 80px;
}

.btn-submit {
  background: linear-gradient(135deg, #FFB6C1 0%, #FF8DA1 100%);
  border: none;
  color: var(--color-dark-plum);
  font-weight: 700;
  padding: 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #FFA0B0 0%, #FF69B4 100%);
  color: white;
  transform: translateY(-1px);
}

/* Custom Cards List Manager */
.custom-list-header {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 0.5rem;
}

.custom-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Custom scrollbar for list */
.custom-cards-container::-webkit-scrollbar {
  width: 4px;
}
.custom-cards-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
.custom-cards-container::-webkit-scrollbar-thumb {
  background: rgba(255, 105, 180, 0.2);
  border-radius: 10px;
}

.custom-card-item {
  background: var(--glass-bg);
  border: var(--glass-border);
  padding: 0.9rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.custom-item-content {
  flex-grow: 1;
}

.custom-item-text {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.custom-item-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-rose-gold);
}

.btn-delete {
  background: none;
  border: none;
  color: #c94c4c;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  transition: var(--transition-smooth);
  opacity: 0.7;
}

.btn-delete:hover {
  opacity: 1;
  transform: scale(1.1);
}

.empty-custom-state {
  text-align: center;
  padding: 2rem 0;
  color: var(--color-rose-gold);
  font-size: 0.85rem;
  font-style: italic;
}

/* --- SETTINGS DRAWER / OVERLAYS --- */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Styled switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.08);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: var(--color-accent-pink);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Footer & Decorative elements */
footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.75rem;
  color: var(--color-rose-gold);
  letter-spacing: 0.5px;
  margin-top: auto;
}

/* Media Queries for small screens */
@media (max-width: 360px) {
  .app-wrapper {
    padding: 1rem;
  }
  .card-container {
    height: 360px;
  }
  .card-text {
    font-size: 1.15rem;
  }
  .brand-logo {
    font-size: 1.8rem;
  }
  .dice-container {
    gap: 1.5rem;
  }
  .scene {
    width: 90px;
    height: 90px;
  }
  .dice-face {
    width: 90px;
    height: 90px;
  }
  .face-1 { transform: rotateY(0deg) translateZ(45px); }
  .face-2 { transform: rotateY(90deg) translateZ(45px); }
  .face-3 { transform: rotateY(180deg) translateZ(45px); }
  .face-4 { transform: rotateY(-90deg) translateZ(45px); }
  .face-5 { transform: rotateX(90deg) translateZ(45px); }
  .face-6 { transform: rotateX(-90deg) translateZ(45px); }
}

.header-top-bar {
  position: absolute;
  top: calc(2.2rem + env(safe-area-inset-top));
  right: 1.5rem;
  z-index: 100;
}

.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 3px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  z-index: 10;
}

.lang-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--color-rose-gold);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
  background: var(--color-accent-pink);
  color: white;
  box-shadow: 0 2px 6px rgba(255, 20, 147, 0.25);
}

/* Visibility based on body class */
body.lang-vi .lang-en-only {
  display: none !important;
}
body.lang-vi .lang-vi-only {
  display: block !important;
}

body.lang-en .lang-vi-only {
  display: none !important;
}
body.lang-en .lang-en-only {
  display: block !important;
}

/* --- Color Themes --- */
/* Sakura Pink (Default) */
body.theme-sakura {
  --bg-gradient: linear-gradient(135deg, #FFF5F7 0%, #FFEBEF 50%, #F5E6FA 100%);
  --color-primary: #FFB6C1;
  --color-secondary: #FFC0CB;
  --color-dark-plum: #4A0E17;
  --color-rose-gold: #8C4E57; /* Darker rose-gold for legible contrast */
  --color-accent-pink: #E63980; /* Darker pink for clear action buttons */
  --color-soft-lavender: #E8D7F1;
  --color-spicy-red: #D11D44;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-border: rgba(255, 255, 255, 0.8);
  
  /* Level Specific Contrast Accent Colors */
  --level-1-color: #D35B78;
  --level-2-color: #B83A87;
  --level-3-color: #C22B62;
  --level-4-color: #D11D44;
  --level-5-color: #8C0E22;
}

/* Midnight Violet */
body.theme-midnight {
  --bg-gradient: linear-gradient(135deg, #090514 0%, #120A2B 50%, #20103A 100%);
  --color-primary: #8A2BE2;
  --color-secondary: #9B30FF;
  --color-dark-plum: #E6E6FA; /* Light text for dark background */
  --color-rose-gold: #DA70D6;
  --color-accent-pink: #FF00FF; /* Electric magenta */
  --color-soft-lavender: #3B2B5C;
  --color-spicy-red: #FF4500;
  --glass-bg: rgba(25, 15, 45, 0.55);
  --glass-bg-hover: rgba(35, 20, 65, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --input-bg: rgba(0, 0, 0, 0.35);
  --input-border: rgba(255, 255, 255, 0.15);

  /* Level Specific Contrast Accent Colors */
  --level-1-color: #FFB6C1;
  --level-2-color: #E299FF;
  --level-3-color: #FF8DA1;
  --level-4-color: #FF5E9D;
  --level-5-color: #FF4560;
}

/* Crimson Passion */
body.theme-crimson {
  --bg-gradient: linear-gradient(135deg, #1C0003 0%, #350007 50%, #5E000C 100%);
  --color-primary: #FF2E47;
  --color-secondary: #FF4C62;
  --color-dark-plum: #FFF0F2;
  --color-rose-gold: #FF7B88;
  --color-accent-pink: #FF1A40;
  --color-soft-lavender: #4A0C14;
  --color-spicy-red: #FF0000;
  --glass-bg: rgba(45, 10, 15, 0.55);
  --glass-bg-hover: rgba(65, 15, 22, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --input-bg: rgba(0, 0, 0, 0.35);
  --input-border: rgba(255, 255, 255, 0.15);

  /* Level Specific Contrast Accent Colors */
  --level-1-color: #FFAEC1;
  --level-2-color: #FF8EAB;
  --level-3-color: #FF7B88;
  --level-4-color: #FF4C62;
  --level-5-color: #FF2E47;
}

/* Rose Gold Luxury */
body.theme-rosegold {
  --bg-gradient: linear-gradient(135deg, #FAF0E6 0%, #F3E5D8 50%, #E8D3C3 100%);
  --color-primary: #E6C2B3;
  --color-secondary: #ECD8D0;
  --color-dark-plum: #432C24;
  --color-rose-gold: #7E454D; /* Darker gold-brown for high contrast */
  --color-accent-pink: #995A40; /* Dark copper for buttons */
  --color-soft-lavender: #F5EFEB;
  --color-spicy-red: #C2185B;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-border: rgba(255, 255, 255, 0.8);

  /* Level Specific Contrast Accent Colors */
  --level-1-color: #8C523B;
  --level-2-color: #9C5747;
  --level-3-color: #7E3E47;
  --level-4-color: #A34E36;
  --level-5-color: #5C1E26;
}

/* Transition for smooth theme switching */
body {
  transition: background 0.5s ease, color 0.5s ease;
}

.glass-panel, .btn-menu, .btn-action, .input-text, .textarea-input, .deck-item {
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease, color 0.4s ease;
}

/* --- SVG Countdown Timer Ring --- */
.timer-container {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  z-index: 5;
  display: none; /* Controlled by JS */
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* Start from top */
}

.timer-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.05);
  stroke-width: 3.5;
}

body.theme-midnight .timer-bg, body.theme-crimson .timer-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.timer-progress {
  fill: none;
  stroke: var(--color-accent-pink);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  transition: stroke-dasharray 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--color-dark-plum);
}

/* --- Bookmark Star Button --- */
.btn-bookmark {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-rose-gold);
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 50%;
}

.btn-bookmark:hover {
  transform: scale(1.15);
  color: var(--color-accent-pink);
  background: rgba(255, 255, 255, 0.15);
}

.btn-bookmark.active {
  color: #FFD700; /* Gold */
  fill: #FFD700;
}

/* --- Favorites Gallery Section --- */
.favorites-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 0.75rem;
  padding-right: 0.25rem;
}

.favorites-container::-webkit-scrollbar {
  width: 4px;
}

.favorites-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}

.favorites-container::-webkit-scrollbar-thumb {
  background: rgba(255, 105, 180, 0.2);
  border-radius: 10px;
}

.favorite-card-item {
  background: var(--glass-bg);
  border: var(--glass-border);
  padding: 0.9rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.favorite-card-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--color-dark-plum);
  flex-grow: 1;
}

.btn-unfavorite {
  background: none;
  border: none;
  color: #FFD700;
  fill: #FFD700;
  cursor: pointer;
  transition: var(--transition-smooth);
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.btn-unfavorite:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* --- Dice Customization Panel --- */
.dice-custom-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  animation: slideDown 0.4s ease;
}

.dice-custom-panel.active {
  display: flex;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dice-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dice-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dice-input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-rose-gold);
  text-transform: uppercase;
}

.dice-input-group input {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

/* --- Premium SVG Icons --- */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2.25px;
  color: currentColor;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.icon-svg-heart {
  display: inline-block;
  vertical-align: middle;
  transition: var(--transition-smooth);
  filter: drop-shadow(0 4px 8px rgba(244, 63, 94, 0.25));
}
.icon-svg-menu {
  color: var(--color-rose-gold);
  transition: var(--transition-smooth);
  margin-bottom: 0.5rem;
}
.btn-menu:hover .icon-svg-menu {
  color: var(--color-accent-pink);
  transform: scale(1.1) rotate(5deg);
}
.icon-svg-nav {
  margin-right: 0.35rem;
  vertical-align: -2.5px;
  color: var(--color-rose-gold);
  transition: var(--transition-smooth);
}
.brand-subtitle:hover .icon-svg-nav {
  color: var(--color-accent-pink);
  transform: scale(1.1);
}
.icon-svg-choice {
  margin-right: 0.5rem;
  vertical-align: -3px;
}

/* Theme Adaptations for Premium Dice Faces */
body.theme-midnight .action-dice .dice-face {
  background: rgba(25, 15, 45, 0.9);
  color: #FF00FF;
  border-color: rgba(255, 0, 255, 0.4);
  box-shadow: inset 0 0 20px rgba(255, 0, 255, 0.3), 0 8px 25px rgba(0, 0, 0, 0.4);
}
body.theme-midnight .body-dice .dice-face {
  background: rgba(18, 10, 35, 0.9);
  color: #9B30FF;
  border-color: rgba(155, 48, 255, 0.4);
  box-shadow: inset 0 0 20px rgba(155, 48, 255, 0.3), 0 8px 25px rgba(0, 0, 0, 0.4);
}
body.theme-crimson .action-dice .dice-face {
  background: rgba(45, 10, 15, 0.9);
  color: #FF2E47;
  border-color: rgba(255, 46, 71, 0.4);
  box-shadow: inset 0 0 20px rgba(255, 46, 71, 0.3), 0 8px 25px rgba(0, 0, 0, 0.4);
}
body.theme-crimson .body-dice .dice-face {
  background: rgba(30, 5, 8, 0.9);
  color: #FF7B88;
  border-color: rgba(255, 123, 136, 0.4);
  box-shadow: inset 0 0 20px rgba(255, 123, 136, 0.3), 0 8px 25px rgba(0, 0, 0, 0.4);
}
body.theme-rosegold .action-dice .dice-face {
  background: rgba(250, 240, 230, 0.9);
  color: #B76E79;
  border-color: rgba(183, 110, 121, 0.4);
  box-shadow: inset 0 0 20px rgba(183, 110, 121, 0.3), 0 8px 25px rgba(0, 0, 0, 0.05);
}
body.theme-rosegold .body-dice .dice-face {
  background: rgba(243, 229, 216, 0.9);
  color: #C58B74;
  border-color: rgba(197, 139, 116, 0.4);
  box-shadow: inset 0 0 20px rgba(197, 139, 116, 0.3), 0 8px 25px rgba(0, 0, 0, 0.05);
}

/* Level Icon & Text Adapters */
.deck-item[data-deck="icebreaker"] .deck-icon-wrapper {
  background: rgba(255, 182, 193, 0.15);
  color: var(--level-1-color);
}
.deck-item[data-deck="icebreaker"] .deck-name {
  color: var(--level-1-color);
}

.deck-item[data-deck="deep"] .deck-icon-wrapper {
  background: rgba(255, 105, 180, 0.15);
  color: var(--level-2-color);
}
.deck-item[data-deck="deep"] .deck-name {
  color: var(--level-2-color);
}

.deck-item[data-deck="intimacy"] .deck-icon-wrapper {
  background: rgba(219, 112, 147, 0.15);
  color: var(--level-3-color);
}
.deck-item[data-deck="intimacy"] .deck-name {
  color: var(--level-3-color);
}

.deck-item[data-deck="foreplay"] .deck-icon-wrapper {
  background: rgba(220, 20, 60, 0.15);
  color: var(--level-4-color);
}
.deck-item[data-deck="foreplay"] .deck-name {
  color: var(--level-4-color);
}

.deck-item[data-deck="climax"] .deck-icon-wrapper {
  background: rgba(139, 0, 0, 0.2);
  color: var(--level-5-color);
}
.deck-item[data-deck="climax"] .deck-name {
  color: var(--level-5-color);
}

/* --- App Splash Screen --- */
.app-splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.app-splash-screen.fade-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.splash-logo-container {
  margin-bottom: 0.5rem;
}

.splash-heart-svg {
  color: var(--color-accent-pink);
  filter: drop-shadow(0 0 15px rgba(230, 57, 128, 0.45));
  animation: splashHeartBeat 2s infinite ease-in-out;
}

body.theme-midnight .splash-heart-svg {
  filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.6));
}

body.theme-crimson .splash-heart-svg {
  filter: drop-shadow(0 0 20px rgba(255, 46, 71, 0.6));
}

.heart-path-1 {
  stroke: var(--color-accent-pink);
}

.heart-path-2 {
  color: var(--color-primary);
  opacity: 0.85;
}

.splash-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-dark-plum);
  letter-spacing: 2px;
  margin-bottom: 0.15rem;
  animation: splashTextFade 1.2s ease-out;
}

.splash-title span {
  color: var(--color-accent-pink);
}

.splash-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-rose-gold);
  font-weight: 500;
  margin-bottom: 1.5rem;
  animation: splashTextFade 1.5s ease-out;
}

.splash-loader {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.loader-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-accent-pink);
  border-radius: 50%;
  opacity: 0.3;
  animation: splashDotPulse 1.4s infinite ease-in-out both;
}

.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes splashHeartBeat {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(230, 57, 128, 0.35)); }
  14% { transform: scale(1.12); filter: drop-shadow(0 0 25px rgba(230, 57, 128, 0.65)); }
  28% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(230, 57, 128, 0.35)); }
  42% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(230, 57, 128, 0.55)); }
  70% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(230, 57, 128, 0.35)); }
}

@keyframes splashTextFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splashDotPulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.2; }
  40% { transform: scale(1); opacity: 1; }
}


