/* ==========================================================================
   LOVE WORD BATTLE — SIMPLE, CUTE & COZY PASTEL DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Cute Pastel Palette */
  --bg-main: #fff0f5;
  --bg-gradient: radial-gradient(circle at 50% 15%, #ffe6ee 0%, #fff0f5 55%, #fcecf4 100%);

  --card-bg: #ffffff;
  --card-border: #ffdbe6;
  --card-shadow: 0 10px 28px rgba(255, 120, 160, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);

  --primary-pink: #ff5e83;
  --primary-hover: #ff4772;
  --primary-shadow: 0 5px 0 #d93d62;

  --secondary-soft: #ffe5ec;
  --secondary-text: #c93b62;

  --accent-peach: #ff9a8b;
  --accent-lavender: #b388ff;
  --accent-gold: #ffb703;
  --accent-mint: #2ec4b6;

  --text-title: #4a2835;
  --text-body: #6e4b5a;
  --text-muted: #a38290;
  --text-light: #ffffff;

  --font-cute: 'Fredoka', cursive, sans-serif;
  --font-main: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 9999px;
}

/* Base Reset & Mobile Scale Lock */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  color: var(--text-body);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

/* Force 16px minimum on all inputs to prevent iOS Safari auto-zoom/scaling */
input, select, textarea {
  font-size: 16px !important;
  touch-action: manipulation;
}

button, .btn, .kb-key, .round-pill, .avatar-option, .react-btn, .icon-pill-btn, .tile {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Animated Canvas (Soft floating pastel hearts & bubbles) */
#love-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Live Floating Reactions */
.reactions-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.floating-react {
  position: absolute;
  bottom: 80px;
  font-size: 2.4rem;
  filter: drop-shadow(0 4px 10px rgba(255, 94, 131, 0.4));
  animation: cuteFloat 3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes cuteFloat {
  0% { transform: translateY(0) scale(0.6) rotate(0deg); opacity: 0; }
  15% { transform: translateY(-30px) scale(1.2) rotate(6deg); opacity: 1; }
  50% { transform: translateY(-200px) scale(1.05) rotate(-6deg); }
  100% { transform: translateY(-460px) scale(0.85) rotate(10deg); opacity: 0; }
}

/* Sound Button (Integrated, Non-Fixed) */
.sound-btn {
  background: #ffffff;
  border: 2px solid var(--card-border);
  color: var(--text-title);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 150, 180, 0.12);
  transition: all 0.2s ease;
}

.sound-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-pink);
  box-shadow: 0 4px 10px rgba(255, 94, 131, 0.2);
}

.brand-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

/* Main Container */
.app-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 580px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
}

/* Simple Cute Marshmallow Card */
.glass-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 28px 22px;
  transition: transform 0.2s ease;
}

/* Screen Transitions */
.game-screen {
  display: none;
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition: opacity 0.25s ease, transform 0.25s ease;
  width: 100%;
}

.game-screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   1. HOME SCREEN (Simple & Cute)
   ========================================================================= */

.welcome-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.heart-pulse-icon {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  background: #ffe6ef;
  border-radius: 50%;
  margin-bottom: 6px;
}

.heart-main {
  font-size: 2.6rem;
  animation: cuteBounce 1.5s infinite ease-in-out;
  display: inline-block;
}

.heart-echo {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 94, 131, 0.25);
  animation: echoRing 1.5s infinite ease-out;
}

@keyframes cuteBounce {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.18); }
  40% { transform: scale(1.05); }
}

@keyframes echoRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.game-title {
  font-family: var(--font-cute);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: -0.5px;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Profile Form */
.profile-setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.form-label {
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-title);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.2rem;
  pointer-events: none;
}

.input-group input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-title);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  transition: all 0.2s ease;
}

.input-group input:focus {
  border-color: var(--primary-pink);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 94, 131, 0.15);
}

