:root {
  --primary: #F05032; /* Git Orange */
  --primary-hover: #D04022;
  --secondary: #FF7B54;
  --accent: #00CEC9;
  --bg-dark: #1A0D0A;
  --bg-card: rgba(30, 18, 15, 0.7);
  --text-main: #F8F8F8;
  --text-muted: #A09E9D;
  --border-radius: 12px;
  --success: #20BF6B;
  --danger: #EB3B5A;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(240, 80, 50, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 206, 201, 0.05), transparent 25%);
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--glass-shadow);
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 30px;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

.code-font {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent);
}

/* Start Screen */
#start-screen {
  text-align: center;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.git-icon {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 0 10px rgba(240, 80, 50, 0.5));
}

h1 {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.stats-panel {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 120px;
}

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

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-lg {
  padding: 16px 24px;
  font-size: 1.1rem;
  flex-direction: column;
  gap: 4px;
}

.btn-lg small {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
}

.primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(240, 80, 50, 0.3);
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 80, 50, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--glass-border);
}

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

/* Pill Selectors */
.category-selectors {
  margin-top: 20px;
}

.category-selectors h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pill {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.9rem;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pill.active {
  background: rgba(0, 206, 201, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Game Screen */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 20px;
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.progress-bar-container {
  width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 10%;
  transition: width 0.3s ease;
}

.question-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.game-stats {
  display: flex;
  gap: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

.timer-display {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}

.timer-display.danger {
  color: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Scenario */
.scenario-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.scenario-header {
  display: flex;
  gap: 10px;
}

.difficulty-badge, .category-tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.difficulty-badge {
  background: rgba(240, 80, 50, 0.2);
  color: #FFA08E;
  border: 1px solid rgba(240, 80, 50, 0.5);
}

.category-tag {
  background: rgba(0, 206, 201, 0.2);
  color: var(--accent);
  border: 1px solid rgba(0, 206, 201, 0.5);
}

#scenario-text {
  font-size: 1.4rem;
  line-height: 1.4;
  font-weight: 500;
}

.code-block {
  background: rgba(0, 0, 0, 0.6);
  padding: 15px;
  border-radius: 8px;
  font-family: var(--font-mono);
  color: #E2E8F0;
  font-size: 0.95rem;
  border-left: 3px solid var(--accent);
  white-space: pre-wrap;
}

.code-block.hidden {
  display: none;
}

/* Inputs */
.input-area {
  width: 100%;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 15px 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(4px);
}

.option-btn.correct {
  background: rgba(32, 191, 107, 0.2);
  border-color: var(--success);
  color: #A3F3C6;
}

.option-btn.wrong {
  background: rgba(235, 59, 90, 0.2);
  border-color: var(--danger);
  color: #FFA4B4;
}

.terminal-input-wrapper {
  background: #000;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.terminal-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.3), inset 0 2px 10px rgba(0,0,0,0.5);
}

.prompt {
  color: var(--success);
  font-weight: bold;
}

#command-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  outline: none;
}

/* Feedback Overlay */
.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: var(--border-radius);
  opacity: 1;
  transition: opacity 0.3s;
}

.feedback-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.feedback-content {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-overlay.hidden .feedback-content {
  transform: translateY(20px);
}

.feedback-content.success {
  border-color: var(--success);
  box-shadow: 0 8px 32px 0 rgba(32, 191, 107, 0.2);
}

.feedback-content.error {
  border-color: var(--danger);
  box-shadow: 0 8px 32px 0 rgba(235, 59, 90, 0.2);
}

.feedback-icon {
  font-size: 3rem;
  margin-bottom: -10px;
}

#feedback-desc {
  font-size: 1.2rem;
  margin: 10px 0;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  color: #fff;
}

.explanation {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.hotkey {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 8px;
}

/* Result Screen */
.result-card {
  padding: 40px;
  text-align: center;
}

.result-header h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.final-score .score-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.final-score .score-value {
  font-size: 4rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(240, 80, 50, 0.3);
}

.result-breakdown {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.breakdown-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.highlight-item {
  justify-content: center;
  color: var(--success);
  font-weight: bold;
  font-size: 1.2rem;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Responsiveness */
@media (max-width: 600px) {
  h1 { font-size: 2.2rem; }
  .stats-panel { flex-wrap: wrap; }
  .stat-box { min-width: calc(50% - 10px); }
  .game-stats { gap: 10px; font-size: 1rem; }
  .scenario-card { padding: 20px; }
  #scenario-text { font-size: 1.2rem; }
  .terminal-input-wrapper { font-size: 1rem; }
  .result-card { padding: 25px 15px; }
  .final-score .score-value { font-size: 3rem; }
}
