/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: #131415;
    color: #fff;
    min-height: 100vh;
}

/* Center the quiz only on the quiz page */
body:has(#quiz-card) main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body:has(.explanation-card) main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

header {
    background: transparent;
    color: #fff;
    padding: 2.5rem 0 0 0;
    text-align: center;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 16px #00000044;
    margin-bottom: 1em !important
}

main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0 !important;
}

.trick-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.trick-item {
    margin-bottom: 0 !important;
    gap: 0.7rem;
    padding: 0.2rem 0.7rem;
}

.trick-card {
    background: #23272f;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 2.7rem 2.7rem 2.2rem 2.7rem;
    width: 480px;
    max-width: 98vw;
    font-size: 1.08rem;
    text-decoration: none;
    color: #fff;
    border: 1px solid #23272f;
    transition: box-shadow 0.15s, border 0.15s, background 0.15s;
    position: relative;
    overflow: hidden;
}

.trick-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.28);
    border: 1px solid #444;
    background: #23282f;
}

.trick-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.trick-card p {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.01rem;
    line-height: 1.5;
}

button {
    background: #23272f;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 0.7rem 1.2rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border 0.15s;
}
button:hover {
    background: #1a1d23;
    border: 1px solid #10a37f;
    color: #10a37f;
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

#score {
    font-weight: bold;
    font-size: 1.2rem;
    color: #10a37f;
    transition: color 0.2s;
}

.score-animate {
    animation: score-pop 0.4s;
}

@keyframes score-pop {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 #10a37f;
    }
    50% {
        transform: scale(1.35);
        text-shadow: 0 0 12px #10a37f, 0 0 24px #10a37f;
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 #10a37f;
    }
}

.quiz-question {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #fff;
}

input[type="number"], input[type="text"] {
    background: transparent;
    border: none;
    border-bottom: 2px solid #444;
    color: #fff;
    font-size: 1.3rem;
    width: 100%;
    padding: 0.5rem 0;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.2s;
    box-shadow: none;
    border-radius: 0;
}
input[type="number"]:focus, input[type="text"]:focus {
    border-bottom: 2px solid #10a37f;
    background: transparent;
}

