/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Prevent text selection and highlighting */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent touch callouts on mobile */
  -webkit-touch-callout: none;
  /* Prevent drag and drop */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* MODERN COHESIVE DESIGN SYSTEM - PREMIUM THEME */
body {
  background: 
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #334155 60%, #1e293b 100%);
  background-attachment: fixed;
  overflow: hidden;
  min-height: 100vh;
  /* Additional body-level selection prevention */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* MAIN GAME AREA - COHESIVE GRADIENT */
.game-area {
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.95) 0%, 
    rgba(30, 41, 59, 0.98) 25%, 
    rgba(51, 65, 85, 0.95) 50%, 
    rgba(30, 41, 59, 0.98) 75%, 
    rgba(15, 23, 42, 0.95) 100%);
  overflow-x: hidden;
  overflow-y: auto;
  backdrop-filter: blur(1px);
}

/* PREMIUM GAME CONTAINER - ORIGINAL WIDTH */
.game-container {
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.game-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.2) 0%, 
    rgba(139, 92, 246, 0.15) 25%,
    rgba(16, 185, 129, 0.1) 50%,
    rgba(139, 92, 246, 0.15) 75%,
    rgba(59, 130, 246, 0.2) 100%);
  border-radius: 1.5rem;
  z-index: -1;
  opacity: 0.6;
}

#root {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utility Classes */
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Background and positioning */
.bg-gradient-main {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Enhanced dragging animation styles */
.cursor-line-glow {
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.4));
}

/* Smooth line drawing animation */
@keyframes drawLine {
  from {
    stroke-dashoffset: 100%;
  }
  to {
    stroke-dashoffset: 0%;
  }
}

.drawing-line {
  animation: drawLine 0.3s ease-out;
}

/* Pulse effect for drawing cursor */
@keyframes cursorPulse {
  0% { 
    transform: scale(1);
    opacity: 0.8;
  }
  50% { 
    transform: scale(1.2);
    opacity: 1;
  }
  100% { 
    transform: scale(1);
    opacity: 0.8;
  }
}

.drawing-cursor {
  animation: cursorPulse 1.5s ease-in-out infinite;
}

.relative { position: relative; }
.fixed { position: fixed; }
.overflow-hidden { overflow: hidden; }

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Text utilities */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace; }

