/* MinKoot! (민쿳!) 정통 카훗 스타일 실시간 퀴즈 배틀 디자인 시스템 */
:root {
  --bg-deep: #1e0947;
  --bg-main: #33106d;
  --bg-card: #ffffff;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --accent-purple: #6d28d9;
  --accent-gold: #fbbf24;
  --k-red: #e21b3c;
  --k-red-dark: #b0102b;
  --k-blue: #1368ce;
  --k-blue-dark: #0d4a96;
  --k-yellow: #d89e00;
  --k-yellow-dark: #a67800;
  --k-green: #26890c;
  --k-green-dark: #1a6107;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  font-family: 'Pretendard', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 50% 15%, #4c1d95 0%, #250858 55%, #130430 100%);
  color: #ffffff;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* 상단 네비게이션 */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 5, 38, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 3px 0 #4c1d95;
}

.brand-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1e1b4b;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 9px 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nav-btn.active {
  background: #fbbf24;
  color: #111827;
  box-shadow: 0 3px 0 #b45309;
}

/* 공통 컨테이너 */
.main-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* 카드 스타일 */
.white-card {
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(10px);
}

/* 버튼 */
.btn-primary {
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #3b0764;
  transition: transform 0.1s;
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #3b0764;
}

.btn-gold {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #111827;
  border: none;
  padding: 14px 26px;
  border-radius: 14px;
  font-size: 1.12rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #b45309;
  transition: transform 0.1s;
}

.btn-gold:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b45309;
}