.input-group input::placeholder {
  color: #c9afba;
  font-weight: 500;
}

/* Cute Avatar Picker */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
}

.avatar-option {
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 1.4rem;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-option:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: var(--primary-pink);
  background: #ffeef3;
}

.avatar-option.selected {
  background: #ffe8ef;
  border-color: var(--primary-pink);
  box-shadow: 0 4px 10px rgba(255, 94, 131, 0.25);
  transform: scale(1.12);
}

/* Cute Bubbly Tabs */
.action-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff0f5;
  border-radius: var(--radius-pill);
  padding: 5px;
  border: 2px solid var(--card-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-cute);
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary-pink);
  box-shadow: 0 3px 8px rgba(255, 120, 160, 0.2);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

/* Match Length Pills */
.rounds-selector-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.rounds-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.round-pill {
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-family: var(--font-cute);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.round-pill .pill-lvl {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.2;
}

.round-pill .pill-cnt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.round-pill:hover {
  background: #ffeef3;
  border-color: var(--primary-pink);
}

.round-pill.active {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(255, 94, 131, 0.3);
}

.round-pill.active .pill-lvl,
.round-pill.active .pill-cnt {
  color: #ffffff;
}

/* Category Selector Box */
.category-selector-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.category-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  background-color: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-title);
  font-family: var(--font-cute);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5e83' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.form-select:focus {
  border-color: var(--primary-pink);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 94, 131, 0.15);
}

/* Lobby Category Banner */
.lobby-category-banner {
  background: #fff5f8;
  border: 2px dashed #ffccd9;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cat-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.cat-banner-text {
  display: flex;
  flex-direction: column;
}

.cat-banner-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.cat-banner-val {
  font-family: var(--font-cute);
  font-weight: 700;
  color: var(--primary-pink);
  font-size: 0.96rem;
}

.form-select-sm {
  background-color: #ffffff;
  border: 2px solid var(--primary-pink);
  border-radius: var(--radius-pill);
  padding: 6px 28px 6px 12px;
  font-family: var(--font-cute);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-pink);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5e83' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
  transition: all 0.2s ease;
}

.form-select-sm:focus {
  box-shadow: 0 0 0 3px rgba(255, 94, 131, 0.2);
}

/* Bubbly Satisfying Buttons */
.btn {
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--primary-pink);
  color: #ffffff;
  box-shadow: var(--primary-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #d93d62;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #d93d62;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 3px 0 #d93d62;
}

.btn-secondary {
  background: #ff7597;
  color: #ffffff;
  box-shadow: 0 5px 0 #d94970;
}

.btn-secondary:hover {
  background: #ff5e83;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #d94970;
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #d94970;
}

