/* ===== BINARIO 9 E 3/4 - Main Stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700;900&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --gold-dark: #8b6914;
  --brown-dark: #2a1a0a;
  --brown: #4a2c10;
  --brown-mid: #6b3a1a;
  --brown-light: #8b5e3c;
  --parchment: #f4e4c1;
  --parchment-dark: #d4c4a1;
  --parchment-light: #faf3e0;
  --red-gryffindor: #740001;
  --gold-gryffindor: #d3a625;
  --green-slytherin: #1a472a;
  --silver-slytherin: #aaaaaa;
  --blue-ravenclaw: #0e1a40;
  --bronze-ravenclaw: #946b2d;
  --yellow-hufflepuff: #ecb939;
  --black-hufflepuff: #372e29;
  --text-dark: #2a1a0a;
  --text-light: #f4e4c1;
}

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

body {
  font-family: 'Lora', Georgia, serif;
  background: #0a0a0a;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== BACKGROUND ===== */
.page-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    linear-gradient(180deg, rgba(10,5,0,0.15) 0%, rgba(10,5,0,0.05) 50%, rgba(10,5,0,0.3) 100%),
    url('/images/background.jpg') center/cover no-repeat;
  background-color: #1a0e05;
  z-index: -1;
}

/* Ultrawide screens: use split left/right images */
@media (min-width: 2200px) {
  .page-bg {
    background:
      linear-gradient(180deg, rgba(10,5,0,0.15) 0%, rgba(10,5,0,0.05) 50%, rgba(10,5,0,0.3) 100%);
    background-color: #1a0e05;
  }
  .page-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 50%;
    background: url('/images/background_left.jpg') right center/cover no-repeat;
    z-index: -1;
  }
  .page-bg::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 50%;
    background: url('/images/background_right.jpg') left center/cover no-repeat;
    z-index: -1;
  }
}

/* ===== MAIN WRAPPER ===== */
.site-wrapper {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.site-header {
  position: relative;
  text-align: center;
  padding: 0;
  background: transparent;
  margin-bottom: 0;
}

.site-header::before,
.site-header::after {
  content: none;
}

.logo-container {
  display: block;
  line-height: 0;
}

.logo-container .header-desktop {
  width: 100%;
  height: auto;
  display: block;
}

.logo-container .header-mobile {
  display: none;
  height: 120px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.site-subtitle {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--brown-mid);
  letter-spacing: 2px;
  margin-top: -5px;
}

/* ===== NAVIGATION BAR ===== */
.main-nav {
  background: linear-gradient(180deg, var(--brown-dark) 0%, #1a0e05 100%);
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.nav-list a {
  display: block;
  padding: 12px 18px;
  color: var(--gold-light);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: #fff;
  background: rgba(201,168,76,0.15);
  text-shadow: 0 0 10px rgba(201,168,76,0.5);
}

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 80%;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px 15px;
}

/* ===== CONTENT AREA - Parchment ===== */
.content-area {
  flex: 1;
  margin: 25px 15px;
  background:
    radial-gradient(ellipse at center, var(--parchment-light) 0%, var(--parchment) 60%, var(--parchment-dark) 100%);
  border-radius: 8px;
  padding: 35px 30px;
  box-shadow:
    0 0 0 3px var(--brown-light),
    0 0 0 6px var(--gold-dark),
    0 8px 30px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}

/* Aged parchment texture */
.content-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(139,94,60,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139,94,60,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(139,94,60,0.04) 100%);
  pointer-events: none;
}

/* Burnt edges */
.content-area::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(100,60,20,0.15);
  pointer-events: none;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 15px;
  color: var(--gold-dark);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 8px;
}

.social-links a {
  color: var(--gold);
  font-size: 1.2rem;
  transition: color 0.3s, transform 0.3s;
  text-decoration: none;
}

.social-links a:hover {
  color: #fff;
  transform: scale(1.2);
}

/* ===== HOMEPAGE CARDS ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  padding: 10px;
}

.game-card {
  background: linear-gradient(145deg, var(--parchment-light) 0%, var(--parchment-dark) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none;
  color: var(--text-dark);
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(201,168,76,0.3);
  border-color: var(--gold);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.1), transparent);
  transition: left 0.5s;
}

.game-card:hover::before {
  left: 100%;
}

.game-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  transition: transform 0.3s;
}

.game-card:hover img {
  transform: scale(1.1) rotate(-3deg);
}

.game-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--brown-dark);
  margin-bottom: 6px;
}

.game-card p {
  font-size: 0.85rem;
  color: var(--brown-mid);
  line-height: 1.4;
}

/* ===== PAGE TITLES ===== */
.page-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--brown-dark);
  text-align: center;
  margin-bottom: 25px;
  text-shadow: 1px 1px 0 rgba(201,168,76,0.3);
}

