/* =========================================
   YEARORNEAR — BOLD + FUN COLOUR SYSTEM
   ========================================= */
:root {
  --yon-purple: #7B4BFF;
  --yon-purple-dark: #5A2EDB;
  --yon-cyan: #00D4FF;
  --yon-lime: #A3FF3F;
  --yon-correct: #4ADE80;
  --yon-wrong: #F87171;
  --yon-bg-lavender: #F3EFFF;
  --yon-bg-white: #FFFFFF;
  --yon-shadow-violet: rgba(123, 75, 255, 0.15);
  --yon-text-main: #1A1A1A;
  --yon-text-secondary: #2A2A2A;
  --yon-gradient-primary: linear-gradient(135deg, #7B4BFF 0%, #5A2EDB 100%);
  --yon-gradient-cyan: linear-gradient(135deg, #00D4FF 0%, #7B4BFF 100%);
}

/* =========================================
   GLOBAL
   ========================================= */
html {
  height: auto;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background: var(--yon-bg-lavender);
  margin: 0;
  padding: 0;
  color: var(--yon-text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Remove arrows in Chrome, Edge, Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove arrows in Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

/* =========================================
   HEADER
   ========================================= */
header {
  width: 100%;
  display: flex;
  justify-content: center;
  background: none;
  padding: 0;
  margin-bottom: 10px;
}

#headerInner {
  max-width: 650px;
  width: 100%;
  padding: 12px 0;
  font-size: 22px;
  font-weight: 700;
  color: #000;
  text-align: center;
  border-bottom: 3px solid #7C3AED;
}

/* =========================================
   SCORE WIDGET
   ========================================= */
#scoreWidget {
  display: none; 
  position: absolute;
  top: -18px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  z-index: 50;
}

#scoreWidget span {
  display: flex;
  align-items: center;
}

#scoreWidget.pop {
  transform: scale(1.1);
  transition: transform 0.15s ease-out;
}



/* =========================================
   MAIN CONTAINER
   ========================================= */
#gameContainer {
  max-width: 650px;
  margin: 20px auto;
  background: var(--yon-bg-white);
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 4px 20px var(--yon-shadow-violet);
  min-height: 400px;
  position: relative;
}

/* =========================================
   GAMEPLAY SCREEN
   ========================================= */
#gamePlayScreen {
  /* no special height or scroll here */
}

/* =========================================
   QUESTION TEXT
   ========================================= */
#questionBox {
  font-size: 22px;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* =========================================
   INPUT AREA
   ========================================= */
#inputArea {
  margin-top: 10px;
}

/* =========================================
   INPUTS
   ========================================= */
input[type="number"],
#nicknameScreen input[type="text"] {
  width: 100%;
  max-width: 140px;
  text-align: center;
  padding: 14px;
  font-size: 20px;
  border: 2px solid var(--yon-purple);
  border-radius: 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus,
#nicknameScreen input[type="text"]:focus {
  border-color: var(--yon-cyan);
  box-shadow: 0 0 8px var(--yon-cyan);
  outline: none;
}

/* =========================================
   PRIMARY BUTTONS
   ========================================= */
button {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  background: var(--yon-purple);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.1s ease, background 0.2s ease;
}

button:hover {
  background: var(--yon-purple-dark);
}

button:active {
  transform: scale(0.96);
}

/* =========================================
   SECONDARY BUTTONS
   ========================================= */
.secondaryButton {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 8px;
  margin-top: 12px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.secondaryButton:hover {
  opacity: 1;
}

/* =========================================
   SUMMARY CARDS
   ========================================= */
.summaryCard {
  background: var(--yon-bg-white);
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--yon-shadow-violet);
  line-height: 1.4;
}



/* --- Stats Card --- */
.statsCard {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    max-width: 360px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.statsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.statsHeader h3 {
    margin: 0;
    font-size: 20px;
}

#statsChevron {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.statsBody {
    margin-top: 12px;
    line-height: 1.5;
    font-size: 16px;
}

/* --- Collapsed State --- */
.statsCard.collapsed .statsBody {
    display: none;
}

.statsCard.collapsed #statsChevron {
    transform: rotate(-90deg);
}


#statsList p {
    background: #eef3ff;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 18px;
}

#statsScreen {
    display: none;
}

/* --- Mobile Behaviour --- */
@media (max-width: 600px) {
    .statsCard {
        padding: 14px;
        margin-top: 12px;
    }

    .statsHeader h3 {
        font-size: 18px;
    }

    .statsBody {
        font-size: 15px;
    }
}



/* =========================================
   MISC
   ========================================= */
.statsLine {
  margin: 6px 0;
  color: var(--yon-text-secondary);
  font-size: 1rem;
}

.flag {
  margin-right: 6px;
  font-size: 1.2em;
}

/* Fade transitions */
.fade {
  opacity: 0;
  display: none;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.fade.show {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.leaderboard-me {
    background-color: #fff3b0 !important;
    color: #000 !important;
    font-weight: bold;
    border-left: 6px solid #f1c40f;
    padding-left: 8px;
}