/* Colors */
.text-white { color: white; }
.text-yellow-400 { color: #facc15; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-700 { color: #334155; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-blue-400 { color: #60a5fa; }
.text-blue-300 { color: #93c5fd; }

/* Backgrounds */
.bg-slate-800 { background-color: rgba(30, 41, 59, 0.95); }
.bg-slate-900 { background-color: rgba(15, 23, 42, 0.5); }
.bg-slate-700 { background-color: #334155; }
.bg-slate-600 { background-color: #475569; }
.bg-orange-600 { background-color: #ea580c; }
.bg-orange-700 { background-color: #c2410c; }
.bg-teal-600 { background-color: #0d9488; }
.bg-teal-700 { background-color: #0f766e; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-purple-600 { background-color: #9333ea; }
.bg-purple-700 { background-color: #7c3aed; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-700 { background-color: #b91c1c; }
.bg-gray-500 { background-color: #6b7280; }
.bg-green-600 { background-color: #16a34a; }

/* Hover effects */
.hover-bg-slate-600:hover { background-color: #475569; }
.hover-bg-orange-700:hover { background-color: #c2410c; }
.hover-bg-teal-700:hover { background-color: #0f766e; }
.hover-bg-blue-700:hover { background-color: #1d4ed8; }
.hover-bg-purple-700:hover { background-color: #7c3aed; }
.hover-bg-red-700:hover { background-color: #b91c1c; }
.hover-bg-slate-500:hover { background-color: #64748b; }

/* Borders and shadows */
.border { border-width: 1px; }
.border-slate-700 { border-color: #334155; }
.border-slate-600 { border-color: #475569; }
.border-blue-500 { border-color: #3b82f6; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Backdrop blur */
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* Transitions */
.transition-colors { transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; }
.transition-all { transition: all 0.15s ease-in-out; }

/* Disabled state */
.cursor-not-allowed { cursor: not-allowed; }
.text-gray-400 { color: #9ca3af; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Touch */
.touch-none { touch-action: none; }

/* Pointer events */
.pointer-events-none { pointer-events: none; }

/* Transform */
.transform { transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1); }
.translate-x-center { transform: translateX(-50%); }

/* Z-index */
.z-50 { z-index: 50; }
.z-60 { z-index: 60; }

/* Opacity */
.opacity-80 { opacity: 0.8; }

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* ==========================================================================
   ENHANCED MODERN DESIGN SYSTEM - Hart Puzzle Game
   ========================================================================== */

/* Enhanced Background System */
body {
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Enhanced Game Container - UPDATED AND FIXED */
.game-container {
  width: 100%;
  max-width: 28rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(100, 116, 139, 0.1) 100%);
  border-radius: 1.5rem;
  z-index: -1;
}

/* PREMIUM GAME TITLE */
.game-title h1 {
  font-size: 2.25rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, 
    #f8fafc 0%, 
    #e2e8f0 25%, 
    #cbd5e1 50%, 
    #94a3b8 75%, 
    #64748b 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  letter-spacing: -0.03em;
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-logo {
  height: 1em; /* Match font size exactly */
  width: auto;
  display: inline-block;
  vertical-align: -0.1em; /* Fine-tune vertical position */
  margin: 0 0.02em; /* Small spacing */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.game-title h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(59, 130, 246, 0.8) 10%, 
    rgba(139, 92, 246, 0.6) 50%,
    rgba(16, 185, 129, 0.4) 90%,
    transparent);
  border-radius: 2px;
  filter: blur(0.5px);
}

/* Enhanced Notification System */
.notification {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 100;
  max-width: calc(100vw - 2rem);
  text-align: center;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.notification.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.8) 100%);
  color: white;
  border-color: rgba(16, 185, 129, 0.3);
}

.notification.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.8) 100%);
  color: white;
  border-color: rgba(239, 68, 68, 0.3);
}

.notification.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.8) 100%);
  color: white;
  border-color: rgba(59, 130, 246, 0.3);
}

/* PREMIUM HEADER SECTION */
.header-section {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.stage-timer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stage-info {
  text-align: center;
}

.stage-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.stage-emoji {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stage-number {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, 
    #f8fafc 0%, 
    #e2e8f0 25%, 
    #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stage-description {
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.8);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(145deg, 
    rgba(0, 0, 0, 0.4) 0%, 
    rgba(0, 0, 0, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.timer-time {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 1.125rem;
  color: #e2e8f0;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

/* Enhanced Timer States */
.timer-time.timer-warning {
  color: #fbbf24;
  animation: pulse-warning 2s infinite;
}

.timer-time.timer-critical {
  color: #ef4444;
  animation: pulse-critical 1s infinite;
}

.time-limit {
  opacity: 0.7;
  font-size: 0.9em;
  margin-left: 0.25rem;
}

.offline-indicator {
  opacity: 0.8;
  font-size: 0.9em;
}

.move-counter {
  color: #94a3b8;
  font-size: 0.9em;
}

/* Timer Warning Animations */
@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.control-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  color: #f8fafc;
  cursor: pointer;
  backdrop-filter: blur(12px);
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.control-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.15), 
    transparent);
  transition: left 0.3s ease;
}

.control-button:hover::before {
  left: 100%;
}

.control-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
}

.control-button:active {
  transform: translateY(0);
}

.control-button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.control-button.disabled:hover::before {
  left: -100%;
}

.stage-info {
  text-align: center;
}

.stage-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem; /* Reduced from 0.5rem */
}

.stage-emoji {
  font-size: 1.25rem; /* Reduced from 1.5rem */
}

.stage-number {
  font-size: 1.25rem; /* Reduced from 1.5rem */
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stage-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  display: block;
  margin-bottom: 0.25rem; /* Reduced from 0.5rem */
}

/* Enhanced Timer Container */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem; /* Reduced from 0.75rem */
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.5rem;
  font-weight: 600;
}

.timer-time {
  font-family: 'Courier New', monospace;
  font-size: 1rem; /* Reduced from 1.125rem */
  color: #22d3ee;
}

/* Controls Grid Enhancement */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Reduced from 140px */
  gap: 0.5rem; /* Reduced from 0.75rem */
  margin-top: 1rem;
  justify-items: center;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(8px);
}

.control-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem; /* Reduced from 0.5rem */
  padding: 0.5rem 0.75rem; /* Reduced from 0.75rem 1rem */
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem; /* Reduced from 1rem */
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(8px);
  min-height: 44px; /* Maintain touch target size */
}

/* COMBINED TIMER LAYOUT */
.timer-container-combined {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.timer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  backdrop-filter: blur(8px);
  font-weight: 600;
  color: #f8fafc;
}

.timer-item.global {
  opacity: 0.8;
  font-size: 0.9em;
}

.timer-separator {
  color: rgba(255, 255, 255, 0.6);
  font-weight: bold;
  font-size: 1.2em;
}

/* PREMIUM GAME BOARD */
.game-board-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: linear-gradient(145deg, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 0, 0, 0.15) 100%);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 320px;
  aspect-ratio: 1;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-board {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, 
    rgba(15, 23, 42, 0.9) 0%, 
    rgba(30, 41, 59, 0.95) 50%, 
    rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(8px);
  cursor: crosshair;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.game-board:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* PREMIUM INSTRUCTIONS */
.instructions {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.instructions-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.9);
  font-weight: 500;
}

.instructions-start {
  color: #10b981;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.instructions-end {
  color: #f59e0b;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.instructions-tip {
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.7);
  display: block;
  margin-top: 0.5rem;
  font-style: italic;
}

/* PREMIUM FACEBOOK CTA */
.facebook-cta {
  background: linear-gradient(145deg, 
    rgba(24, 119, 242, 0.15) 0%, 
    rgba(24, 119, 242, 0.08) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(24, 119, 242, 0.2);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 
    0 4px 12px rgba(24, 119, 242, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.facebook-cta-text {
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.9);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.facebook-cta-button {
  background: linear-gradient(135deg, #1877f2, #42a5f5);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
  position: relative;
  overflow: hidden;
}

.facebook-cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.3s ease;
}

.facebook-cta-button:hover::before {
  left: 100%;
}

.facebook-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(24, 119, 242, 0.4);
}

/* Instructions - more compact and visible */
.instructions {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
  margin-top: auto; /* Push to bottom but keep visible */
}

.instructions-text {
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.instructions-start {
  color: #22d3ee;
  font-weight: 600;
}

.instructions-end {
  color: #ef4444;
  font-weight: 600;
}

.instructions-tip {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  display: block;
  margin-top: 0.25rem;
}

/* Facebook CTA - compact */
.facebook-cta {
  background: rgba(24, 119, 242, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(24, 119, 242, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.facebook-cta-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.facebook-cta-button {
  background: linear-gradient(135deg, #1877f2, #42a5f5);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.facebook-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

/* PREMIUM VICTORY MODAL SYSTEM */
.victory-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.8) 0%, 
    rgba(15, 23, 42, 0.9) 50%, 
    rgba(0, 0, 0, 0.8) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
  /* Ensure proper viewport dimensions */
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* Remove any margins that might affect centering */
  margin: 0;
  /* Force perfect centering */
  place-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.victory-content {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  padding: 2rem;
  text-align: center;
  color: white;
  max-width: min(90vw, 500px);
  width: 95%;
  /* Optimize height constraints for better centering */
  max-height: min(85vh, 85dvh);
  overflow-y: auto;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  /* Ensure perfect centering */
  margin: 0;
  /* Remove any default transforms that might interfere */
  transform: none;
  /* Ensure content is vertically centered within its bounds */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.victory-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.08) 0%, 
    rgba(139, 92, 246, 0.06) 25%,
    rgba(16, 185, 129, 0.04) 50%,
    rgba(139, 92, 246, 0.06) 75%,
    rgba(59, 130, 246, 0.08) 100%);
  border-radius: 1.5rem;
  pointer-events: none;
}

.victory-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: bounceIn 0.35s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.victory-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, 
    #f8fafc 0%, 
    #e2e8f0 25%, 
    #cbd5e1 50%, 
    #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  letter-spacing: -0.02em;
}

.victory-details {
  margin-bottom: 2rem;
  text-align: left;
}

.victory-stage {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.75rem;
  text-align: center;
}

.victory-stats {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 500;
}

.victory-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.victory-button {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  position: relative;
  overflow: hidden;
}

.victory-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.3s ease;
}

.victory-button:hover::before {
  left: 100%;
}

.victory-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.12) 100%);
}

.victory-button.next {
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.3) 0%, 
    rgba(16, 185, 129, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.victory-button.next:hover {
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.4) 0%, 
    rgba(16, 185, 129, 0.2) 100%);
}

.victory-button.retry {
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.3) 0%, 
    rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(139, 92, 246, 0.4);
  color: #e9d5ff;
}

.victory-button.retry:hover {
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.4) 0%, 
    rgba(139, 92, 246, 0.2) 100%);
}

.victory-complete {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(16px);
}

.complete-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, 
    #fbbf24 0%, 
    #f59e0b 50%, 
    #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.complete-subtitle {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 500;
}

.completion-stats {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.stats-section {
  text-align: center;
}

.stats-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.75rem;
}

.stats-highlight {
  font-size: 1rem;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stats-new-record {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: pulse 2s infinite;
}

.stage-breakdown {
  margin: 1rem 0;
}

.breakdown-title {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  text-align: center;
}

.stage-times-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stage-time-item {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.stage-time-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
}

.stage-time-item.completed {
  background: linear-gradient(145deg, 
    rgba(16, 185, 129, 0.15) 0%, 
    rgba(16, 185, 129, 0.08) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.stage-time-item.incomplete {
  background: linear-gradient(145deg, 
    rgba(107, 114, 128, 0.1) 0%, 
    rgba(107, 114, 128, 0.05) 100%);
  border-color: rgba(107, 114, 128, 0.2);
  opacity: 0.6;
}

.stage-number {
  font-weight: 600;
  color: #cbd5e1;
  display: block;
  font-size: 0.75rem;
}

.stage-time {
  color: #f8fafc;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
}

.progress-indicator {
  margin: 1rem 0;
}

.progress-text {
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    #3b82f6 0%, 
    #60a5fa 50%, 
    #93c5fd 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.motivation-text {
  color: #cbd5e1;
  font-style: italic;
  text-align: center;
  margin: 1rem 0;
  padding: 0.75rem;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.03) 100%);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-weight: 500;
}

.victory-social-section {
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.03) 100%);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.victory-share-button,
.victory-leaderboard-button {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.3) 0%, 
    rgba(59, 130, 246, 0.15) 100%);
  color: white;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  font-weight: 500;
}

.victory-share-button:hover,
.victory-leaderboard-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.4) 0%, 
    rgba(59, 130, 246, 0.2) 100%);
}