.page-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 10px auto 0;
}

/* ===== FORMS (Login/Register) ===== */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--gold-dark);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--brown-light);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  transition: all 0.3s;
}

.auth-tab.active {
  color: var(--brown-dark);
  border-bottom: 3px solid var(--gold);
  margin-bottom: -2px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--brown);
  margin-bottom: 5px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--parchment-dark);
  border-radius: 6px;
  background: var(--parchment-light);
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  color: var(--brown-dark);
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,0.3);
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--brown-dark);
  width: 100%;
  box-shadow: 0 3px 10px rgba(139,105,20,0.3);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139,105,20,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}

.btn-secondary:hover {
  background: rgba(201,168,76,0.1);
}

.error-msg {
  color: var(--red-gryffindor);
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
}

.success-msg {
  color: var(--green-slytherin);
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
}

/* ===== QUIZ STYLES ===== */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--brown);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--parchment-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 20px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  padding: 14px 18px;
  background: var(--parchment-light);
  border: 2px solid var(--parchment-dark);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  transition: all 0.3s;
  text-align: left;
}

@media (hover: hover) {
  .quiz-option:hover {
    border-color: var(--gold);
    background: rgba(201,168,76,0.1);
  }
}
.quiz-option:focus {
  outline: none;
}

.quiz-option.correct {
  border-color: var(--green-slytherin);
  background: rgba(26,71,42,0.1);
}

.quiz-option.wrong {
  border-color: var(--red-gryffindor);
  background: rgba(116,0,1,0.1);
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== WORD SEARCH (Crucipuzzle) ===== */
.puzzle-container {
  text-align: center;
}

.puzzle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.puzzle-timer {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--brown-dark);
}

.puzzle-score {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold-dark);
}

.word-grid {
  display: inline-grid;
  gap: 2px;
  background: var(--brown-dark);
  padding: 3px;
  border-radius: 6px;
  margin-bottom: 20px;
  user-select: none;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.word-grid .cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment-light);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brown-dark);
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 2px;
}

.word-grid .cell:hover {
  background: var(--gold-light);
}

.word-grid .cell.selected {
  background: var(--gold);
  color: var(--brown-dark);
}

.word-grid .cell.found {
  background: #d4edda;
  color: #155724;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.word-list .word {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  padding: 5px 12px;
  background: var(--parchment-dark);
  border-radius: 15px;
  color: var(--brown);
  transition: all 0.3s;
}

.word-list .word.found {
  text-decoration: line-through;
  background: rgba(26,71,42,0.15);
  color: var(--green-slytherin);
}

/* ===== CROSSWORD (Cruciverba) ===== */
.crossword-container {
  text-align: center;
}

.crossword-grid {
  display: inline-grid;
  gap: 1px;
  background: var(--brown-dark);
  padding: 2px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.crossword-grid .cell {
  width: 38px;
  height: 38px;
  position: relative;
  background: var(--parchment-light);
}

.crossword-grid .cell.black {
  background: var(--brown-dark);
}

.crossword-grid .cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown-dark);
  text-transform: uppercase;
  caret-color: var(--gold);
}

.crossword-grid .cell input:focus {
  outline: none;
  background: rgba(201,168,76,0.2);
}

.crossword-grid .cell .cell-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.55rem;
  color: var(--brown-mid);
  font-weight: 600;
  pointer-events: none;
}

.crossword-grid .cell.correct {
  background: #d4edda;
}
.crossword-grid .cell.correct input {
  color: #155724;
}

.crossword-grid .cell.wrong {
  background: #f8d7da;
}
.crossword-grid .cell.wrong input {
  color: #721c24;
}

.clues-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  text-align: left;
  margin-top: 20px;
}

.clues-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--brown-dark);
  margin-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 5px;
}

.clue {
  font-size: 0.85rem;
  padding: 5px 0;
  color: var(--brown);
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1.4;
}

.clue:hover {
  color: var(--gold-dark);
}

.clue.solved {
  color: var(--green-slytherin);
  text-decoration: line-through;
}

.clue span.clue-num {
  font-weight: 700;
  color: var(--brown-dark);
  margin-right: 4px;
}

/* ===== SORTING HAT ===== */
.sorting-container {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
}

.hat-image {
  width: 150px;
  margin: 0 auto 20px;
  animation: hatFloat 3s ease-in-out infinite;
}

