/* ==========================================================================
   DESIGN SYSTEM - GUESSVOICE GAME (VANILLA CSS)
   ========================================================================== */

/* Variables & Base Custom Properties */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Colors */
  --bg-app: hsl(230, 40%, 6%);
  --bg-card: rgba(22, 28, 45, 0.65);
  --bg-card-hover: rgba(30, 41, 69, 0.8);
  --border-glass: rgba(255, 255, 255, 0.08);
  
  --primary: hsl(263, 90%, 65%);
  --primary-glow: hsla(263, 90%, 65%, 0.45);
  --accent: hsl(190, 95%, 50%);
  --accent-glow: hsla(190, 95%, 50%, 0.45);
  
  --success: hsl(142, 70%, 45%);
  --success-glow: hsla(142, 70%, 45%, 0.35);
  --danger: hsl(346, 80%, 55%);
  --danger-glow: hsla(346, 80%, 55%, 0.35);
  --warning: hsl(38, 92%, 50%);
  --warning-glow: hsla(38, 92%, 50%, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-dark: #0f172a;

  /* Transitions */
  --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.15);
  --shadow-accent-glow: 0 0 25px rgba(6, 182, 212, 0.2);
}

/* Base Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 20%, hsla(263, 90%, 65%, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, hsla(190, 95%, 50%, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Typography Helpers */
.font-outfit {
  font-family: var(--font-display);
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 50%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.p-5 { padding: 1.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-xl { max-width: 36rem; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.animate-pulse { animation: pulse 2s infinite ease-in-out; }

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

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar Styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: rgba(11, 13, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
  margin-left: 0.5rem;
}

.version-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-all);
}

.nav-link svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: var(--transition-all);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: var(--shadow-glow);
}

.nav-link.active svg {
  color: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary-glow));
}

/* Content Area */
.content-wrapper {
  flex: 1;
  padding: 2rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

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

/* Alert Notification */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.alert-warning svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

.alert-warning a {
  color: #fbbf24;
  text-decoration: underline;
  font-weight: 600;
}

/* Cards Design */
.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: var(--transition-all);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

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

.header-title-flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

/* Game Play Layout grid */
.game-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.main-card {
  display: flex;
  flex-direction: column;
}

/* Status Bar inside Game */
.game-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.status-item {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-size: 0.7rem;
  letter-spacing: 0.075em;
  font-weight: 600;
  color: var(--text-muted);
}

.status-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.progress-item {
  flex: 1;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  width: 0;
  transition: width 0.5s ease-out;
}

/* Viewport Image Area */
.screen-viewport {
  position: relative;
  min-height: 400px;
  border-radius: 12px;
  background: rgba(10, 10, 18, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem;
}

.viewport-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.viewport-state.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 13, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  padding: 2rem;
}

.state-icon {
  width: 4rem;
  height: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.viewport-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.viewport-state p {
  color: var(--text-secondary);
  max-width: 320px;
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.image-stage {
  position: relative;
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.glow-bg {
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  bottom: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(25px);
  z-index: 1;
}

.game-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  z-index: 2;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5));
}

/* Image Game Floating Animations */
.float-up {
  animation: anim-float-up 6s infinite ease-in-out;
}

@keyframes anim-float-up {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.launch {
  animation: anim-launch 7s infinite ease-in-out;
}

@keyframes anim-launch {
  0% { transform: translateY(30px) rotate(0deg) scale(0.95); }
  8% { transform: translateY(30px) rotate(-1.5deg) scale(0.95); }
  10% { transform: translateY(30px) rotate(1.5deg) scale(0.95); }
  12% { transform: translateY(30px) rotate(-1.5deg) scale(0.95); }
  14% { transform: translateY(30px) rotate(1.5deg) scale(0.95); }
  22% { transform: translateY(-25px) rotate(0deg) scale(1.05); }
  60% { transform: translateY(-15px) rotate(1deg) scale(1.02); }
  100% { transform: translateY(30px) rotate(0deg) scale(0.95); }
}

.bounce {
  animation: anim-bounce 4s infinite ease-in-out;
}

@keyframes anim-bounce {
  0%, 100% { transform: translateY(0) scaleY(1); }
  45% { transform: translateY(-35px) scaleY(1.03); }
  50% { transform: translateY(-35px) scaleY(0.97); }
  55% { transform: translateY(-25px) scaleY(1.01); }
}

.spin-slow {
  animation: anim-spin-slow 20s infinite linear;
}

@keyframes anim-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pulse-gaze {
  animation: anim-pulse-gaze 3s infinite ease-in-out;
}

@keyframes anim-pulse-gaze {
  0%, 100% { transform: scale(0.96); filter: brightness(0.9); }
  50% { transform: scale(1.04); filter: brightness(1.1); }
}

/* Hint elements */
.hint-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.hint-text {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 450px;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

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

/* Voice Controls & Visualizer */
.control-panel-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  justify-content: space-between;
}

.recorder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.25rem;
}

.visualizer-container {
  width: 100%;
  height: 60px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.visualizer-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.3;
}

.visualizer-placeholder svg {
  width: 1.5rem;
  height: 1.5rem;
}

.mic-button-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--danger-glow) 30%, transparent 70%);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.mic-button-wrapper.recording .pulse-ring {
  animation: pulse-out 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
}