.btn-subtle {
  background: #fff0f5;
  border: 2px solid var(--card-border);
  color: var(--primary-pink);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-subtle:hover {
  background: #ffe2eb;
  border-color: var(--primary-pink);
  transform: translateY(-1px);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.btn-text:hover {
  color: var(--primary-pink);
}

/* How to Play Accordion */
.how-to-play-box {
  margin-top: 4px;
  border-top: 2px dashed #ffe6ef;
  padding-top: 12px;
}

.how-to-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.how-to-content {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.how-to-content.hidden {
  display: none;
}

.how-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-body);
}

.step-num {
  background: #ffe6ef;
  color: var(--primary-pink);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ==========================================================================
   2. LOBBY SCREEN (Clean & Cute)
   ========================================================================== */

.lobby-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.badge-pill {
  background: #ffe6ef;
  color: var(--primary-pink);
  border: 1px solid #ffd1df;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 4px;
}

.lobby-title {
  font-family: var(--font-cute);
  font-size: 1.85rem;
  color: var(--text-title);
}

.room-share-card {
  background: #fff8fa;
  border: 2px dashed #ffccd9;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.share-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.room-code-badge {
  font-family: var(--font-cute);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-pink);
  background: #ffffff;
  padding: 8px 24px;
  border-radius: var(--radius-md);
  border: 2px solid #ffd6e3;
  box-shadow: 0 4px 12px rgba(255, 120, 160, 0.12);
}

.share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.copy-status-msg {
  font-family: var(--font-cute);
  font-size: 0.9rem;
  font-weight: 600;
  color: #2bb673;
  min-height: 1.2rem;
}

/* Two Lovers Connection Pods */
.couples-pod {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}

.player-slot {
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.player-slot.connected {
  border-color: var(--primary-pink);
  background: #fff2f6;
  box-shadow: 0 6px 16px rgba(255, 94, 131, 0.15);
}

.player-slot.waiting {
  border-style: dashed;
  background: #ffffff;
  opacity: 0.8;
}

.avatar-ring {
  position: relative;
}

.slot-avatar {
  font-size: 2.5rem;
  display: block;
}

.slot-badge {
  position: absolute;
  bottom: -4px;
  right: -8px;
  background: var(--primary-pink);
  color: #ffffff;
  font-family: var(--font-cute);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.slot-name {
  font-family: var(--font-cute);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.slot-status {
  font-family: var(--font-cute);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.slot-status.ready {
  background: #e6f9f0;
  color: #1bb55c;
}

.slot-status.waiting {
  background: #fff2db;
  color: #e59800;
}

.heart-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bridge-heart {
  font-size: 2rem;
  animation: cuteBounce 1.8s infinite ease-in-out;
}

.bridge-dots {
  display: flex;
  gap: 4px;
}

.bridge-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-pink);
  animation: dotPulse 1.2s infinite ease-in-out;
}

.bridge-dots span:nth-child(2) { animation-delay: 0.2s; }
.bridge-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Custom word accordion */
.custom-word-wrapper {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  background: #fffcfd;
}

.custom-word-toggle {
  background: transparent;
  border: none;
  color: var(--primary-pink);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.custom-word-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-word-form.hidden {
  display: none;
}

.custom-hint-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lobby-action-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wait-hint {
  font-family: var(--font-cute);
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   3. IN-GAME ARENA (Simple, Clean & Adorable)
   ========================================================================== */

.arena-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Game Top Bar */
.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  width: 100%;
}

.bar-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.bar-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.bar-room-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-quit-mini {
  background: #fff0f3;
  border: 1px solid #ffd1dc;
  color: #e63946;
  font-family: var(--font-cute);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.btn-quit-mini:hover {
  background: #ffe3e8;
  border-color: #e63946;
  transform: translateY(-1px);
}

.bar-right {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.bar-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-actions-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.round-indicator {
  background: #ffffff;
  border: 2px solid var(--card-border);
  color: var(--primary-pink);
  font-family: var(--font-cute);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(255, 120, 160, 0.1);
  white-space: nowrap;
}

/* Round Difficulty Badges */
.difficulty-badge {
  font-family: var(--font-cute);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.difficulty-badge.medium {
  background: #e0f2fe;
  color: #0284c7;
  border: 2px solid #bae6fd;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.difficulty-badge.hard {
  background: #ffedd5;
  color: #ea580c;
  border: 2px solid #fed7aa;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.15);
}

.difficulty-badge.final-round {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #ffffff;
  border: 2px solid #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5), 0 3px 8px rgba(239, 68, 68, 0.3);
  animation: finalBadgePulse 1.8s infinite ease-in-out;
}

@keyframes finalBadgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4), 0 3px 6px rgba(239, 68, 68, 0.25);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.7), 0 4px 12px rgba(239, 68, 68, 0.45);
  }
}

.room-pill-mini {
  background: #ffe6ef;
  color: var(--text-title);
  font-family: var(--font-cute);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.chat-trigger {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--card-border);
  color: var(--text-title);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 120, 160, 0.1);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--primary-pink);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-pink);
  color: #ffffff;
  font-family: var(--font-cute);
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.chat-badge.hidden {
  display: none;
}

/* Turn Status Banner */
.turn-banner {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.turn-banner.my-turn {
  background: linear-gradient(135deg, #fff5f8 0%, #ffe9f2 100%);
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(255, 94, 131, 0.25), 0 8px 24px rgba(255, 94, 131, 0.18);
  animation: turnBannerPulse 2.4s infinite ease-in-out;
}

@keyframes turnBannerPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 94, 131, 0.2), 0 6px 18px rgba(255, 94, 131, 0.14);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 94, 131, 0.38), 0 10px 28px rgba(255, 94, 131, 0.24);
  }
}

