/* Arcade Portal Design System & Layout stylesheet */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Outfit:wght@300;400;600;800&display=swap');

:root {
  /* Colors */
  --bg-main: #06070d;
  --bg-card: rgba(15, 18, 36, 0.65);
  --bg-card-hover: rgba(22, 26, 52, 0.85);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(168, 85, 247, 0.4);
  
  --primary: #a855f7;
  --primary-glow: rgba(168, 85, 247, 0.35);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.35);
  --pink: #ec4899;
  --pink-glow: rgba(236, 72, 153, 0.35);
  --gold: #eab308;
  --gold-glow: rgba(234, 179, 8, 0.35);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Fonts */
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* System */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  scrollbar-gutter: stable;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism Panel Utilities */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: var(--transition);
}

.glass-interactive:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 40px 0 var(--primary-glow);
  transform: translateY(-4px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
}

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

.btn-primary {
  background: var(--primary);
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}
.btn-primary:hover {
  background: #b56ff7;
  box-shadow: 0 6px 20px 0 var(--primary-glow);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: var(--accent);
  box-shadow: 0 4px 14px 0 var(--accent-glow);
}
.btn-accent:hover {
  background: #22d3ee;
  box-shadow: 0 6px 20px 0 var(--accent-glow);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: var(--pink);
  box-shadow: 0 4px 14px 0 var(--pink-glow);
}
.btn-danger:hover {
  background: #f472b6;
  box-shadow: 0 6px 20px 0 var(--pink-glow);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

/* App Container Layout */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  gap: 24px;
}

/* Header styling */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-shadow: 0 0 15px var(--primary-glow);
}

.logo span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Player Profile Card */
.player-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 8px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: var(--transition);
}
.player-profile-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.player-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Main Dashboard content */
main {
  flex-grow: 1;
  position: relative;
}

.screen {
  display: none;
  animation: fadeIn 0.4s ease-out;
  flex-direction: column;
  gap: 24px;
}

.screen.active {
  display: flex;
}

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

/* Lobby Screen */
.lobby-hero {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.lobby-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}

.lobby-hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.lobby-hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 500px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.game-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-card-banner {
  height: 160px;
  position: relative;
  overflow: hidden;
  background: #181b2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.game-card-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(6, 7, 13, 0.9));
}

.game-card-banner.flappy {
  background: linear-gradient(135deg, #1d2a44, #0c4a6e);
}
.game-card-banner.connect4 {
  background: linear-gradient(135deg, #2d1844, #4a044e);
}

.game-card-banner .glow-icon {
  filter: drop-shadow(0 0 15px var(--accent));
  transition: var(--transition);
}

.game-card:hover .glow-icon {
  transform: scale(1.1) rotate(5deg);
}

.game-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.game-card-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.game-card-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  flex-grow: 1;
}

.game-card-stats {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* Modals & Dialogs */
dialog {
  margin: auto;
  border: none;
  background: transparent;
  outline: none;
  z-index: 100;
}

dialog::backdrop {
  background: rgba(4, 5, 9, 0.8);
  backdrop-filter: blur(12px);
}

.modal-content {
  width: 90vw;
  max-width: 440px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Avatar color selector */
.color-picker {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.color-option.selected {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Game Interface Layouts */
.game-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* Back button header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.game-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-title-area h2 {
  font-size: 1.8rem;
  font-weight: 800;
}

/* FLAPPY BIRD STYLING */
.flappy-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
  max-width: 480px;
  width: 100%;
}

.canvas-container {
  position: relative;
  width: 100%;
  max-width: min(420px, calc((100dvh - 220px) * 9 / 16));
  aspect-ratio: 9/16;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.05);
  container-type: inline-size;
}

/* Compact overlay styles for small heights/widths via Container Queries */
@container (max-width: 360px) {
  .canvas-overlay {
    padding: 16px;
  }
  .overlay-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }
  .overlay-subtitle {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }
  .score-board {
    padding: 12px;
    margin-bottom: 16px;
    gap: 8px;
  }
  .score-val-large {
    font-size: 1.4rem;
  }
  .skins-row {
    gap: 8px;
    margin-top: 8px;
  }
  .skin-item {
    padding: 6px;
    max-width: 65px;
    gap: 4px;
  }
  .skin-preview {
    width: 22px;
    height: 22px;
  }
  .skin-label {
    font-size: 0.6rem;
  }
  #flappyStartPlayBtn, #flappyRestartBtn {
    margin-top: 12px !important;
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
  }
}


#flappyCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Flappy Canvas Overlay screens */
.canvas-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 13, 0.7);
  backdrop-filter: blur(8px);
  padding: 24px;
  text-align: center;
  z-index: 5;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}

.canvas-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.overlay-title.gameover {
  color: var(--pink);
  text-shadow: 0 0 20px var(--pink-glow);
}