.input-flash-wrong {
    animation: flash-wrong 0.3s;
}
.input-flash-correct {
    animation: flash-correct 0.3s;
}
@keyframes flash-wrong {
    0% { background: #181c24; }
    50% { background: #ff6b6b; }
    100% { background: #181c24; }
}
@keyframes flash-correct {
    0% { background: #181c24; }
    50% { background: #10a37f; }
    100% { background: #181c24; }
}

.final-score-animate {
    animation: final-score-pop 0.7s;
    color: #10a37f;
}
@keyframes final-score-pop {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 #10a37f;
    }
    40% {
        transform: scale(1.5);
        text-shadow: 0 0 16px #10a37f, 0 0 32px #10a37f;
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 #10a37f;
    }
}

#final-score {
    font-size: 2.7rem;
    font-weight: 900;
    color: #10a37f;
    display: block;
    margin-top: 0.1em;
}

.explanation-card {
    max-width: 720px;
    width: 100%;
    padding: 2.2rem 2.2rem 1.7rem 2.2rem;
    font-size: 1.08rem !important;
    line-height: 1.7;
}

.explanation-card p {
    margin-bottom: 1.2em;
    font-size: 1.08rem !important;
    line-height: 1.7;
}

#quiz-card.quiz-complete {
    max-width: 520px;
    width: 100%;
    min-height: 340px;
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quiz-complete p {
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.quiz-complete .score-label {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    display: block;
    margin-bottom: 0.2em;
}

@keyframes countdown-fade {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    20% {
        opacity: 1;
        transform: scale(1.1);
    }
    80% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.7);
    }
}

.countdown-anim {
    animation: countdown-fade 1s;
}

/* Subject filter menu styles */
.subject-filter-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 2.2rem 0;
  justify-content: center;
  position: relative;
  top: -1.2rem;
  min-height: 48px;
}

.subject-label {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 600;
  margin-right: 0.7rem;
  letter-spacing: 0.02em;
}

.subject-btn {
  background: #222;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
  font-size: 1.25rem;
  padding: 0.18em 0.45em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  outline: none;
  margin-top: 0.2rem;
}

.subject-btn.selected,
.subject-btn:active {
  background: #1ec773;
  color: #fff;
  border: 2px solid #1ec773;
  font-weight: bold;
  box-shadow: 0 0 0 2px #1ec773;
}

.learn-title-row {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 1.1rem;
}
.learn-title-text {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-right: 0.7em;
}
.learn-title-line {
  flex: 1 1 auto;
  border: none;
  border-top: 1.2px solid #444;
  margin: 0;
}

.practice-title-row {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 540px;
  margin: 0 auto 1.1rem auto;
}
.practice-title-text {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-right: 0.7em;
}
.practice-title-line {
  flex: 1 1 auto;
  border: none;
  border-top: 1.2px solid #444;
  margin: 0;
}

/* Top navigation bar - edge alignment update */
.top-nav {
  width: 100%;
  background: #23272f;
  color: #fff;
  height: 68px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  z-index: 100;
}
.nav-content {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  height: 68px;
  gap: 2.2rem;
}
.nav-title {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  user-select: none;
  text-align: left;
  flex: 1;
  padding-left: 2.5rem;
  line-height: 1;
}
.nav-account-btn {
  background: #353a45;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-left: 0;
  margin-right: 2.5rem;
}
.nav-account-btn:hover {
  background: #444b58;
  color: #10a37f;
}

.gold-right {
  background: linear-gradient(to right, #23272f 60%, gold 100%);
  border-right: 6px solid gold;
}

.trick-card.completed-trick {
  border: 3px solid #22c55e; /* green-500 */
  box-shadow: 0 0 0 4px #bbf7d0; /* subtle green glow */
}

.trick-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
  
.trick-item {
    display: flex !important;         /* FORCE horizontal layout */
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    background-color: transparent;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    color: white;
    transition: background 0.2s ease;
}
  
.trick-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
  
.circle-card {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 55%, #bae6fd 85%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #131415;
    font-size: 1.05rem;
    box-shadow: 0 4px 16px 0 #0002, 0 1.5px 6px 0 #60a5fa33;
    position: relative;
}
.circle-card::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 22px;
    width: 22px;
    height: 12px;
    background: linear-gradient(135deg, #fff8 60%, #fff0 100%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.7;
}
  
.trick-title {
    font-size: 1.6rem;
    font-weight: 400;
    color: white;
    white-space: nowrap;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    letter-spacing: -0.01em;
}
  
.trick-item.completed-trick .circle-card {
    border: 3px solid #22c55e !important;
    box-shadow: 0 0 0 3px #bbf7d0;
}
  
/* Zigzag pattern for trick cards */
.trick-list .trick-item {
  transition: transform 0.3s, box-shadow 0.2s;
}
.trick-list .trick-item.zigzag-left {
  transform: translateX(-1.75vw);
}
.trick-list .trick-item.zigzag-right {
  transform: translateX(1.75vw);
}
@media (max-width: 700px) {
  .trick-list .trick-item.zigzag-left,
  .trick-list .trick-item.zigzag-right {
    transform: none;
  }
}

.trick-list .trick-item.wave0 { transform: translateX(0); }
.trick-list .trick-item.wave1 { transform: translateX(3vw); }
.trick-list .trick-item.wave2 { transform: translateX(6vw); }
.trick-list .trick-item.wave3 { transform: translateX(7.6vw); }
.trick-list .trick-item.wave4 { transform: translateX(8vw); }
.trick-list .trick-item.wave5 { transform: translateX(7.6vw); }
.trick-list .trick-item.wave6 { transform: translateX(6vw); }
.trick-list .trick-item.wave7 { transform: translateX(3vw); }
.trick-list .trick-item.wave8 { transform: translateX(0); }
.trick-list .trick-item.wave9 { transform: translateX(-3vw); }
.trick-list .trick-item.wave10 { transform: translateX(-6vw); }
.trick-list .trick-item.wave11 { transform: translateX(-7.6vw); }
.trick-list .trick-item.wave12 { transform: translateX(-8vw); }
.trick-list .trick-item.wave13 { transform: translateX(-7.6vw); }
.trick-list .trick-item.wave14 { transform: translateX(-6vw); }
.trick-list .trick-item.wave15 { transform: translateX(-3vw); }
@media (max-width: 700px) {
  .trick-list .trick-item.wave0,
  .trick-list .trick-item.wave1,
  .trick-list .trick-item.wave2,
  .trick-list .trick-item.wave3,
  .trick-list .trick-item.wave4,
  .trick-list .trick-item.wave5,
  .trick-list .trick-item.wave6,
  .trick-list .trick-item.wave7,
  .trick-list .trick-item.wave8,
  .trick-list .trick-item.wave9,
  .trick-list .trick-item.wave10,
  .trick-list .trick-item.wave11,
  .trick-list .trick-item.wave12,
  .trick-list .trick-item.wave13,
  .trick-list .trick-item.wave14,
  .trick-list .trick-item.wave15 {
    transform: none;
  }
}

/* Half-gap above and below section divider for perfect rhythm */
.trick-list .trick-item:last-child + .section-header-container .section-divider {
  margin-top: 0.15rem;
}
.section-header-container + .trick-list .trick-item:first-child {
  margin-top: 0.15rem;
}

.section-divider-row {
  display: flex;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-1 * (100vw - 100%) / 2);
  margin-right: calc(-1 * (100vw - 100%) / 2);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-left: 1.5rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.section-label {
  font-size: 1.08rem;
  font-weight: 400;
  color: #10a37f;
  margin-right: 1.1rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.subject-divider {
  flex: 1 1 auto;
  border: none;
  border-top: 2px solid #cbd5e1;
  height: 0;
  margin: 0;
  position: relative;
  top: 0;
  z-index: 0;
  pointer-events: none;
}

#progress-bar-container {
  max-width: 160px;
  min-width: 90px;
  height: 2.4rem;
  margin: 0 0.5rem 0 0;
  padding: 0.2rem 0.7rem 0.2rem 0.7rem;
  background: #181c24;
  border: 1px solid #23272f;
  border-radius: 6px;
  box-shadow: 0 1px 2px #0001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#progress-label {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 400;
  color: #b5bfc9;
  margin-bottom: 0.18rem;
  letter-spacing: 0.01em;
}
#progress-bar-bg {
  width: 100%;
  height: 13px;
  background: #23272f;
  border-radius: 6px;
  box-shadow: none;
  overflow: hidden;
  border: 1px solid #22262c;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10a37f 0%, #22c55e 100%);
  border-radius: 6px 0 0 6px;
  transition: width 0.5s cubic-bezier(.4,2,.3,1);
}
@media (max-width: 600px) {
  .nav-content {
    gap: 0.7rem;
  }
  #progress-bar-container {
    max-width: 90px;
    min-width: 50px;
    height: 1.6rem;
    padding: 0.08rem 0.2rem;
    border-radius: 6px;
  }
  #progress-label {
    font-size: 0.75rem;
    margin-bottom: 0.09rem;
  }
  #progress-bar-bg {
    height: 7px;
    border-radius: 6px;
  }
  #progress-bar {
    border-radius: 6px 0 0 6px;
  }
}

.bronze-circle {
  background: linear-gradient(180deg, #f9e7c2 0%, #e6b980 60%, #b87333 100%) !important;
  border: 1.5px solid #b87333 !important;
}

.trick-list > .section-divider-row:first-child {
  margin-top: 0 !important;
}

.leaderboard-card {
  background: #23272f;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 2.2rem 2.2rem 1.5rem 2.2rem;
  width: 480px;
  max-width: 98vw;
  font-size: 1.08rem;
  color: #fff;
  border: 1px solid #23272f;
  margin: 2.2rem auto 0 auto;
}
.leaderboard-current-user {
  font-weight: bold;
  color: #10a37f;
}

#homepage-leaderboard-card {
  margin-bottom: 8rem;
}
@media (max-width: 600px) {
  #homepage-leaderboard-card {
    margin-bottom: 4rem;
  }
}
  
  