.turn-banner.partner-turn {
  background: #ffffff;
  border-color: var(--card-border);
  opacity: 0.9;
}

.turn-banner.final-round {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3), 0 8px 24px rgba(245, 158, 11, 0.2);
  animation: finalTurnPulse 2s infinite ease-in-out;
}

@keyframes finalTurnPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), 0 6px 18px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.45), 0 10px 28px rgba(239, 68, 68, 0.25);
  }
}

.turn-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.turn-avatar {
  font-size: 2.2rem;
  display: inline-block;
  animation: cuteBounce 2s infinite ease-in-out;
}

.turn-main-text {
  font-family: var(--font-cute);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-title);
}

.turn-sub-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Timer Circle */
.turn-timer-box {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: #ffe0eb;
  stroke-width: 4;
}

.timer-progress {
  fill: none;
  stroke: var(--primary-pink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100.5;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
}

.turn-timer-box.hurry .timer-progress {
  stroke: #ff3344;
}

.timer-seconds {
  position: absolute;
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-title);
}

/* Dual Scoreboard Header */
.dual-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.score-card {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(255, 120, 160, 0.08);
  transition: all 0.25s ease;
}

.score-card.active-turn {
  border-color: var(--primary-pink);
  background: linear-gradient(135deg, #ffffff 0%, #fff2f6 100%);
  transform: scale(1.04);
  box-shadow: 0 0 0 2px rgba(255, 94, 131, 0.3), 0 8px 20px rgba(255, 94, 131, 0.18);
}

.score-avatar-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-avatar {
  font-size: 1.8rem;
}

.score-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.score-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-name {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
}

.round-win-stars {
  font-size: 0.8rem;
}

.score-points {
  font-family: var(--font-cute);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-pink);
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.round-pts-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  letter-spacing: 0.2px;
  display: inline-block;
  white-space: nowrap;
  transition: all 0.25s ease;
}

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

.versus-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 0.85rem;
  color: #ff85a1;
  gap: 2px;
}

.vs-heart {
  font-size: 1.1rem;
}

/* Clue & Hint Card */
.hint-card {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(255, 120, 160, 0.08);
}

.category-badge {
  background: #fff0f5;
  color: var(--primary-pink);
  border: 1px solid #ffd1df;
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.8rem;
  font-weight: 600;
}

.hint-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.4;
}

/* Word Stage (Soft rounded letter tiles) */
.word-stage {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--card-shadow);
}

.word-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tile {
  width: 46px;
  height: 54px;
  background: #fff8fa;
  border: 2px solid #ffd6e3;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cute);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-title);
  text-transform: uppercase;
  box-shadow: 0 4px 0 #ffd6e3;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile.revealed {
  background: #ffe8ef;
  border-color: var(--primary-pink);
  color: var(--primary-pink);
  box-shadow: 0 4px 0 #d93d62;
  transform: translateY(-2px) scale(1.05);
  animation: tilePop 0.3s ease;
}

@keyframes tilePop {
  0% { transform: scale(0.7); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1.05); }
}