.mic-button-wrapper.recording #mic-pulse-ring-2 {
  animation-delay: 0.9s;
}

@keyframes pulse-out {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.mic-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #581c87 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-all);
  z-index: 5;
}

.mic-button svg {
  width: 1.8rem;
  height: 1.8rem;
  transition: var(--transition-all);
}

.mic-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.6);
}

.mic-button:active:not(:disabled) {
  transform: scale(0.95);
}

.mic-button:disabled {
  background: #334155;
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.mic-button-wrapper.recording .mic-button {
  background: linear-gradient(135deg, var(--danger) 0%, #991b1b 100%);
  box-shadow: 0 4px 20px var(--danger-glow);
  transform: scale(1.02);
}

.recorder-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: var(--text-secondary);
}

.timer-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 700;
}

/* Feedback Box Styling */
.result-feedback-container {
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.15);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.result-alert {
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.feedback-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bg-success {
  background: var(--success);
  color: white;
  box-shadow: 0 0 15px var(--success-glow);
}

.bg-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 0 15px var(--danger-glow);
}

.feedback-icon-wrapper svg {
  width: 1.5rem;
  height: 1.5rem;
}

.result-alert h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.result-alert.success h4 { color: var(--success); }
.result-alert.error h4 { color: var(--danger); }

.transcription-quote {
  font-style: italic;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.action-buttons-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
}

.action-buttons-group button {
  flex: 1;
}

/* Spinner Animation */
.spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Trophy Winning Elements */
.win-content {
  max-width: 400px;
}

.trophy-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24 30%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
}

.trophy-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: white;
}

.win-stats-container {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-txt {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================= ADMIN TAB PANELS ================= */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Text Inputs, Selects, Textareas */
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-all);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Tab/Toggle Group Style */
.tab-toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.tab-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-all);
}

.tab-toggle-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Drop area for files */
.file-drop-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.3);
  transition: var(--transition-all);
  position: relative;
}

.file-drop-area:hover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.03);
}

.file-drop-area.drag-over {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.06);
}

.upload-icon {
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Image preview in admin form */
.image-preview-box {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #090d16;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-remove-preview {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-all);
}

.btn-remove-preview:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Inputs with Prefix Icons */
.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 2.75rem;
}

/* Custom Select Dropdowns styling */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
}

.select-chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Button Classes */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-all);
}

.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; border-radius: 6px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover {
  background: #15803d;
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 4px;
}

/* Tag Pills for Correct Answers */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
}

/* Questions list grid inside admin panel */
.questions-list-wrapper {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.25rem;
}

/* Scrollbar customization */
.questions-list-wrapper::-webkit-scrollbar {
  width: 6px;
}
.questions-list-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.questions-list-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.question-item-card {
  display: flex;
  gap: 1rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  align-items: center;
  transition: var(--transition-all);
}

.question-item-card:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}

.q-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.q-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.q-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0; /* allows text wrapping */
}

.q-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.q-label svg {
  width: 0.85rem;
  height: 0.85rem;
}

.q-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.btn-icon-danger,
.btn-icon-primary {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  transition: var(--transition-all);
}

.btn-icon-primary {
  color: var(--text-secondary);
}

.btn-icon-primary:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon-danger {
  color: rgba(239, 68, 68, 0.7);
}