.competitive-section {
  margin-top: 1rem;
  padding: 0.75rem;
  background: linear-gradient(145deg, 
    rgba(16, 185, 129, 0.15) 0%, 
    rgba(16, 185, 129, 0.08) 100%);
  border-radius: 0.5rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
  backdrop-filter: blur(8px);
}

.competitive-text {
  color: #a7f3d0;
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* COMPACT STAGE INFO LAYOUT */
.stage-title-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stage-description-inline {
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.stage-emoji {
  font-size: 1.25rem;
}

.stage-number {
  font-weight: 700;
  color: #f8fafc;
  font-size: 1rem;
}

/* ENHANCED RESPONSIVE DESIGN - ORIGINAL FRAME SUPPORT */
@media (max-width: 480px) {
  .game-area {
    padding: 0.5rem;
  }
  
  .game-container {
    gap: 1rem;
    padding: 1rem;
    max-width: 95%;
  }
  
  .game-title h1 {
    font-size: 1.75rem;
  }
  
  .header-section {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .stage-title-compact {
    justify-content: center;
    gap: 0.375rem;
  }
  
  .stage-description-inline {
    font-size: 0.75rem;
  }
  
  .stage-emoji {
    font-size: 1rem;
  }
  
  .stage-number {
    font-size: 0.875rem;
  }
  
  .timer-container-combined {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .timer-item {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    justify-content: center;
  }
  
  .timer-separator {
    display: none;
  }
  
  .game-board-container {
    min-height: 280px;
    padding: 0.5rem;
  }
  
  .controls-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .control-button {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .control-button .btn-text {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
  }
  
  .control-button .btn-icon {
    font-size: 1rem;
  }
  
  .victory-content {
    padding: 1.5rem;
    margin: 0;
    max-width: calc(95vw - 2rem);
    max-height: min(80vh, 80dvh);
  }
  
  .victory-title {
    font-size: 1.5rem;
  }
  
  .victory-emoji {
    font-size: 3rem;
  }
  
  .victory-button {
    min-width: 150px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .stage-times-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 360px) {
  .game-area {
    padding: 0.25rem;
  }
  
  .game-container {
    padding: 0.75rem;
    gap: 0.75rem;
    max-width: 98%;
  }
  
  .game-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .header-section {
    padding: 0.5rem;
  }
  
  .timer-container-combined {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .timer-item {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .control-button {
    padding: 0.5rem;
    min-height: 44px;
  }
  
  .victory-content {
    padding: 1rem;
    margin: 0;
    max-width: calc(95vw - 1rem);
    max-height: min(75vh, 75dvh);
  }
  
  .stage-times-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
  }
  
  .stage-time-item {
    padding: 0.25rem;
    font-size: 0.75rem;
  }
}

/* RESPONSIVE BREAKPOINTS FOR ORIGINAL LAYOUT */
@media (max-width: 1024px) {
  .game-container {
    max-width: 90%;
    padding: 1.25rem;
  }
  
  .victory-content {
    max-width: min(85vw, 450px);
    padding: 1.75rem;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .game-container {
    max-width: 95%;
    padding: 1rem;
    gap: 1rem;
  }
  
  .victory-content {
    max-width: min(90vw, 420px);
    padding: 1.5rem;
    margin: 0;
  }
  
  .timer-container-combined {
    justify-content: space-between;
  }
  
  .header-section {
    gap: 1rem;
  }
}

/* ==========================================================================
   NEW FEATURE COMPONENTS - ShareButton & ResultScreen
   ========================================================================== */

/* ShareButton component styles */
.share-button {
  /* Blue background as specified */
  background-color: #1877f2;
  border: 2px solid #1877f2;
  
  /* White text as specified */
  color: white;
  
  /* Rounded corners as specified */
  border-radius: 8px;
  
  /* Button styling */
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* Remove default button styles */
  outline: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  /* Mobile-friendly touch target */
  min-height: 44px;
  min-width: 44px;
}

/* Subtle hover effect as specified */
.share-button:hover {
  background-color: #166fe5;
  border-color: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.share-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

.share-button:focus {
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2);
}

/* ResultScreen component styles */
.result-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.8) 0%, 
    rgba(15, 23, 42, 0.9) 50%, 
    rgba(0, 0, 0, 0.8) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  place-items: center;
}

.result-screen-content {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  padding: 2rem;
  text-align: center;
  color: white;
  max-width: min(90vw, 500px);
  width: 95%;
  max-height: min(85vh, 85dvh);
  overflow-y: auto;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  margin: 0;
  transform: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-screen-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.result-screen-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.result-screen-header {
  margin-bottom: 1.5rem;
}

.result-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: bounceIn 0.35s ease-out;
}

.result-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, 
    #f8fafc 0%, 
    #e2e8f0 25%, 
    #cbd5e1 50%, 
    #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  letter-spacing: -0.02em;
}

.result-details {
  margin-bottom: 2rem;
  text-align: center;
}

.result-level,
.result-time {
  font-size: 1.125rem;
  color: #e2e8f0;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.result-message {
  font-size: 1rem;
  color: #cbd5e1;
  margin-top: 1rem;
  padding: 0.75rem;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.03) 100%);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-weight: 500;
  font-style: italic;
}

.result-completion-stats {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.result-button {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  position: relative;
  overflow: hidden;
}

.result-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.3s ease;
}

.result-button:hover::before {
  left: 100%;
}

.result-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.12) 100%);
}