.btn-secondary {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* =========================================================
   📱 참가자 PIN 번호 입장 및 컨트롤러 화면
   ========================================================= */
.join-box {
  max-width: 440px;
  margin: 24px auto;
  text-align: center;
}

.join-pin-input {
  width: 100%;
  font-size: 2.1rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 6px;
  padding: 14px;
  border: 3px solid #cbd5e1;
  border-radius: 16px;
  margin-bottom: 14px;
  color: #1e1b4b;
  background: #f8fafc;
}

.join-pin-input:focus, .join-name-input:focus {
  outline: none;
  border-color: #7c3aed;
  background: #fff;
}

.join-name-input {
  width: 100%;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  padding: 14px;
  border: 3px solid #cbd5e1;
  border-radius: 16px;
  margin-bottom: 14px;
  color: #111827;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

.avatar-chip {
  font-size: 1.5rem;
  padding: 6px 0;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
}

.avatar-chip.selected {
  border-color: #7c3aed;
  background: #ede9fe;
  transform: scale(1.1);
}

/* 휴대폰 실시간 게임 컨트롤러 */
.player-controller {
  max-width: 560px;
  margin: 0 auto;
  min-height: calc(100dvh - 95px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.player-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.boost-banner-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid #fbbf24;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: pulseGold 1.6s infinite;
}

.boost-banner-btn.active-boost {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: #ffffff;
  border-color: #fde047;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.8);
}

@keyframes pulseGold {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* 카훗 시그니처 4색 대형 버튼 그리드 */
.kahoot-pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 360px;
}

.kahoot-pad-grid.ox-mode {
  grid-template-rows: 1fr;
}

.k-btn {
  border: none;
  border-radius: 22px;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  transition: transform 0.08s, filter 0.12s;
  user-select: none;
}

.k-btn:active {
  transform: translateY(5px);
}

.k-btn .k-shape {
  font-size: 3.4rem;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.k-btn .k-num {
  font-size: 1.45rem;
  font-weight: 900;
}

.k-btn .k-label-sub {
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.95;
  text-align: center;
  word-break: keep-all;
}

.k-red { background: var(--k-red); box-shadow: 0 7px 0 var(--k-red-dark); }
.k-blue { background: var(--k-blue); box-shadow: 0 7px 0 var(--k-blue-dark); }
.k-yellow { background: var(--k-yellow); box-shadow: 0 7px 0 var(--k-yellow-dark); }
.k-green { background: var(--k-green); box-shadow: 0 7px 0 var(--k-green-dark); }

/* =========================================================
   💻 PC 호스트 대기실 및 대형 문제 화면
   ========================================================= */
.lobby-pin-banner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
  align-items: center;
  background: #ffffff;
  color: #111827;
  border-radius: 26px;
  padding: 26px 30px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 22px;
}

.giant-pin-number {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #4c1d95;
  line-height: 1.05;
  margin: 8px 0;
}

.qr-frame {
  width: 210px;
  height: 210px;
  background: #fff;
  border: 4px solid #4c1d95;
  border-radius: 20px;
  padding: 8px;
  margin: 0 auto;
}

.lobby-players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  min-height: 76px;
}

.player-pill {
  background: #ffffff;
  color: #111827;
  padding: 11px 20px;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  animation: popIn 0.25s ease-out;
  transition: transform 0.12s, background 0.15s;
}

.player-pill.kickable {
  cursor: pointer;
}

.player-pill.kickable:hover {
  background: #fee2e2;
  color: #b91c1c;
  text-decoration: line-through;
  transform: scale(1.04);
}

.join-toast-banner {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.12rem;
  padding: 11px 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  animation: popIn 0.25s ease-out;
}

.kahoot-waiting-board {
  background: rgba(15, 5, 38, 0.52);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 20px;
  margin-top: 14px;
}

.app-footer {
  max-width: 1220px;
  margin: 20px auto 32px;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.88rem;
  color: #d8b4fe;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-footer a {
  color: #fde047;
  text-decoration: none;
  font-weight: 700;
}

.app-footer a:hover {
  text-decoration: underline;
}

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 호스트 문제 진행 화면 */
.host-question-box {
  background: #ffffff;
  color: #111827;
  border-radius: 24px;
  padding: 28px 32px;
  text-align: center;
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  word-break: keep-all;
}

.host-stage-middle {
  display: grid;
  grid-template-columns: 150px 1fr 160px;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.timer-circle {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: #6d28d9;
  border: 6px solid #fbbf24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 900;
  margin: 0 auto;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.answer-counter-box {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
}

.host-question-img {
  max-height: 250px;
  max-width: 100%;
  border-radius: 18px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.host-choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.host-choice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 18px;
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  min-height: 96px;
  position: relative;
}

.host-choice-card.dimmed {
  opacity: 0.32;
  filter: grayscale(40%);
}

.host-choice-card.correct-highlight {
  outline: 5px solid #fde047;
  box-shadow: 0 0 28px rgba(253, 224, 71, 0.85);
  transform: scale(1.02);
}

/* 리더보드 & 시상대 */
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  padding: 14px 20px;
  border-radius: 16px;
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  margin: 32px 0 24px;
  min-height: 290px;
}

.podium-col {
  width: 190px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-bar {
  width: 100%;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 18px;
  color: #111827;
  font-weight: 900;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.3);
}

.podium-1 { height: 210px; background: linear-gradient(180deg, #fde047, #eab308); }
.podium-2 { height: 155px; background: linear-gradient(180deg, #e5e7eb, #9ca3af); }
.podium-3 { height: 120px; background: linear-gradient(180deg, #fdba74, #d97706); }

/* 문제 제작소 스타일 */
.creator-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.subtab-btn {
  padding: 11px 18px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.subtab-btn.active {
  background: #ffffff;
  color: #3b0764;
  border-color: #ffffff;
}

.question-editor-item {
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  background: #f9fafb;
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .lobby-pin-banner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .giant-pin-number {
    font-size: 3.1rem;
  }
  .host-stage-middle {
    grid-template-columns: 1fr;
  }
  .host-choices-grid {
    grid-template-columns: 1fr;
  }
  .host-question-box {
    font-size: 1.45rem;
    padding: 18px;
  }
}