.tile.space {
  width: 18px;
  height: 54px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Modern Chances Meter Card (30 Chances Health Gauge) */
.chances-meter-card {
  width: 100%;
  background: #ffffff;
  border: 2px solid #ffd6e3;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(255, 120, 160, 0.08);
  transition: all 0.3s ease;
}

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

.chances-title {
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chances-badge {
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-pink);
  background: #fff0f5;
  border: 1.5px solid #ffd1df;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}

.chances-badge strong {
  font-size: 1.15rem;
}

.chances-bar-track {
  width: 100%;
  height: 14px;
  background: #f3e8ee;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 180, 200, 0.3);
}

.chances-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #2ec4b6, #2bb673);
  box-shadow: 0 0 10px rgba(46, 196, 182, 0.4);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  position: relative;
}

.chances-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 20px;
}

/* 30 Mini Heart Grid */
.heart-lives {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
  justify-items: center;
  align-items: center;
  padding-top: 4px;
}

@media (max-width: 480px) {
  .heart-lives {
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
  }
}

.life-heart {
  font-size: 0.88rem;
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  cursor: default;
  user-select: none;
}

.life-heart:hover {
  transform: scale(1.25);
}

.life-heart.broken {
  filter: grayscale(1);
  opacity: 0.22;
  transform: scale(0.72);
}

/* Live Action Ticker */
.live-action-ticker {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-cute);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-pink);
}

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-pink);
  animation: dotPulse 1s infinite alternate;
}

/* Virtual Keyboard (Bubbly Marshmallow Keys) */
.keyboard-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.kb-key {
  flex: 1;
  max-width: 52px;
  height: 48px;
  background: #ffffff;
  border: 2px solid #ffd6e3;
  border-radius: var(--radius-sm);
  color: var(--text-title);
  font-family: var(--font-cute);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #ffd6e3;
  transition: all 0.12s ease;
  user-select: none;
}

.kb-key:hover:not(:disabled) {
  background: #fff0f5;
  border-color: var(--primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #ffd6e3;
}

.kb-key:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ffd6e3;
}

.kb-key:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.kb-key.hit {
  background: #e6f9f0 !important;
  border-color: #2bb673 !important;
  color: #1bb55c !important;
  box-shadow: 0 2px 0 #2bb673 !important;
  opacity: 0.95;
}

.kb-key.miss {
  background: #fff0f2 !important;
  border-color: #ffccd3 !important;
  color: #ff99a8 !important;
  text-decoration: line-through;
  box-shadow: none !important;
  opacity: 0.4;
}

/* Solve Full Word */
.solve-word-row {
  display: flex;
  width: 100%;
}

.solve-input-wrap {
  display: flex;
  width: 100%;
  gap: 8px;
}

.solve-input-wrap input {
  flex: 1;
  padding: 10px 16px;
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-pill);
  color: var(--text-title);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
}

.solve-input-wrap input:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(255, 94, 131, 0.15);
}

.btn-solve {
  background: #ff5e83;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #d93d62;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-solve:hover {
  background: #ff4772;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #d93d62;
}

.btn-solve:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #d93d62;
}

/* Cute Floating Reactions Bar */
.reactions-bar {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(255, 120, 160, 0.08);
}

.reactions-title {
  font-family: var(--font-cute);
  font-size: 0.85rem;
  color: var(--primary-pink);
  font-weight: 700;
}

.reactions-list {
  display: flex;
  gap: 8px;
}

