/* ============================================================
   CERDAS CERMAT BUZZER - MASTER STYLESHEET
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  min-height: 100vh;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* ===== LANDING ===== */
.landing {
  max-width: 1000px; margin: 0 auto; padding: 60px 20px;
  text-align: center;
}
.landing h1 { font-size: 48px; margin-bottom: 15px; }
.subtitle { font-size: 20px; opacity: 0.8; margin-bottom: 40px; }
.role-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
  margin-bottom: 50px;
}
@media (max-width: 700px) { .role-cards { grid-template-columns: 1fr; } }
.role-card {
  display: block; padding: 40px 30px; border-radius: 20px;
  text-decoration: none; color: white; transition: all 0.3s;
  border: 2px solid rgba(255,255,255,0.1);
}
.role-card.host { background: linear-gradient(135deg, #1f7a55, #12372a); }
.role-card.player { background: linear-gradient(135deg, #2a6f97, #1d4e6b); }
.role-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  border-color: #f4c542;
}
.role-icon { font-size: 72px; margin-bottom: 20px; }
.role-card h2 { font-size: 32px; margin-bottom: 12px; }
.role-card p { opacity: 0.9; font-size: 15px; line-height: 1.6; }

.instructions {
  background: rgba(255,255,255,0.05); padding: 30px;
  border-radius: 16px; text-align: left;
}
.instructions h3 { margin-bottom: 15px; color: #f4c542; }
.instructions ol { padding-left: 25px; line-height: 2; }

/* ===== HEADER ===== */
.header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; background: rgba(255,255,255,0.05);
  border-radius: 16px; margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.header h1 { font-size: 26px; }
.room-code {
  background: #f4c542; color: #12372a; padding: 10px 20px;
  border-radius: 12px; font-weight: bold; font-size: 22px;
  letter-spacing: 3px; margin-left: 10px;
}
.room-info { display: flex; align-items: center; font-size: 14px; }

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 22px; border: none; border-radius: 10px;
  cursor: pointer; font-weight: bold; font-size: 14px;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #2a6f97; color: white; }
.btn-primary:hover:not(:disabled) { background: #1d4e6b; }
.btn-success { background: #1f7a55; color: white; }
.btn-success:hover:not(:disabled) { background: #155c3e; }
.btn-danger { background: #b74d3b; color: white; }
.btn-danger:hover:not(:disabled) { background: #8f3626; }
.btn-warning { background: #f4c542; color: #12372a; }
.btn-warning:hover:not(:disabled) { background: #d4a82f; }
.btn-lg { padding: 18px 36px; font-size: 18px; width: 100%; }

/* ===== CARD ===== */
.card {
  background: rgba(255,255,255,0.08); border-radius: 16px;
  padding: 20px; border: 1px solid rgba(255,255,255,0.1);
}
.card-title {
  font-size: 15px; color: #f4c542; margin-bottom: 15px;
  text-transform: uppercase; letter-spacing: 1px;
  display: flex; justify-content: space-between; align-items: center;
}
.status-badge {
  background: rgba(244,197,66,0.2); color: #f4c542;
  padding: 4px 10px; border-radius: 8px; font-size: 12px;
  text-transform: none; letter-spacing: 0;
}

/* ===== HOST GRID ===== */
.host-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .host-grid { grid-template-columns: 1fr; } }

/* ===== QUESTION DISPLAY ===== */
.question-display {
  min-height: 250px; display: flex; flex-direction: column;
  justify-content: center; padding: 30px;
  background: rgba(0,0,0,0.3); border-radius: 16px;
  text-align: center;
}
.question-display h2 { font-size: 22px; line-height: 1.5; margin-bottom: 15px; }
.question-display .data-box {
  background: rgba(31,122,85,0.3); padding: 15px;
  border-radius: 10px; border-left: 4px solid #f4c542;
  margin: 15px 0; font-size: 15px;
}
.question-display .answer-reveal {
  background: rgba(244,197,66,0.2); padding: 20px;
  border-radius: 10px; margin-top: 20px;
  border: 2px dashed #f4c542; font-size: 15px;
  line-height: 1.6; text-align: left;
}
.placeholder { opacity: 0.5; font-style: italic; }

/* ===== CONTROLS ===== */
.controls-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 15px;
}
.controls-grid .btn { width: 100%; }

/* ===== TIMER PANEL ===== */
.timer-panel {
  margin-top: 15px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  border: 1px solid rgba(244, 197, 66, 0.2);
}
.timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #f4c542;
}
.timer-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  background: rgba(183, 77, 59, 0.3);
  color: #ff9b8a;
  transition: all 0.3s ease;
}
.timer-status.running {
  background: rgba(31, 122, 85, 0.4);
  color: #7dffb3;
  animation: pulseStatus 1.2s ease-in-out infinite;
}
@keyframes pulseStatus {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.timer-display {
  font-size: 56px;
  font-weight: 900;
  text-align: center;
  padding: 12px 0;
  color: #f4c542;
  font-family: 'Courier New', monospace;
  letter-spacing: 4px;
  text-shadow: 0 4px 20px rgba(244, 197, 66, 0.4);
  transition: all 0.3s ease;
}
.timer-display.warning {
  color: #ff9b8a;
  text-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
  animation: warningPulse 0.5s ease-in-out infinite;
}
@keyframes warningPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.timer-display.danger {
  color: #ff6b6b;
  animation: dangerPulse 0.3s ease-in-out infinite;
}
@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.timer-controls {
  display: grid;
  grid-template-columns: 1fr 80px auto auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.timer-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.timer-preset {
  padding: 6px 10px;
  background: rgba(42, 111, 151, 0.4);
  color: #fff;
  border: 1px solid rgba(42, 111, 151, 0.6);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.15s ease;
}
.timer-preset:hover {
  background: rgba(42, 111, 151, 0.7);
  transform: translateY(-1px);
}
.timer-preset.active {
  background: linear-gradient(135deg, #f4c542, #e6a817);
  color: #12372a;
  border-color: #f4c542;
}
.timer-input {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  outline: none;
}
.timer-input:focus {
  border-color: #f4c542;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.2);
}
.timer-controls .btn {
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* Timer untuk player */
.player-timer {
  display: none;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(244, 197, 66, 0.3);
  border-radius: 12px;
  font-size: 28px;
  font-weight: 900;
  color: #f4c542;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  text-align: center;
  min-width: 100px;
  margin-bottom: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.player-timer.show { display: inline-block; }
.player-timer.warning {
  color: #ff9b8a;
  border-color: rgba(255, 107, 107, 0.5);
  animation: warningPulse 0.5s ease-in-out infinite;
}

/* ===== PLAYER LIST ===== */
.player-row {
  display: grid;
  grid-template-columns: 50px 1fr auto 50px;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
  transition: all 0.3s ease;
}
.player-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 197, 66, 0.3);
}
.player-row.buzzed {
  background: linear-gradient(90deg, rgba(244, 197, 66, 0.2), rgba(244, 197, 66, 0.02));
  border: 1px solid rgba(244, 197, 66, 0.5);
}
.player-row.first-buzz {
  background: linear-gradient(90deg, rgba(31, 122, 85, 0.35), rgba(31, 122, 85, 0.05));
  border: 1px solid #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}
.buzz-order {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f4c542, #e6a817);
  color: #12372a;
  border-radius: 12px;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 4px 10px rgba(244, 197, 66, 0.3);
  flex-shrink: 0;
}
.player-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== SCORE PILL ===== */
.player-score-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.25)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 999px !important;
  padding: 4px !important;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.15) !important;
  height: 44px !important;
  min-width: 160px;
}
.score-step {
  width: 36px !important;
  height: 36px !important;
  border: none !important;
  border-radius: 50% !important;
  color: #fff !important;
  font-weight: 900 !important;
  font-size: 20px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: grid !important;
  place-items: center !important;
  line-height: 1 !important;
  font-family: inherit !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}
.score-step:first-child {
  background: linear-gradient(135deg, #b74d3b, #8f3626) !important;
  box-shadow: 0 3px 8px rgba(183, 77, 59, 0.4) !important;
}
.score-step:first-child:hover {
  background: linear-gradient(135deg, #d15c47, #a83f2b) !important;
  transform: scale(1.08) !important;
}
.score-step:last-child {
  background: linear-gradient(135deg, #1f7a55, #155c3e) !important;
  box-shadow: 0 3px 8px rgba(31, 122, 85, 0.4) !important;
}
.score-step:last-child:hover {
  background: linear-gradient(135deg, #2a9d6c, #1a6b47) !important;
  transform: scale(1.08) !important;
}
.score-step:active { transform: scale(0.92) !important; }
.player-score-input {
  width: 74px !important;
  height: 36px !important;
  background: transparent !important;
  border: none !important;
  color: #4ade80 !important;
  font-weight: 900 !important;
  font-size: 18px !important;
  text-align: center !important;
  font-family: 'Courier New', monospace !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  -moz-appearance: textfield !important;
  cursor: text !important;
}
.player-score-input::-webkit-outer-spin-button,
.player-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
.player-score-input:focus {
  color: #f4c542 !important;
  background: rgba(244, 197, 66, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.35) !important;
}
.player-score-input.negative { color: #ff9b8a !important; }

.score-controls { display: flex !important; gap: 4px !important; justify-content: center !important; }
.score-btn {
  width: 36px !important;
  height: 36px !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  font-size: 15px !important;
  color: white !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  transition: 0.2s !important;
}
.score-btn.minus { background: #b74d3b !important; }
.score-btn.delete {
  background: linear-gradient(135deg, #8f3626, #6d2719) !important;
  font-size: 14px !important;
  box-shadow: 0 3px 8px rgba(143, 54, 38, 0.4) !important;
}
.score-btn.delete:hover {
  background: linear-gradient(135deg, #b74d3b, #8f3626) !important;
  transform: translateY(-1px) !important;
}

/* ===== QUESTION LIST ===== */
.question-list { max-height: 400px; overflow-y: auto; }
.question-item {
  padding: 12px; margin-bottom: 8px; border-radius: 8px;
  background: rgba(0,0,0,0.2); cursor: pointer;
  transition: all 0.2s; font-size: 13px;
  display: flex; gap: 10px; align-items: center;
}
.question-item:hover { background: rgba(42,111,151,0.4); }
.question-item.active { background: rgba(244,197,66,0.3); border: 2px solid #f4c542; }
.question-num {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: #f4c542; color: #12372a; border-radius: 8px;
  font-weight: bold; flex-shrink: 0;
}

/* ===== INFO ROOM ===== */
.link-info { font-size: 13px; opacity: 0.8; margin-bottom: 6px; }
.player-link-wrap { display: flex; gap: 8px; margin-bottom: 10px; align-items: stretch; }
.player-link {
  flex: 1; min-width: 0; padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: 'Courier New', monospace; font-size: 12px;
  color: #f4c542; outline: none;
}
.player-link:focus {
  border-color: #f4c542;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.15);
}
.btn-copy {
  padding: 10px 16px;
  background: linear-gradient(135deg, #2a6f97, #1d4e6b);
  color: white; border: none; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 700;
  white-space: nowrap; font-family: inherit;
}
.btn-copy:hover { background: linear-gradient(135deg, #3d84b0, #2a6f97); }
.btn-copy.copied { background: linear-gradient(135deg, #1f7a55, #155c3e); }
.hint { font-size: 12px; opacity: 0.7; line-height: 1.5; }

/* ===== CREATE CARD ===== */
.create-card { max-width: 500px; margin: 60px auto; text-align: center; }
.create-card h2 { margin-bottom: 20px; }
.create-card input {
  width: 100%; padding: 14px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3); color: white;
  font-size: 16px; margin-bottom: 15px;
}
.create-card input:focus { outline: none; border-color: #f4c542; }

/* ===== TOPBAR ===== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap; gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: rgba(255, 255, 255, 0.08);
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1f7a55, #2a6f97);
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
.subject-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(244, 197, 66, 0.25), rgba(244, 197, 66, 0.1));
  border: 1px solid rgba(244, 197, 66, 0.4); border-radius: 999px;
  color: #f4c542; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-switcher-compact {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(0, 0, 0, 0.3); border-radius: 10px;
}
.lang-switcher-compact a {
  padding: 6px 10px; border-radius: 7px; text-decoration: none;
  font-size: 12px; font-weight: 700;
  color: rgba(255, 255, 255, 0.6); transition: all 0.2s ease; white-space: nowrap;
}
.lang-switcher-compact a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lang-switcher-compact a.active {
  background: linear-gradient(135deg, #f4c542, #e6a817); color: #12372a;
}
.btn-logout {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: rgba(183, 77, 59, 0.2);
  color: #ff9b8a; border: 1px solid rgba(183, 77, 59, 0.4);
  border-radius: 10px; text-decoration: none;
  font-size: 13px; font-weight: 700; transition: all 0.2s ease;
}
.btn-logout:hover {
  background: rgba(183, 77, 59, 0.4); color: #fff;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 32, 39, 0.9);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
}
.loading-overlay.hide { display: none; }
.spinner {
  width: 50px; height: 50px;
  border: 4px solid rgba(244, 197, 66, 0.2);
  border-top-color: #f4c542;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #f4c542; font-size: 14px; font-weight: 600; }

/* ===== PLAYER PAGE ===== */
.player-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 60px 20px 20px;
  text-align: center;
}
.player-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.player-topbar-left {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #fff; font-weight: 600;
}
.btn-player-logout {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: rgba(183, 77, 59, 0.25);
  color: #ff9b8a;
  border: 1px solid rgba(183, 77, 59, 0.4);
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: 0.2s;
  font-family: inherit;
}
.btn-player-logout:hover {
  background: rgba(183, 77, 59, 0.45);
  color: #fff;
}

.join-form {
  background: rgba(255,255,255,0.1); padding: 40px;
  border-radius: 20px; max-width: 420px; width: 100%;
}
.join-form h2 { margin-bottom: 25px; font-size: 28px; }
.join-form input {
  width: 100%; padding: 14px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3); color: white;
  font-size: 16px; margin-bottom: 15px;
}
.join-form input:focus { outline: none; border-color: #f4c542; }

.player-info {
  display: flex; gap: 30px; align-items: center;
  background: rgba(255,255,255,0.1); padding: 15px 30px;
  border-radius: 16px; font-size: 18px; margin-bottom: 20px;
}
.player-info strong { color: #f4c542; }
.player-info #myScore { color: #4ade80; font-weight: bold; font-size: 24px; }

.buzzer-wrap {
  width: 100%; max-width: 500px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.status-msg {
  font-size: 18px; padding: 15px 30px;
  border-radius: 12px; background: rgba(0,0,0,0.3);
  min-height: 60px; display: flex; align-items: center;
  text-align: center; max-width: 100%;
}
.buzzer-btn {
  width: 260px; height: 260px; border-radius: 50%;
  border: 8px solid rgba(255,255,255,0.2);
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #b74d3b);
  color: white; font-size: 30px; font-weight: bold;
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 15px 40px rgba(183,77,59,0.5);
  text-transform: uppercase; letter-spacing: 3px;
  font-family: inherit;
}
.buzzer-btn:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 20px 50px rgba(183,77,59,0.7);
}
.buzzer-btn:active:not(:disabled) { transform: scale(0.97); }
.buzzer-btn:disabled {
  background: radial-gradient(circle at 30% 30%, #666, #333);
  cursor: not-allowed; box-shadow: none;
}
.buzzer-btn.locked {
  background: radial-gradient(circle at 30% 30%, #555, #222);
}
.buzzer-btn.winner {
  background: radial-gradient(circle at 30% 30%, #4ade80, #1f7a55);
  animation: winnerPulse 0.6s ease infinite alternate;
}
@keyframes winnerPulse {
  from { box-shadow: 0 0 30px rgba(74,222,128,0.6); }
  to { box-shadow: 0 0 60px rgba(74,222,128,1); }
}
.buzz-order-info { font-size: 16px; color: #f4c542; font-weight: bold; min-height: 24px; }
.question-display-mini {
  padding: 15px; text-align: center; min-height: 80px;
}
.question-display-mini h3 { font-size: 17px; line-height: 1.5; margin-bottom: 8px; }
.question-display-mini .data-box-mini {
  background: rgba(31,122,85,0.3); padding: 10px;
  border-radius: 8px; border-left: 3px solid #f4c542;
  margin-top: 10px; font-size: 13px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 15px 25px; border-radius: 12px;
  font-weight: bold; color: white;
  opacity: 0; transform: translateY(-10px);
  transition: all 0.3s; pointer-events: none;
  max-width: 350px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #1f7a55; }
.toast.error { background: #b74d3b; }
.toast.info { background: #2a6f97; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .timer-controls {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .timer-presets {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .timer-input { grid-column: 1; }
  .timer-display { font-size: 42px; }
}

@media (max-width: 600px) {
  .player-row {
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "order name controls"
      "order score score";
    row-gap: 10px;
    padding: 12px 14px;
  }
  .player-row > div:nth-child(1) { grid-area: order; }
  .player-row > div:nth-child(2) { grid-area: name; }
  .player-row > div:nth-child(3) { grid-area: score; }
  .player-row > div:nth-child(4) { grid-area: controls; }

  .buzz-order { width: 36px; height: 36px; font-size: 15px; }
  .player-name { font-size: 14px; }

  .player-score-wrap { height: 40px; padding: 3px; min-width: 140px; }
  .score-step { width: 32px; height: 32px; font-size: 18px; }
  .player-score-input { width: 60px; height: 32px; font-size: 16px; }
  .score-btn { width: 32px; height: 32px; font-size: 13px; }

  .player-link-wrap { flex-direction: column; }
  .btn-copy { width: 100%; justify-content: center; }

  .header { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 10px 14px; }
  .user-name { font-size: 13px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .subject-badge { font-size: 11px; padding: 6px 10px; }
  .lang-switcher-compact a { padding: 5px 8px; font-size: 11px; }
  .btn-logout { padding: 6px 12px; font-size: 12px; }
}

/* ============================================================
   FILTER BUTTONS (Level I/II/III)
   ============================================================ */
.filter-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.filter-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 18px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border: 2px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  letter-spacing: 0.3px !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  outline: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.filter-button:hover {
  background: rgba(244, 197, 66, 0.15) !important;
  color: #f4c542 !important;
  border-color: rgba(244, 197, 66, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(244, 197, 66, 0.25) !important;
}

.filter-button:active {
  transform: translateY(0) !important;
}

.filter-button.active {
  background: linear-gradient(135deg, #f4c542, #e6a817) !important;
  color: #12372a !important;
  border-color: #f4c542 !important;
  box-shadow: 0 6px 16px rgba(244, 197, 66, 0.4) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.filter-button.active:hover {
  background: linear-gradient(135deg, #ffd966, #f4c542) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(244, 197, 66, 0.5) !important;
}

/* ===== Warna khusus per level (opsional) ===== */
.filter-button[data-filter="level1"]:hover:not(.active) {
  background: rgba(74, 222, 128, 0.15) !important;
  color: #7dffb3 !important;
  border-color: rgba(74, 222, 128, 0.4) !important;
}

.filter-button[data-filter="level2"]:hover:not(.active) {
  background: rgba(244, 197, 66, 0.15) !important;
  color: #f4c542 !important;
  border-color: rgba(244, 197, 66, 0.4) !important;
}

.filter-button[data-filter="level3"]:hover:not(.active) {
  background: rgba(255, 107, 107, 0.15) !important;
  color: #ff9b8a !important;
  border-color: rgba(255, 107, 107, 0.4) !important;
}

/* Responsive */
@media (max-width: 600px) {
  .filter-button {
    padding: 8px 14px !important;
    font-size: 12px !important;
  }
}
/* ============================================================
   FILTER BUTTONS (di dalam card Daftar Soal)
   ============================================================ */
.filter-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 14px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1) !important;
}

.filter-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 7px 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  letter-spacing: 0.2px !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  outline: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.filter-button:hover {
  background: rgba(244, 197, 66, 0.15) !important;
  color: #f4c542 !important;
  border-color: rgba(244, 197, 66, 0.4) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(244, 197, 66, 0.2) !important;
}

.filter-button:active {
  transform: translateY(0) !important;
}

.filter-button.active {
  background: linear-gradient(135deg, #f4c542, #e6a817) !important;
  color: #12372a !important;
  border-color: #f4c542 !important;
  box-shadow: 0 4px 12px rgba(244, 197, 66, 0.4) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.filter-button.active:hover {
  background: linear-gradient(135deg, #ffd966, #f4c542) !important;
  box-shadow: 0 6px 16px rgba(244, 197, 66, 0.5) !important;
}

/* ===== Warna khusus per level ===== */
.filter-button[data-filter="level1"]:hover:not(.active) {
  background: rgba(74, 222, 128, 0.15) !important;
  color: #7dffb3 !important;
  border-color: rgba(74, 222, 128, 0.4) !important;
}

.filter-button[data-filter="level2"]:hover:not(.active) {
  background: rgba(244, 197, 66, 0.15) !important;
  color: #f4c542 !important;
  border-color: rgba(244, 197, 66, 0.4) !important;
}

.filter-button[data-filter="level3"]:hover:not(.active) {
  background: rgba(255, 107, 107, 0.15) !important;
  color: #ff9b8a !important;
  border-color: rgba(255, 107, 107, 0.4) !important;
}

/* Responsive */
@media (max-width: 600px) {
  .filter-button {
    padding: 6px 12px !important;
    font-size: 11px !important;
  }
}
/* ============================================================
   TOMBOL PANDUAN (di topbar)
   ============================================================ */
.btn-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(42, 111, 151, 0.25);
  color: #9ed3f5;
  border: 1px solid rgba(42, 111, 151, 0.5);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-guide:hover {
  background: rgba(42, 111, 151, 0.45);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 111, 151, 0.3);
}
.btn-guide:active {
  transform: translateY(0);
}

/* ============================================================
   POPUP PANDUAN
   ============================================================ */
.guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: guideFadeIn 0.25s ease;
}
.guide-overlay.show { display: flex; }

@keyframes guideFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-modal {
  background: linear-gradient(135deg, #1a2b35 0%, #16232c 100%);
  border: 1px solid rgba(244, 197, 66, 0.2);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: guideSlideUp 0.3s ease;
  overflow: hidden;
}

@keyframes guideSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(31, 122, 85, 0.4), rgba(42, 111, 151, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.guide-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #f4c542;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.guide-close:hover {
  background: rgba(183, 77, 59, 0.6);
  transform: rotate(90deg);
}

.guide-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.guide-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.guide-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f4c542;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.guide-section ol,
.guide-section ul {
  padding-left: 24px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
}

.guide-section li {
  margin-bottom: 4px;
}

.guide-section li strong {
  color: #7dffb3;
  font-weight: 700;
}

.guide-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
  flex-shrink: 0;
}
.guide-footer .btn {
  min-width: 140px;
  padding: 12px 24px;
  font-size: 14px;
}

/* Scrollbar khusus di modal panduan */
.guide-body::-webkit-scrollbar {
  width: 8px;
}
.guide-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.guide-body::-webkit-scrollbar-thumb {
  background: rgba(244, 197, 66, 0.3);
  border-radius: 4px;
}
.guide-body::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 197, 66, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .btn-guide {
    padding: 6px 12px;
    font-size: 12px;
  }
  .btn-guide span:not(:first-child) {
    display: none;  /* Sembunyikan teks, hanya ikon di HP */
  }
  .guide-modal {
    max-height: 92vh;
    border-radius: 16px;
  }
  .guide-header {
    padding: 16px 18px;
  }
  .guide-header h2 {
    font-size: 17px;
  }
  .guide-body {
    padding: 18px;
  }
  .guide-section h3 {
    font-size: 14px;
  }
  .guide-section ol,
  .guide-section ul {
    font-size: 12.5px;
    padding-left: 20px;
  }
  .guide-footer {
    padding: 12px 18px;
  }
  .guide-footer .btn {
    width: 100%;
  }
}

/* ============================================================
   TOMBOL QR + MODAL QR
   ============================================================ */
.btn-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px 18px;
  margin-top: 8px;
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}
.btn-qr:hover {
  background: linear-gradient(135deg, #a569c2, #8e44ad);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(142, 68, 173, 0.5);
}
.btn-qr:active { transform: translateY(0); }

/* ===== MODAL QR ===== */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 39, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: qrFadeIn 0.25s ease;
}
.qr-overlay.show { display: flex; }

@keyframes qrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qr-modal {
  background: linear-gradient(135deg, #1a2b35 0%, #16232c 100%);
  border: 1px solid rgba(244, 197, 66, 0.2);
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: qrSlideUp 0.3s ease;
}

@keyframes qrSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.qr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(142, 68, 173, 0.4), rgba(42, 111, 151, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.qr-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #f4c542;
  margin: 0;
}
.qr-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.qr-close:hover {
  background: rgba(183, 77, 59, 0.6);
  transform: rotate(90deg);
}

.qr-body {
  padding: 24px;
  text-align: center;
}

.qr-code-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  min-width: 220px;
  min-height: 220px;
}

.qr-code {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.qr-code canvas,
.qr-code img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #12372a;
  font-weight: 700;
  font-size: 13px;
  border-radius: 16px;
  background: #fff;
}
.qr-loading.hide { display: none; }

.qr-room-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qr-room-code {
  font-size: 28px;
  font-weight: 900;
  color: #f4c542;
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
  margin-bottom: 16px;
  text-shadow: 0 4px 16px rgba(244, 197, 66, 0.4);
}

.qr-instruction {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 20px;
  padding: 0 10px;
}

.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-qr-download,
.btn-qr-close {
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-qr-download {
  background: linear-gradient(135deg, #1f7a55, #155c3e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 122, 85, 0.3);
}
.btn-qr-download:hover {
  background: linear-gradient(135deg, #2a9d6c, #1a6b47);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 122, 85, 0.5);
}

.btn-qr-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-qr-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .qr-modal { border-radius: 18px; }
  .qr-header { padding: 16px 18px; }
  .qr-header h2 { font-size: 15px; }
  .qr-body { padding: 18px; }
  .qr-code-wrap { padding: 12px; min-width: 190px; min-height: 190px; }
  .qr-room-code { font-size: 22px; letter-spacing: 4px; }
  .qr-actions { flex-direction: column; }
  .btn-qr-download,
  .btn-qr-close { width: 100%; }
}

