@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-accent: #334155;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.3);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --piedra: #00d4ff;
  --papel: #fde047;
  --tijeras: #ef4444;
  --lagarto: #22c55e;
  --spock: #a855f7;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  padding: 1rem;
  text-align: center;
  background: linear-gradient(to bottom, rgba(30, 41, 59, 0.5), transparent);
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #f8fafc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem;
  gap: 1rem;
  width: 100%;
}

#canvas-container {
  position: relative;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
}

#canvas-container::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(45deg, var(--accent), transparent, var(--accent));
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0.2;
}

canvas {
  border-radius: var(--radius-lg);
  display: block;
}

.dashboard {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  min-width: 100px;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.stats-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 900px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
  z-index: 100;
  pointer-events: none; /* Allow clicking through to simulation if needed, but cards have hover so maybe remove this or keep it only for container */
}

.stats-container * {
  pointer-events: auto; /* Enable interaction for children */
}

.progress-container {
  margin-top: 1rem;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.piedra-bar { background-color: var(--piedra); }
.papel-bar { background-color: var(--papel); }
.tijeras-bar { background-color: var(--tijeras); }
.lagarto-bar { background-color: var(--lagarto); }
.spock-bar { background-color: var(--spock); }

footer {
  padding: 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-selector label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

select {
  background: var(--bg-accent);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--accent);
}

.hidden {
  display: none !important;
}

button {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  background: var(--bg-accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

button:active {
  transform: scale(0.95);
}

button.primary {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
}

button.primary:hover {
  background: #7dd3fc;
}

button.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.2);
}

@media (max-width: 600px) {
  h1 { font-size: 1.75rem; }
  .dashboard { grid-template-columns: repeat(3, 1fr); }
  #canvas-container { padding: 5px; }
}