.react-btn {
  background: #fff4f7;
  border: none;
  font-size: 1.4rem;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.react-btn:hover {
  transform: scale(1.3) translateY(-3px);
  background: #ffe3ec;
}

.react-btn:active {
  transform: scale(0.9);
}

/* ==========================================================================
   MODALS (Cute Marshmallow Popups)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(74, 40, 53, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(74, 40, 53, 0.2);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  position: relative;
  animation: cutePopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cutePopIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-row h3 {
  font-family: var(--font-cute);
  font-size: 1.3rem;
  color: var(--text-title);
}

.modal-close {
  background: #fff0f5;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  background: #ffe0eb;
  color: var(--primary-pink);
}

/* Chat Messages */
.chat-messages {
  max-height: 220px;
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  margin-bottom: 12px;
  background: #fff8fa;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.chat-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: var(--primary-pink);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-title);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.system {
  align-self: center;
  background: #fff3db;
  color: #b37400;
  font-size: 0.85rem;
  text-align: center;
}

.chat-sender-tag {
  font-size: 0.75rem;
  opacity: 0.85;
}

.chat-time-tag {
  font-size: 0.65rem;
  opacity: 0.75;
  align-self: flex-end;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-pill);
  color: var(--text-title);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.btn-send-chat {
  background: var(--primary-pink);
  border: none;
  color: #ffffff;
  font-family: var(--font-cute);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 #d93d62;
}

/* Result Modal */
.result-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.result-badge {
  background: #e6f9f0;
  color: #1bb55c;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
}

.result-title {
  font-family: var(--font-cute);
  font-size: 1.8rem;
  color: var(--text-title);
}

.revealed-word-box {
  background: #fff2f6;
  border: 2px solid var(--primary-pink);
  border-radius: var(--radius-md);
  padding: 10px 24px;
  margin: 4px 0;
}

.revealed-word {
  font-family: var(--font-cute);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--primary-pink);
}

.result-desc {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Victory / Game Over Modal */
.victory-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.crown-icon {
  font-size: 3.2rem;
  animation: cuteBounce 2s infinite ease-in-out;
}

.victory-headline {
  font-family: var(--font-cute);
  font-size: 2.1rem;
  color: var(--primary-pink);
}

.winner-trophy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.trophy-avatar {
  font-size: 3.2rem;
}

.trophy-name {
  font-family: var(--font-cute);
  font-size: 1.5rem;
  color: var(--text-title);
}

.love-vow-message {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-pink);
  line-height: 1.4;
  padding: 0 10px;
}

.final-score-recap {
  background: #fff8fa;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  margin-top: 4px;
}

.recap-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.recap-name {
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.recap-score {
  font-family: var(--font-cute);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-pink);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border: 2px solid var(--primary-pink);
  color: var(--text-title);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(255, 94, 131, 0.25);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.75s forwards;
  pointer-events: auto;
}

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

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

/* ==========================================================================
   RESPONSIVE DESIGN (Cute on Phones)
   ========================================================================== */

@media (max-width: 520px) {
  .app-wrapper {
    padding: 12px;
  }

  .game-title {
    font-size: 1.9rem;
  }

  .kb-key {
    height: 44px;
    font-size: 1.1rem;
    max-width: 36px;
  }

  .tile {
    width: 36px;
    height: 46px;
    font-size: 1.4rem;
  }

  .dual-scoreboard {
    gap: 6px;
  }

  .score-card {
    padding: 8px 10px;
    gap: 8px;
  }

  .score-avatar {
    font-size: 1.4rem;
  }

  .score-name {
    max-width: 65px;
    font-size: 0.95rem;
  }

  .score-points {
    font-size: 1.1rem;
  }

  .turn-banner {
    padding: 8px 12px;
  }

  .turn-main-text {
    font-size: 1.1rem;
  }

  .turn-sub-text {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   VOICE CALLING & ROUND SCORES STYLES
   ========================================================================== */

/* Voice Call Trigger Button in Top Bar */
.voice-trigger {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--card-border);
  color: var(--text-title);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 120, 160, 0.1);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.voice-trigger:hover {
  transform: translateY(-2px);
  border-color: #10b981;
  color: #10b981;
}

.voice-trigger.calling {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
  animation: callPulse 1.4s infinite ease-in-out;
}

.voice-trigger.in-call {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #059669;
  color: #ffffff;
}

@keyframes callPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Active Voice Call Docked Bar */
.active-call-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s ease;
}