.btn-icon-danger:hover {
  color: white;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon-primary svg,
.btn-icon-danger svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ================= SETTINGS SUBPANELS ================= */
.system-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.status-row:last-child {
  border-bottom: none;
}

.status-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.success { color: var(--success); }
.status-indicator.success .indicator-dot { 
  background: var(--success); 
  box-shadow: 0 0 8px var(--success);
}

.status-indicator.danger { color: var(--danger); }
.status-indicator.danger .indicator-dot { 
  background: var(--danger); 
  box-shadow: 0 0 8px var(--danger);
}

.status-indicator.warning { color: var(--warning); }
.status-indicator.warning .indicator-dot { 
  background: var(--warning); 
  box-shadow: 0 0 8px var(--warning);
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(11, 13, 25, 0.4);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet Viewport (max-width: 1024px) */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: 1rem;
  }
  #tab-play {
    padding-bottom: 160px; /* Extra padding to prevent floating card from covering game content */
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .game-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.25rem 0;
    margin-bottom: 0;
    border-radius: 0;
  }

  /* Full Width Floating Bottom Bar for Voice Controls */
  .sidebar-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    transform: none;
    z-index: 200;
    margin-bottom: 0;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(124, 58, 237, 0.35);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar-card .card-header {
    display: none; /* Hide header to keep it compact */
  }

  .control-panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Horizontal layout for the recorder section */
  .recorder-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    padding: 0;
    background: transparent;
    border: none;
  }

  .visualizer-container {
    flex: 1;
    height: 48px;
    background: rgba(0, 0, 0, 0.3);
  }

  .mic-button-wrapper {
    order: -1; /* Move microphone button to the left */
    width: 56px;
    height: 56px;
  }

  .mic-button {
    width: 48px;
    height: 48px;
  }

  .mic-button svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .recorder-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    min-width: 90px;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .timer-text {
    font-size: 0.8rem;
  }

  .result-feedback-container {
    min-height: 80px;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
  }

  .feedback-icon-wrapper {
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 0.25rem;
  }

  .feedback-icon-wrapper svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  .result-alert h4 {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }

  .transcription-quote {
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
  }

  .result-alert p.text-sm {
    font-size: 0.7rem;
  }

  /* Full-Size game screens viewport */
  .screen-viewport {
    min-height: 380px;
    padding: 1.5rem;
    border: none; /* Remove dashed borders on mobile/tablet */
    background: rgba(10, 10, 18, 0.35); /* Slightly darker background stage */
  }

  .image-stage {
    max-width: 320px;
    margin-bottom: 1rem;
  }

  .game-status-bar {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
  }

  .admin-grid {
    gap: 1.5rem;
  }
}

/* Medium Mobile Viewport (max-width: 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .brand-text {
    font-size: 1.25rem;
  }
  
  .brand-badge {
    display: none;
  }
  
  .nav-text {
    display: none;
  }
  
  .nav-link {
    padding: 0.5rem 0.75rem;
  }
  
  .nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .content-wrapper {
    padding: 0.5rem;
  }
  #tab-play {
    padding-bottom: 120px;
  }
  
  .screen-viewport {
    min-height: 340px;
  }
  
  .image-stage {
    max-width: 280px;
  }

  .hint-text {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Small Mobile Viewport (max-width: 640px) */
@media (max-width: 640px) {
  .game-status-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .progress-item {
    grid-column: span 2;
  }
  
  .status-value {
    font-size: 1.1rem;
  }

  .status-label {
    font-size: 0.65rem;
  }
  
  .file-drop-area {
    padding: 1rem;
  }
  
  .win-stats-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stat-box {
    padding: 0.5rem;
  }
  
  .win-final-score {
    font-size: 1.5rem;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .nav-brand {
    justify-content: center;
    width: 100%;
  }
  
  .nav-menu {
    width: 100%;
    justify-content: space-around;
  }
  
  .nav-link {
    flex: 1;
    justify-content: center;
  }
  
  .sidebar-card {
    padding: 0.6rem 1rem;
  }
  
  .screen-viewport {
    min-height: 280px;
  }
  
  .image-stage {
    max-width: 220px;
  }
  
  .question-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .q-thumb {
    width: 100%;
    height: 120px;
  }
  
  .q-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.5rem;
    gap: 0.5rem;
  }
  
  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    justify-content: center;
  }
}

/* ==========================================================================
   ADMIN AUTHENTICATION LOCK SCREEN
   ========================================================================== */
.admin-auth-card {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2.5rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-neon);
  animation: fadeIn 0.4s ease-out;
}

.lock-icon-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--color-accent);
}

.lock-icon-wrapper svg {
  width: 2rem;
  height: 2rem;
}

.admin-auth-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.admin-auth-card p {
  margin-bottom: 2rem;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: center;
  transition: var(--transition-all);
}

.auth-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
  outline: none;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  font-weight: 600;
}

/* Header Action Lock/Logout button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-lock {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-all);
}

.btn-lock:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  transition: var(--transition-all);
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--color-accent);
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.4);
}

/* Image loading overlay style */
.image-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(13, 10, 29, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.image-loader.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}