.overlay-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.score-board {
  width: 100%;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.score-val-large {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

/* Skins tab in flappy */
.skins-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.skin-item {
  flex: 1;
  max-width: 80px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.skin-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.skin-item.selected {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 10px var(--primary-glow);
}

.skin-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.skin-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* CONNECT FOUR STYLING */
.c4-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .c4-layout {
    grid-template-columns: 1fr 340px;
  }
}

.c4-gameplay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Setup Panel options */
.c4-setup-panel {
  width: 100%;
  max-width: 580px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 580px) {
  .mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mode-card {
  padding: 24px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.mode-card.selected {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 15px var(--primary-glow);
}

.mode-icon {
  font-size: 2.2rem;
}

.mode-title {
  font-weight: 700;
  font-size: 1rem;
}

.mode-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Online setup screen */
.online-setup-area {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 12px;
}

.online-setup-area.active {
  display: flex;
}

.share-url-container {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 6px 6px 16px;
  align-items: center;
  width: 100%;
}

.share-url-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}

/* The Board */
.c4-board-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 7/6;
  padding: 12px;
}

/* Glass columns selector overlays */
.c4-columns-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  z-index: 3;
}

.c4-column-trigger {
  position: relative;
  cursor: pointer;
  height: 100%;
}

/* Column selector hover highlighter */
.c4-column-trigger::after {
  content: '';
  position: absolute;
  inset: 0 -4px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s;
  pointer-events: none;
}

.c4-column-trigger:hover::after {
  opacity: 1;
}

/* Preview chip hanging above */
.c4-preview-chip {
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.c4-column-trigger:hover .c4-preview-chip {
  opacity: 0.75;
  transform: translateX(-50%) scale(0.95);
}

/* Board frame grid */
.c4-board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0;
  position: relative;
  z-index: 2;
  pointer-events: none; /* Let triggers capture clicks */
}

/* An individual slot in Connect Four board */
.c4-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(circle, transparent 60%, #151829 65%);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
  border-radius: 12%;
}

/* Real chip layers underneath */
.c4-chips-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  z-index: 1;
  pointer-events: none;
}

.c4-chip-column {
  position: relative;
  height: 100%;
}

.c4-chip {
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 10%;
  box-shadow: 
    inset 0 4px 8px rgba(255, 255, 255, 0.25),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.4);
  animation: dropChip 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.c4-chip.red {
  background: radial-gradient(circle at 35% 35%, #ff4b72 10%, #cc0033 80%);
}

.c4-chip.yellow {
  background: radial-gradient(circle at 35% 35%, #ffd24b 10%, #cc9900 80%);
}

.c4-chip.winning {
  animation: winGlow 1s infinite alternate;
  z-index: 5;
  box-shadow: 
    0 0 25px currentColor,
    inset 0 4px 8px rgba(255, 255, 255, 0.4);
}

@keyframes winGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.3); }
}

@keyframes dropChip {
  0% {
    transform: translateY(-800%);
  }
  75% {
    transform: translateY(0);
  }
  88% {
    transform: translateY(-12%);
  }
  100% {
    transform: translateY(0);
  }
}

/* Header turn display */
.c4-turn-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
}

.turn-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.turn-indicator.active {
  box-shadow: 0 0 10px currentColor;
}

/* Live Chat system */
.c4-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.c4-chat-box {
  display: flex;
  flex-direction: column;
  height: 380px;
}

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

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-bubble.system {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  align-self: center;
  text-align: center;
  font-style: italic;
  font-size: 0.78rem;
  max-width: 95%;
}

.chat-bubble.local {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.chat-bubble.remote {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.2);
}

/* Emoji reaction menu */
.emoji-tray {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px 12px;
  overflow-x: auto;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.emoji-btn {
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  outline: none;
}

.emoji-btn:hover {
  transform: scale(1.25);
}

/* Fullscreen Emoji burst animation */
.emoji-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

.burst-item {
  position: absolute;
  font-size: 3rem;
  animation: floatUpBurst 1.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes floatUpBurst {
  0% {
    transform: translate(var(--x-start), 110dvh) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--x-end), -20dvh) scale(1.3) rotate(var(--rot));
    opacity: 0;
  }
}

/* Multiplayer matchmaking indicators */
.loading-dots span {
  animation: blink 1.4s infinite both;
  font-size: 1.2rem;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* Global utility classes */
.flex-row-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-shell { padding: 12px; }
  header { padding: 8px 12px; }
  .logo { font-size: 1.4rem; }
  .lobby-hero h1 { font-size: 2.2rem; }
  .c4-board-wrapper { padding: 4px; }
  .c4-board-grid { gap: 0; }
  .c4-chips-container, .c4-columns-container {
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
  }
}
