/* =====================================================================
   ADQS Exam v2 — Student SPA Tug of War Mobile Gamepad Stylesheet
   Tug of War 4-color landscape gamepad styles:
   #view-tug, .tug-gamepad-grid, portrait rotation media query & overlays.
   ===================================================================== */

#view-tug {
  min-height: 100vh;
  background: var(--bg-body, #0f172a);
  color: var(--text-main, #f8fafc);
  display: flex;
  flex-direction: column;
}

.tug-mobile-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 32px;
}

.tug-mobile-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.tug-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tug-brand-icon {
  font-size: 20px;
}

.tug-header-title {
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
}

.tug-team-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tug-team-badge.is-blue {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.tug-team-badge.is-red {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.tug-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: relative;
}

.tug-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.tug-card-icon {
  font-size: 44px;
  margin-bottom: 12px;
  text-align: center;
}

.tug-card-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  text-align: center;
}

.tug-card-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 16px;
  text-align: center;
  line-height: 1.5;
}

.tug-lobby-pulse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
}

.tug-hint {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 12px;
  margin-top: 16px;
  line-height: 1.4;
  text-align: center;
}

.tug-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tug-q-progress {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
}

.tug-score-pill {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 14px;
  border-radius: 999px;
}

.tug-question-card {
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tug-question-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #ffffff;
  margin: 0;
}

.tug-gamepad-screen {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.tug-gamepad-container {
  display: flex;
  flex-direction: column;
  background: #090d16;
  width: 100%;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Portrait Fallback: Rotate 90deg to enforce horizontal landscape presentation */
@media (orientation: portrait) {
  .tug-gamepad-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    z-index: 9999;
  }
}

@media (orientation: landscape) {
  .tug-gamepad-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
  }
}

.tug-gamepad-header {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tug-gamepad-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.tug-gamepad-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2x2 Grid of 4 Massive Colored Buttons */
.tug-gamepad-grid,
.tug-pad-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  height: calc(100% - 46px);
}

.tug-pad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.25);
  transition: transform 0.08s ease, filter 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tug-pad-btn:active {
  transform: scale(0.94);
  filter: brightness(0.85);
}

.tug-pad-letter {
  font-size: clamp(48px, 14vw, 92px);
  font-weight: 950;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  line-height: 1;
}

/* 4 Distinct Option Colors */
.tug-pad-btn--red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tug-pad-btn--blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.tug-pad-btn--amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tug-pad-btn--green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.tug-pad-btn:disabled {
  opacity: 0.35;
  filter: grayscale(0.5);
  pointer-events: none;
}

/* Green Flash Overlay on Correct Answer */
.tug-flash-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.88);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  animation: tugFlashAnim 0.45s ease-out forwards;
}

.tug-flash-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.tug-flash-icon {
  font-size: 56px;
}

.tug-flash-text {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 1px;
}

@keyframes tugFlashAnim {
  0% { opacity: 0; transform: scale(0.9); }
  30% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.tug-freeze-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 47, 73, 0.88);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.tug-freeze-card {
  text-align: center;
  color: #e0f2fe;
}

.tug-freeze-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.tug-freeze-card h3 {
  font-size: 20px;
  font-weight: 900;
  color: #38bdf8;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.tug-freeze-card p {
  font-size: 13px;
  color: #bae6fd;
  margin: 0 0 16px;
}

.tug-freeze-timer {
  display: inline-block;
  font-family: monospace;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  background: rgba(3, 105, 161, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.5);
  padding: 6px 20px;
  border-radius: 14px;
}

.tug-finish-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}