.active-call-bar.hidden {
  display: none;
}

.call-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cute);
  font-size: 0.92rem;
  font-weight: 700;
}

.call-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: liveDotPulse 1.4s infinite ease-in-out;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.call-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-call-action {
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-family: var(--font-cute);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-call-action.mic-toggle {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-call-action.mic-toggle:hover {
  background: rgba(255, 255, 255, 0.32);
}

.btn-call-action.mic-toggle.muted {
  background: #f59e0b;
  color: #ffffff;
}

.btn-call-action.hangup {
  background: #ef4444;
  color: #ffffff;
}

.btn-call-action.hangup:hover {
  background: #dc2626;
  transform: scale(1.04);
}

/* Incoming Call Toast / Modal */
.incoming-call-modal {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  animation: slideDownToast 0.35s ease;
}

.incoming-call-modal.hidden {
  display: none;
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.incoming-call-card {
  background: #ffffff;
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 14px 22px;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.28);
  display: flex;
  align-items: center;
  gap: 16px;
}

.incoming-call-pulse {
  font-size: 2.2rem;
  animation: ringShake 0.9s infinite ease-in-out;
}

@keyframes ringShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-16deg); }
  75% { transform: rotate(16deg); }
}

.incoming-call-info h4 {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  color: var(--text-title);
  margin: 0 0 2px 0;
}

.incoming-call-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.incoming-call-actions {
  display: flex;
  gap: 8px;
}

.btn-call-action.accept {
  background: #10b981;
  color: #ffffff;
}

.btn-call-action.accept:hover {
  background: #059669;
}

.btn-call-action.decline {
  background: #f1f5f9;
  color: #64748b;
}

.btn-call-action.decline:hover {
  background: #e2e8f0;
}

/* Round Scores Breakdown in Modal */
.round-scores-breakdown {
  margin: 12px 0 6px 0;
  background: #fff8fa;
  border: 2px dashed #fbcfe8;
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
}

.breakdown-title {
  font-family: var(--font-cute);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 8px 0;
}

.breakdown-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.breakdown-player {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-title);
}

.breakdown-pts {
  color: #10b981;
  font-weight: 700;
}

/* ==========================================================================
   USER AUTHENTICATION, PROFILE & FRIENDS SYSTEM UI
   ========================================================================== */

/* Top User Nav Bar */
.user-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #ffd6e4;
}

.nav-auth-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}

.nav-auth-wrap.hidden {
  display: none !important;
}

.nav-pill-btn {
  background: #ffffff;
  border: 2px solid #ffd6e4;
  color: var(--text-title);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(255, 120, 160, 0.12);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-pill-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary-pink);
  box-shadow: 0 5px 12px rgba(255, 94, 131, 0.2);
}

.nav-pill-btn:active {
  transform: translateY(1px);
}

.nav-pill-btn.auth-trigger {
  background: linear-gradient(135deg, #ffffff 0%, #fff2f6 100%);
  color: var(--primary-pink);
}

.nav-pill-btn.friends-trigger {
  background: #ffffff;
  position: relative;
}

.badge-online-count {
  background: #10b981;
  color: #ffffff;
  font-size: 0.75rem;
  font-family: var(--font-main);
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.user-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff4f8;
  border: 2px solid #ffccd9;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.user-avatar-tag {
  font-size: 1.4rem;
}

.user-info-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name-tag {
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-title);
  line-height: 1.1;
}

.user-wins-tag {
  font-size: 0.72rem;
  color: #ff5e83;
  font-weight: 800;
}

.nav-pill-btn.logout-trigger {
  padding: 6px 10px;
  color: #94a3b8;
}

/* Auth Modal Cards & Forms */
.auth-modal-card {
  max-width: 440px;
}

.auth-tabs, .friends-tabs {
  display: flex;
  background: #fff0f5;
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
  margin-bottom: 16px;
}

