/* iQuiz - Mobile Answer Pad Stylesheet (Arch Dark Theme) */
:root {
  --color-a: #f1c40f;
  --color-b: #e74c3c;
  --color-c: #e67e22;
  --color-d: #2ecc71;
  --color-e: #3498db;
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --border-color: #30363d;
  --text-color: #f0f6fc;
  --text-muted: #8b949e;
  --accent-color: #00d2d3;
}

html {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body.mobile-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
  max-width: 100%;
}

.mobile-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-info {
  display: flex;
  flex-direction: column;
}

.player-nick {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-color);
}

.player-status-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-pill {
  background: #21262d;
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-weight: 700;
}

.stat-pill.lives {
  color: #f85149;
}

.stat-pill.score {
  color: #3fb950;
}

.mobile-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.mobile-status-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mobile-status-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-color);
}

.mobile-status-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Button Pad Grid */
.button-pad {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  justify-content: center;
  padding-bottom: 1rem;
}

.choice-btn {
  width: 100%;
  min-height: 72px;
  border-radius: 14px;
  border: none;
  font-size: 1.8rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.2s ease;
  color: #121417;
}

.choice-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.choice-btn.btn-a { background-color: var(--color-a); }
.choice-btn.btn-b { background-color: var(--color-b); color: #ffffff; }
.choice-btn.btn-c { background-color: var(--color-c); color: #ffffff; }
.choice-btn.btn-d { background-color: var(--color-d); color: #ffffff; }
.choice-btn.btn-e { background-color: var(--color-e); color: #ffffff; }

/* Locked & Disabled States */
.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(40%);
  transform: none;
  box-shadow: none;
}

.choice-btn.selected-choice {
  border: 4px solid #ffffff;
  opacity: 1 !important;
  filter: none !important;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
}

.locked-overlay {
  background: rgba(22, 27, 34, 0.95);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
  animation: fadeIn 0.3s ease;
}

.locked-overlay .lock-icon {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
  display: block;
}

.blocked-card {
  background: rgba(218, 54, 51, 0.15);
  border: 2px solid #da3633;
  border-radius: 12px;
  padding: 1.8rem;
  text-align: center;
  color: #f85149;
  margin: 2rem 0;
}

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

/* Tablet & Laptop Responsive Layout */
@media (min-width: 600px) {
  .mobile-content {
    max-width: 720px;
    padding: 2rem 1.5rem;
  }
  .button-pad {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
  .choice-btn {
    min-height: 90px;
    font-size: 2.2rem;
  }
  .choice-btn.btn-e {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .mobile-content {
    max-width: 820px;
  }
  .choice-btn {
    min-height: 100px;
    font-size: 2.4rem;
  }
}

/* Compact Mobile Height (<= 720px) Optimization */
@media (max-height: 720px) and (max-width: 600px) {
  .mobile-header {
    padding: 0.5rem 1rem;
  }
  .player-nick {
    font-size: 1.05rem;
  }
  .mobile-content {
    padding: 0.75rem 0.85rem;
  }
  .mobile-status-card {
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
  }
  .mobile-status-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  .mobile-status-card p {
    font-size: 0.85rem;
  }
  .button-pad {
    gap: 0.6rem;
    padding-bottom: 0.5rem;
  }
  .choice-btn {
    min-height: 58px;
    font-size: 1.5rem;
    border-radius: 10px;
  }
}

/* Student Join Card Responsiveness */
.join-card {
  max-width: 440px;
  margin: 3rem auto;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .join-card {
    margin: 1.25rem 0.75rem;
    padding: 1.5rem 1.15rem;
    border-radius: 14px;
  }
  .join-title {
    font-size: 1.85rem;
  }
  .form-input {
    font-size: 1.15rem;
    padding: 0.75rem 0.85rem;
  }
  .admin-link {
    margin-top: 1.25rem;
  }
}