.hat-image img {
  width: 100%;
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

@keyframes hatFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.hat-speech {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--brown);
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(201,168,76,0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  line-height: 1.6;
}

.sorting-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sorting-option {
  padding: 14px 20px;
  background: var(--parchment-light);
  border: 2px solid var(--parchment-dark);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  transition: all 0.3s;
  text-align: left;
}

.sorting-option:hover {
  border-color: var(--gold);
  transform: translateX(5px);
}

/* House result */
.house-result {
  display: none;
  text-align: center;
  padding: 30px;
}

.house-result.show { display: block; }

.house-result .house-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.2rem;
  margin: 15px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.house-result .house-desc {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 450px;
  margin: 0 auto;
}

.house-result.grifondoro .house-name { color: var(--red-gryffindor); }
.house-result.serpeverde .house-name { color: var(--green-slytherin); }
.house-result.corvonero .house-name { color: var(--blue-ravenclaw); }
.house-result.tassorosso .house-name { color: var(--black-hufflepuff); }

/* House crest placeholder */
.house-crest {
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.grifondoro .house-crest { background: linear-gradient(135deg, var(--red-gryffindor), #ae0001); }
.serpeverde .house-crest { background: linear-gradient(135deg, var(--green-slytherin), #2a623d); }
.corvonero .house-crest { background: linear-gradient(135deg, var(--blue-ravenclaw), #222f5b); }
.tassorosso .house-crest { background: linear-gradient(135deg, var(--yellow-hufflepuff), #f0c75e); }

/* ===== LEADERBOARD ===== */
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.lb-tab {
  padding: 8px 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--gold-dark);
  border-radius: 20px;
  background: transparent;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.3s;
}

.lb-tab.active,
.lb-tab:hover {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard-table th {
  font-family: 'Cinzel', serif;
  padding: 10px;
  border-bottom: 2px solid var(--gold);
  color: var(--brown-dark);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.leaderboard-table td {
  padding: 10px;
  border-bottom: 1px solid var(--parchment-dark);
  text-align: center;
}

.leaderboard-table tr:hover td {
  background: rgba(201,168,76,0.08);
}

.rank-1 { color: var(--gold); font-weight: 700; }
.rank-2 { color: var(--silver-slytherin); font-weight: 600; }
.rank-3 { color: var(--bronze-ravenclaw); font-weight: 600; }

.house-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
}

.house-badge.grifondoro { background: rgba(116,0,1,0.15); color: var(--red-gryffindor); }
.house-badge.serpeverde { background: rgba(26,71,42,0.15); color: var(--green-slytherin); }
.house-badge.corvonero { background: rgba(14,26,64,0.15); color: var(--blue-ravenclaw); }
.house-badge.tassorosso { background: rgba(236,185,57,0.2); color: var(--black-hufflepuff); }

/* ===== USER NAV ===== */
.user-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
}

.user-nav .username-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  line-height: 1.2;
  transition: color 0.2s;
}

.user-nav .username-link:hover {
  color: var(--gold);
}

.user-nav .username {
  font-weight: 600;
}

.user-nav .user-house {
  font-size: 0.7rem;
  color: var(--gold-dark);
  font-style: italic;
}

.user-nav .logout-btn {
  background: none;
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  transition: all 0.3s;
}

.user-nav .logout-btn:hover {
  background: var(--gold);
  color: var(--brown-dark);
}

/* ===== GAME RESULTS MODAL ===== */
.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.result-overlay.show,
.result-overlay.visible,
.result-overlay.active {
  display: flex;
}

.result-modal {
  background: var(--parchment);
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 35px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.result-modal h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--brown-dark);
  margin-bottom: 15px;
}

.result-modal .final-score {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  color: var(--gold-dark);
  margin: 10px 0;
}

.result-modal .final-time {
  font-size: 1rem;
  color: var(--brown-mid);
  margin-bottom: 20px;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== AUDIO CONTROLS ===== */
.audio-controls {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 999;
  display: flex;
  gap: 6px;
}

.audio-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(42,26,10,0.85);
  border: 1px solid var(--gold-dark);
  border-radius: 20px;
  color: var(--gold-dark);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

.audio-btn.active {
  background: rgba(201,168,76,0.2);
  color: var(--gold-light);
  border-color: var(--gold);
}

.audio-btn:hover {
  transform: scale(1.05);
}

.audio-icon {
  font-size: 1rem;
}

/* ===== GAME INSTRUCTIONS ===== */
.game-instructions {
  background: rgba(201,168,76,0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--brown);
  line-height: 1.5;
}

.game-instructions strong {
  color: var(--brown-dark);
}

/* ===== FEEDBACK ELEMENTS ===== */
.feedback-banner {
  text-align: center;
  padding: 10px 15px;
  border-radius: 8px;
  margin: 10px 0;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  animation: feedbackPop 0.4s ease;
}

@keyframes feedbackPop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.feedback-banner.correct {
  background: rgba(26,71,42,0.12);
  color: var(--green-slytherin);
  border: 1px solid rgba(26,71,42,0.3);
}

.feedback-banner.wrong {
  background: rgba(116,0,1,0.08);
  color: var(--red-gryffindor);
  border: 1px solid rgba(116,0,1,0.2);
}

.feedback-banner.info {
  background: rgba(201,168,76,0.1);
  color: var(--brown-dark);
  border: 1px solid var(--gold-dark);
}

.result-detail {
  font-size: 0.9rem;
  color: var(--brown);
  margin: 8px 0;
  line-height: 1.5;
}

.result-detail .rank {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold-dark);
}

.login-prompt {
  margin-top: 15px;
  padding: 12px;
  background: rgba(201,168,76,0.1);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--brown);
}

.login-prompt a {
  color: var(--gold-dark);
  font-weight: 700;
  text-decoration: underline;
}

/* Score animation */
.score-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(201,168,76,0.5);
  z-index: 1001;
  pointer-events: none;
  animation: scorePopup 1.2s ease forwards;
}

@keyframes scorePopup {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  60% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.8); opacity: 0; }
}

/* Word found animation for crucipuzzle */
.word-grid .cell.found {
  background: #d4edda;
  color: #155724;
  font-weight: 900;
  text-shadow: none;
}

/* Highlighted clue item */
.clue-item {
  font-size: 0.85rem;
  padding: 5px 0;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.3s;
  line-height: 1.4;
  list-style: none;
}

.clue-item:hover {
  color: var(--gold-dark);
}

.clue-item.active {
  color: var(--gold-dark);
  background: rgba(201,168,76,0.1);
  padding-left: 8px;
  border-radius: 4px;
}

.crossword-grid .cell.highlighted {
  background: rgba(201,168,76,0.3);
}

/* Celebration sparkles */
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

.celebration .sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: sparkle 1s ease forwards;
}

/* ===== PROFILE PAGE ===== */
.profile-section {
  margin-bottom: 25px;
}

.profile-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.profile-game-card {
  background: rgba(201,168,76,0.08);
  border: 2px solid rgba(201,168,76,0.25);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s;
}

.profile-game-card:hover {
  transform: translateY(-3px);
}

.profile-game-card h3 {
  font-family: Cinzel, serif;
  color: #4a2c10;
  font-size: 1.1rem;
  margin: 0 0 12px 0;
}

.profile-game-score {
  font-size: 2rem;
  font-weight: bold;
  color: #c9a84c;
  font-family: Cinzel, serif;
}

.profile-game-detail {
  font-family: Lora, serif;
  color: #6b4e2e;
  font-size: 0.85rem;
  margin-top: 4px;
}

.profile-game-rank {
  font-family: Cinzel, serif;
  color: #4a2c10;
  font-weight: 600;
  margin-top: 8px;
  font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .nav-toggle { display: block; }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
  }

  .nav-list.open { display: flex; }

  .nav-list a {
    padding: 12px 20px;
    border-top: 1px solid rgba(201,168,76,0.15);
  }

  .content-area {
    margin: 15px 8px;
    padding: 20px 15px;
  }

  .site-header {
    padding: 0;
    background: transparent;
  }
  .logo-container .header-desktop {
    width: 100%;
    height: auto;
    display: block;
  }
  .logo-container .header-mobile { display: none; }

  .clues-container {
    grid-template-columns: 1fr;
  }

  .word-grid {
    display: inline-grid;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .word-grid .cell {
    width: auto;
    height: auto;
    aspect-ratio: 1;
    font-size: clamp(0.55rem, 2.2vw, 0.85rem);
  }

  .crossword-grid {
    display: inline-grid;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .crossword-grid .cell {
    width: auto;
    height: auto;
    aspect-ratio: 1;
  }
  .crossword-grid .cell input {
    font-size: clamp(0.6rem, 2.5vw, 1rem);
  }
  .crossword-grid .cell .cell-number {
    font-size: clamp(0.4rem, 1.5vw, 0.55rem);
  }

  .page-title { font-size: 1.4rem; }

  .audio-controls {
    bottom: 10px;
    right: 10px;
  }

  .audio-label { display: none; }

  .audio-btn {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
}