.auth-tabs .tab-btn, .friends-tabs .tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tabs .tab-btn.active, .friends-tabs .tab-btn.active {
  background: #ffffff;
  color: var(--primary-pink);
  box-shadow: 0 3px 10px rgba(255, 94, 131, 0.15);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.auth-form.hidden {
  display: none !important;
}

.auth-error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 8px;
}

.auth-error-msg.hidden {
  display: none !important;
}

.auth-avatar-picker {
  margin-top: 4px;
}

/* Friends Modal Dialog */
.friends-modal-card {
  max-width: 460px;
}

.tab-badge {
  background: #ffd6e4;
  color: var(--text-title);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.tab-badge.hidden {
  display: none !important;
}

.friends-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friends-tab-panel.hidden {
  display: none !important;
}

.friends-list-container, .requests-list-container {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.friend-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #fff8fa;
  border: 1.5px solid #ffccd9;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.friend-item-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 120, 160, 0.12);
}

.friend-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.friend-avatar {
  font-size: 1.7rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 50%;
  border: 2px solid #ffd6e4;
}

.friend-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.friend-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-name {
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-title);
}

.friend-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.friend-status-pill.online {
  background: #d1fae5;
  color: #065f46;
}

.friend-status-pill.lobby {
  background: #fef3c7;
  color: #92400e;
}

.friend-status-pill.playing {
  background: #ede9fe;
  color: #5b21b6;
}

.friend-status-pill.offline {
  background: #f1f5f9;
  color: #64748b;
}

.friend-stats-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.friend-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-friend-action {
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-friend-action.invite {
  background: linear-gradient(135deg, #ff5e83 0%, #ff3b68 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(255, 94, 131, 0.28);
}

.btn-friend-action.invite:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 94, 131, 0.4);
}

.btn-friend-action.join {
  background: #10b981;
  color: #ffffff;
}

.btn-friend-action.accept {
  background: #10b981;
  color: #ffffff;
}

.btn-friend-action.decline {
  background: #f1f5f9;
  color: #64748b;
}

.btn-friend-action.remove {
  background: transparent;
  color: #cbd5e1;
  font-size: 1rem;
  padding: 4px 6px;
}

.btn-friend-action.remove:hover {
  color: #ef4444;
}

.empty-friends-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  gap: 8px;
  color: var(--text-muted);
}

.empty-friends-state .empty-icon {
  font-size: 2.2rem;
}

.empty-friends-state p {
  font-family: var(--font-cute);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Add Friend Box */
.search-friend-box {
  display: flex;
  gap: 8px;
}

.friend-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* Incoming Game Invite Modal / Toast */
.incoming-invite-modal {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  animation: slideDownToast 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 90%;
  max-width: 450px;
}

.incoming-invite-modal.hidden {
  display: none !important;
}

.incoming-invite-card {
  background: #ffffff;
  border: 2.5px solid #ff5e83;
  border-radius: 18px;
  padding: 14px 20px;
  box-shadow: 0 16px 36px rgba(255, 94, 131, 0.3);
  display: flex;
  align-items: center;
  gap: 14px;
}

.incoming-invite-pulse {
  font-size: 2.4rem;
  animation: cuteBounce 1.2s infinite ease-in-out;
}

.incoming-invite-info {
  flex: 1;
  text-align: left;
}

.incoming-invite-info h4 {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  color: var(--text-title);
  margin: 0 0 2px 0;
}

.incoming-invite-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}

.incoming-invite-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Lobby Invite Friend Button */
.lobby-invite-btn {
  background: linear-gradient(135deg, #fff0f5 0%, #ffe3ed 100%) !important;
  color: var(--primary-pink) !important;
  font-weight: 700 !important;
  border-color: #ffd6e4 !important;
}

.lobby-invite-btn:hover {
  background: linear-gradient(135deg, #ff5e83 0%, #ff3b68 100%) !important;
  color: #ffffff !important;
}
