/* =========================================================
   TYPE-O-METER PRO (GAME 4) - GLASSMORPHISM STYLESHEET
   Matches Ki Hikila Typing Master Design System
   ========================================================= */

:root {
  --primary-color: #06b6d4;
  --secondary-color: #3b82f6;
  --accent-purple: #8b5cf6;
  --card-glass-bg: rgba(255, 255, 255, 0.08);
  --card-glass-border: rgba(255, 255, 255, 0.16);
  --dark-input-bg: rgba(15, 23, 42, 0.55);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #f1f5f9;
  background-color: #090d16;
  min-height: 100vh;
  line-height: 1.6;
}

/* =========================================================
   MODE SELECTOR BAR
   ========================================================= */

.game4-mode-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 28px;
  width: 100%;
}

.mode-bar-glass {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
  justify-content: center;
}

.mode-bar-glass .clock {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.test-options {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}

.mode {
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  transition: all 0.25s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.mode:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(6, 182, 212, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.mode.selected,
.mode.active {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.options {
  display: inline-flex;
  gap: 6px;
}

.option {
  padding: 6px 14px;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.option:hover {
  background: #06b6d4;
  color: #ffffff;
}

.hide {
  display: none !important;
}

.inline {
  display: inline-block;
}

/* =========================================================
   GAME PANELS (TIME MODE & INFINITY MODE)
   ========================================================= */

.glass-game-panel {
  background: var(--card-glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-glass-border);
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  margin: 20px 0 36px;
  width: 100%;
}

.panel-header {
  text-align: center;
  margin-bottom: 26px;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  border-radius: 50px;
  margin-bottom: 10px;
}

.panel-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.panel-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

/* =========================================================
   LIVE STATS & RESULT GRID
   ========================================================= */

.glass-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.stat-tile {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 95px;
  transition: all 0.25s ease;
}

.stat-tile:hover {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(15, 23, 42, 0.7);
}

.stat-tile .result-data {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-tile .result-head {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
}

.stat-tile-clock {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.15));
  border-color: rgba(6, 182, 212, 0.35);
}

.stat-tile-clock p {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.stat-tile-clock .mini {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
}

/* =========================================================
   PROMPT TEXT BOX
   ========================================================= */

.prompt-box-wrap {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 6px 14px;
  border-radius: 50px;
  color: #38bdf8;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.timer i {
  font-size: 0.95rem;
}

.para-type,
.infinity-user-type {
  font-size: 1.2rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  word-break: normal;
  word-wrap: break-word;
  text-align: left;
  user-select: none;
}

.highlight {
  background: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
  border-radius: 4px;
  padding: 2px 2px;
  outline: 1px solid rgba(6, 182, 212, 0.45);
}

.highlight-final {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  border-radius: 4px;
  padding: 2px 2px;
  outline: 1px solid rgba(34, 197, 94, 0.45);
}

/* =========================================================
   TYPING INDICATOR & TEXTAREA
   ========================================================= */

.type-here-div {
  text-align: center;
  margin: 10px 0 14px;
}

.type-here-anim {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 50px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  animation: pulseIndicator 2s infinite ease-in-out;
}

@keyframes pulseIndicator {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.03); opacity: 1; border-color: rgba(6, 182, 212, 0.7); }
}

.triangle-down {
  display: none;
}

.type-area {
  width: 100%;
  background: var(--dark-input-bg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: #ffffff;
  font-size: 1.15rem;
  font-family: inherit;
  line-height: 1.6;
  padding: 16px 20px;
  resize: vertical;
  min-height: 120px;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  display: block;
  margin-bottom: 20px;
}

.type-area:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.type-area:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.35);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 11px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.55);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.reset {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  box-shadow: none;
}

.btn.reset:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.goto-samples {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.goto-samples:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* =========================================================
   WORD BIN (MISTAKES)
   ========================================================= */

.error-div {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  padding: 18px 22px;
  margin-top: 10px;
}

.error-head {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.error-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(248, 113, 113, 0.8);
}

.error-container {
  width: 100%;
}

.error.error-bundle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.95rem;
}

.error-word {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
}

/* =========================================================
   SAMPLE SCRIPTS LIBRARY
   ========================================================= */

.sample-container {
  background: var(--card-glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-glass-border);
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  margin: 36px 0;
}

.sample-head {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  margin-bottom: 6px;
}

.sample-container .sub-head {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 28px;
}

.sample {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.sample:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.sample a.smokewhite {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.65;
  display: block;
}

.sample:hover a.smokewhite {
  color: #ffffff;
}

.separator {
  display: none;
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

@media screen and (max-width: 860px) {
  .glass-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 540px) {
  .glass-game-panel {
    padding: 20px 16px;
  }
  .glass-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-tile {
    min-height: 80px;
    padding: 10px;
  }
  .stat-tile .result-data {
    font-size: 1.5rem;
  }
  .mode {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}