.result-button.play-again {
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.3) 0%, 
    rgba(16, 185, 129, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.result-button.play-again:hover {
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.4) 0%, 
    rgba(16, 185, 129, 0.2) 100%);
}

.result-share-button {
  background: linear-gradient(135deg, 
    rgba(24, 119, 242, 0.3) 0%, 
    rgba(24, 119, 242, 0.15) 100%);
  border-color: rgba(24, 119, 242, 0.4);
  color: #dbeafe;
}

.result-share-button:hover {
  background: linear-gradient(135deg, 
    rgba(24, 119, 242, 0.4) 0%, 
    rgba(24, 119, 242, 0.2) 100%);
  box-shadow: 0 12px 24px rgba(24, 119, 242, 0.3);
}

/* Responsive design for mobile (basic CSS media queries) */
@media (max-width: 768px) {
  .share-button {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .result-screen-content {
    padding: 1.5rem;
    max-width: calc(95vw - 2rem);
    max-height: min(80vh, 80dvh);
  }
  
  .result-title {
    font-size: 1.5rem;
  }
  
  .result-emoji {
    font-size: 3rem;
  }
  
  .result-button {
    min-width: 150px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .share-button {
    padding: 8px 16px;
    font-size: 13px;
    width: 100%;
    max-width: 200px;
  }
  
  .result-screen-content {
    padding: 1rem;
    max-width: calc(95vw - 1rem);
    max-height: min(75vh, 75dvh);
  }
  
  .result-button {
    width: 100%;
    max-width: 250px;
  }
}

