
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400&display=optional');

@font-face {
  font-family: 'HarryP';
  src: url('/HARRYP__.woff2') format('woff2'), url('/HARRYP__.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: optional;
}

:root {
  --bg-primary: #080810;
  --bg-secondary: #0e0e1a;
  --bg-card: #141422;
  --bg-panel: #0c0c18;
  --gold: #c5993e;
  --gold-light: #dbb65c;
  --gold-dark: #a08040;
  --gold-glow: #c5993e33;
  --text: #d6d0c8;
  --text-muted: #b0a898;
  --text-bright: #f2ece0;
  --accent-warm: #9b4b1c;
  --accent-red: #8b2020;
  --border: #2a2540;
  --border-gold: #c5993e44;
  --magic-purple: #8b3cc0;
  --gryffindor: #740001;
  --slytherin: #1A472A;
  --ravenclaw: #0E1A40;
  --hufflepuff: #d4a017;
}

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

body {
  font-family: 'Lora', Georgia, serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 80%, #18102a08 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, #1a120e06 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, #10081a05 0%, transparent 60%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Subtle dust particles ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(0.5px 0.5px at 12% 25%, #c5993e0d 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 35% 68%, #c5993e0a 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 58% 12%, #c5993e08 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 73% 45%, #c5993e0b 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 91% 78%, #c5993e09 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 8% 55%, #c5993e07 0%, transparent 100%),
    radial-gradient(0.8px 0.8px at 48% 88%, #c5993e0a 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 82% 8%, #c5993e08 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 25% 42%, #c5993e06 0%, transparent 100%),
    radial-gradient(0.5px 0.5px at 65% 72%, #c5993e09 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  opacity: .7;
}

/* ── Floating particles (magic dust) ── */
.particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  animation: float-up linear forwards;
  z-index: 9999;
}
@keyframes float-up {
  0% { opacity:1; transform: translateY(0) scale(1); }
  100% { opacity:0; transform: translateY(-120px) scale(0); }
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 2.5rem 1rem 1.2rem;
  position: relative;
  z-index: 1;
}
.header h1 {
  font-family: 'HarryP', 'Cinzel Decorative', serif;
  font-size: clamp(1.6rem, 5.5vw, 3.8rem);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light), #fff8, var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 3px 8px rgba(197,153,62,.3));
  margin-bottom: .4rem;
  letter-spacing: .06em;
}
.header h1::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  text-shadow: 0 0 30px #c5993e22;
}
.header .subtitle {
  font-size: clamp(.85rem, 2vw, 1.1rem);
  color: var(--text);
  font-style: italic;
  opacity: .85;
}
.map-trigger {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin: .5rem auto;
  padding: .3rem .9rem;
  background: rgba(197,153,62,.08);
  border: 1px solid var(--gold-dark);
  border-radius: 16px;
  color: var(--gold);
  font-family: 'Cinzel Decorative', serif;
  font-size: .72rem;
  cursor: pointer;
  transition: all .3s;
  letter-spacing: .05em;
}
.map-trigger:hover {
  background: rgba(197,153,62,.18);
  border-color: var(--gold);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(197,153,62,.2);
}

.hbo-line { display: inline-block; max-width: calc(100% - 2rem); line-height: 1.5; text-wrap: balance; margin: .7rem auto 0; padding: .35rem .9rem; border: 1px solid var(--border-gold); border-radius: 16px; font-size: .78rem; color: var(--gold-light); text-decoration: none; background: rgba(197,153,62,.06); transition: background .2s; }
.hbo-line b { color: var(--text-bright); }
.hbo-line u { text-decoration-color: var(--gold-dark); text-underline-offset: 3px; }
.hbo-line:hover { background: rgba(197,153,62,.16); }
.stats-bar {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--text-muted);
  padding: .6rem 0;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.stats-bar span {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.stats-bar .num {
  color: var(--gold);
  font-weight: 700;
  font-size: .95rem;
}

/* ── Tabs ── */
/* ── Experience level modal ── */
.xp-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(8,8,16,.92);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .5s ease-out;
}
.xp-modal.hidden { display: none; }
.xp-modal-box {
  background: var(--bg-card);
  border: 2px solid var(--gold-dark);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  max-width: 380px; width: 90%;
  text-align: center;
  position: relative;
}
.xp-modal-title {
  font-family: 'HarryP','Cinzel Decorative',serif;
  color: var(--gold-light);
  font-size: 1.4rem;
  margin-bottom: .3rem;
}
.xp-modal-sub {
  color: var(--text-muted);
  font-size: .82rem;
  margin-bottom: 1.2rem;
  font-style: italic;
}
.xp-option {
  display: block; width: 100%;
  padding: .7rem .8rem;
  margin-bottom: .5rem;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
}
.xp-option:hover { border-color: var(--gold); background: rgba(197,153,62,.08); transform: translateY(-1px); }
.xp-option-icon { font-size: 1.3rem; margin-right: .4rem; vertical-align: middle; }
.xp-option-name { font-weight: 600; color: var(--text); font-size: .85rem; }
.xp-option-desc { font-size: .7rem; color: var(--text-muted); margin-top: .1rem; margin-left: 2rem; }

/* XP level indicator in HP bar */
.xp-indicator {
  font-size: .75rem;
  cursor: pointer;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: background .2s;
}
.xp-indicator:hover { background: rgba(255,255,255,.08); }

/* ── Language toggle ── */
.lang-toggle {
  display: flex;
  gap: .25rem;
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
}
.lang-btn {
  position: relative;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  background: transparent;
  transition: all .2s;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lang-btn::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 20px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  background: rgba(20,18,32,.8);
  backdrop-filter: blur(4px);
  transition: all .2s;
}
.lang-btn > .lang-flag { position: relative; z-index: 1; }
a.lang-btn { text-decoration: none; }
.lang-btn:hover::before { border-color: var(--gold-dark); }
.lang-btn.active::before { border-color: var(--gold); box-shadow: 0 0 6px rgba(197,153,62,.3); }

/* ── Featured strip ── */
.featured-strip {
  display: flex;
  gap: .6rem;
  padding: .4rem 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: center;
}
.featured-strip::-webkit-scrollbar { display: none; }
@media (max-width: 850px) {
  .featured-strip { justify-content: flex-start; }
}
.featured-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: 110px;
  padding: .5rem .4rem;
  background: rgba(197,153,62,.06);
  border: 1px solid rgba(197,153,62,.18);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.featured-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: rgba(197,153,62,.12);
}
.featured-card-icon { font-size: 1.6rem; margin-bottom: .2rem; }
.featured-card-name { font-size: .7rem; font-weight: 600; color: var(--gold-light); line-height: 1.2; }
.featured-card-desc { font-size: .58rem; color: var(--text-muted); margin-top: .15rem; line-height: 1.3; }

/* ── Getting started guide ── */
.getting-started {
  max-width: 600px;
  margin: .5rem auto .8rem;
  background: rgba(197,153,62,.04);
  border: 1px solid rgba(197,153,62,.15);
  border-radius: 10px;
  padding: .6rem .8rem;
  font-size: .75rem;
  line-height: 1.6;
  color: var(--text);
}
.getting-started-title {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold-light);
  font-size: .8rem;
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.getting-started-dismiss {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: .8rem; padding: 0;
}
.gs-steps {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.gs-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
}
.gs-step:hover { background: rgba(197,153,62,.08); }
.gs-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(197,153,62,.15);
  color: var(--gold-light);
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gs-step-text { font-size: .72rem; color: var(--text); }
.gs-step-text em { color: var(--text-muted); font-size: .65rem; }

/* ── Category nav (top row) ── */
.nav-cats {
  display: flex;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .5rem .8rem .25rem;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,8,16,.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.nav-cat {
  padding: .5rem 1.2rem;
  border: 1.5px solid #35304a;
  background: #141220;
  color: #d0c8bc;
  font-family: 'Lora', serif;
  font-size: .9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all .25s;
  position: relative;
}
.nav-cat:hover {
  border-color: var(--gold);
  color: var(--text-bright);
  background: #1a1830;
}
.nav-cat.active {
  background: #1a1830;
  color: var(--gold-light);
  border-color: var(--gold-dark);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--gold);
}
.nav-cat .cat-icon { margin-right: .3rem; }

/* ── Sub-tabs (second row) ── */
.tabs {
  display: none;
  justify-content: center;
  gap: .3rem;
  flex-wrap: wrap;
  padding: .3rem 1rem .5rem;
  position: sticky;
  top: 36px;
  z-index: 49;
  background: rgba(8,8,16,.95); backdrop-filter: blur(8px);
}
.tabs.visible { display: flex; }
@media (max-width: 1366px) {
  .nav-cats { transition: top 0.3s ease; }
  .nav-cats.nav-hidden { top: -60px !important; }
  .tabs { transition: top 0.3s ease; }
  .tabs.nav-hidden { top: -120px !important; }
}
@media (max-width: 600px) {
  .tabs { top: 64px; }
}
.tab {
  padding: .3rem .8rem;
  border: 1px solid #2a2640;
  background: #0f0d1a;
  color: #a09888;
  font-family: 'Lora', serif;
  font-size: .78rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all .25s;
  position: relative;
}
.tab:hover {
  border-color: var(--gold-dark);
  color: var(--text-bright);
  background: #1a1830;
}
.tab.active {
  background: #1a1830;
  color: var(--gold-light);
  border-color: var(--gold-dark);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--gold);
}
.tab.fav-tab {
  border-color: var(--accent-red);
  position: relative;
}
.tab.fav-tab .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.tab.trivia-tab { border-color: var(--magic-purple); }
.tab.trivia-tab.active { box-shadow: inset 0 -2px 0 var(--magic-purple); color: #a78bfa; }
.tab.egg-tab { border-color: var(--slytherin); }
.tab.egg-tab.active { box-shadow: inset 0 -2px 0 #22c55e; color: #4ade80; }
.tab.magic-tab { border-color: var(--magic-purple); }
.tab.magic-tab.active { box-shadow: inset 0 -2px 0 #a855f7; color: #c084fc; }
.tab.daily-tab { border-color: #f59e0b; }
.tab.daily-tab.active { box-shadow: inset 0 -2px 0 #f59e0b; color: #fbbf24; }
.tab.daily-tab .streak-badge {
  position: absolute; top: -6px; right: -6px;
  background: #f59e0b; color: #000; border-radius: 50%;
  width: 16px; height: 16px; font-size: .55rem;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* Wave animation for sub-tabs */
@keyframes tabWaveIn {
  0% { opacity: 0; transform: translateY(10px) scale(.85); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dobby helper — floats near Beco Diagonal */
.dobby-helper {
  position: fixed;
  bottom: 70px;
  right: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  animation: dobbyBounce 2s ease-in-out infinite;
  transition: opacity .4s, transform .4s;
}
.dobby-helper.hidden { opacity: 0; pointer-events: none; transform: scale(.5); }
.dobby-img {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  transition: transform .3s;
}
.dobby-helper:hover .dobby-img { transform: scale(1.08); }
.dobby-speech {
  background: rgba(30,20,10,.92);
  border: 1.5px solid #c5993e;
  border-radius: 14px 14px 14px 4px;
  padding: .4rem .8rem;
  color: #dbb65c;
  font-family: 'Lora', serif;
  font-size: .72rem;
  font-style: italic;
  max-width: 200px;
  text-align: center;
  line-height: 1.4;
  margin-bottom: .3rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: opacity .3s;
}
.dobby-dismiss {
  position: absolute; top: -6px; right: -6px; z-index: 3;
  width: 16px; height: 16px;
  background: rgba(60,40,20,.9); border: 1px solid #8a6d2b;
  border-radius: 50%; color: #b8a07a; font-size: .55rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
.dobby-dismiss:hover { background: rgba(120,30,30,.8); color: #fff; }
:where(.getting-started-dismiss, .dobby-dismiss, .hp-bar-gold, .xp-indicator, .hp-bar-sort-btn) { position: relative; }
.getting-started-dismiss::before, .dobby-dismiss::before { content: ''; position: absolute; inset: -14px; }
.hp-bar-gold::before, .xp-indicator::before, .hp-bar-sort-btn::before { content: ''; position: absolute; inset: -12px -5px; }
@keyframes dobbyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes dobbyPulseText {
  0%, 100% { opacity: .85; }
  50% { opacity: 1; }
}

/* ── Panels ── */
.panel {
  display: none;
  position: relative;
  z-index: 1;
  padding: 1rem;
}
.panel.active {
  display: block;
  animation: fadeIn .4s;
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(10px); }
  to { opacity:1; transform:translateY(0); }
}

/* ── Gallery grid ── */
.country-label {
  text-align: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin: 1.8rem 0 .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  letter-spacing: .03em;
}
.country-label::before,
.country-label::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
}
.country-label .flag {
  font-size: 1.4rem;
}
.edition-label {
  text-align: center;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
  font-style: italic;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .8rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 .5rem;
}
.cover-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all .3s;
  background: var(--bg-card);
  aspect-ratio: 2/3;
  border: 1px solid var(--border);
}
.cover-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 4px 20px #c5993e15;
  border-color: var(--gold);
}
.cover-card.selected {
  border-color: var(--accent-red);
  box-shadow: 0 0 12px rgba(139,32,32,.4);
}
/* Heart button on each cover card */
.card-heart {
  position: absolute;
  top: 5px; right: 5px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.5);
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all .25s;
  opacity: 0;
  line-height: 1;
}
.cover-card:hover .card-heart { opacity: 1; }
@media (max-width: 1024px) {
  .card-heart { opacity: 0.5 !important; }
}
.cover-card.selected .card-heart {
  opacity: 1;
  color: #e74c3c;
  background: rgba(0,0,0,.6);
}
.cover-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}
.cover-card .info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  padding: .4rem;
  font-size: .63rem;
  color: var(--text);
  transform: translateY(100%);
  transition: transform .3s;
}
.cover-card:hover .info {
  transform: translateY(0);
}
.cover-card .info .book-num {
  font-weight: 700;
  color: var(--gold);
}

/* ── Favorites board ── */
.fav-board {
  max-width: 1000px;
  margin: 0 auto;
  min-height: 300px;
  border: 2px dashed var(--gold-dark);
  border-radius: 12px;
  padding: 1.5rem;
  background: rgba(197,153,62,.03);
  position: relative;
}
.fav-board.empty::before {
  content: 'Clica nas capas para escolher as tuas favoritas!';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
  text-align: center;
  pointer-events: none;
}
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .8rem;
}
.fav-grid .cover-card {
  aspect-ratio: 2/3;
}
.fav-actions {
  text-align: center;
  margin-top: 1rem;
}

/* ── Buttons ── */
.btn-magic {
  padding: .6rem 1.5rem;
  background: var(--bg-card);
  color: var(--gold);
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, var(--gold-dark), var(--gold-light), var(--gold-dark)) 1;
  border-radius: 0;
  font-family: 'Lora', serif;
  font-size: .9rem;
  cursor: pointer;
  transition: all .3s;
  margin: .3rem;
  position: relative;
}
/* border-image kills border-radius, so we use a wrapper approach for rounded ones */
.btn-magic {
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  border-image: none;
}
.btn-magic:hover {
  background: var(--gold-dark);
  color: var(--bg-primary);
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(197,153,62,.25);
}
.btn-magic:active {
  transform: scale(.98);
}
.btn-magic.danger {
  border-color: var(--accent-red);
  color: #e07070;
  background: var(--bg-card);
}
.btn-magic.danger:hover {
  background: var(--accent-red);
  color: #fff;
}

/* ── Exam panel ── */
.exam-container {
  max-width: 700px;
  margin: 1rem auto;
}
.exam-screen h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}
.exam-badge {
  text-align: center;
  margin-bottom: 1rem;
  min-height: 1rem;
}
.exam-levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
  margin: 1.2rem 0;
}
.exam-level {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem .7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  text-align: center;
}
.exam-level .level-score {
  font-size: .75rem;
  color: var(--gold);
  font-weight: 700;
}
.exam-level .level-name {
  font-size: .8rem;
  color: var(--text);
}
.exam-container p {
  color: var(--text-muted);
  text-align: center;
  font-size: .9rem;
  line-height: 1.5;
  margin-bottom: .8rem;
}
.exam-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.exam-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}
.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
}
.exam-difficulty {
  text-align: center;
  margin-bottom: .8rem;
}
.exam-difficulty span,
.exam-difficulty {
  display: inline-block;
  font-size: .7rem;
  padding: .15rem .6rem;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .03em;
}
.exam-diff-easy {
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.25);
}
.exam-diff-medium {
  background: rgba(234,179,8,.12);
  color: #facc15;
  border: 1px solid rgba(234,179,8,.25);
}
.exam-diff-hard {
  background: rgba(239,68,68,.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
}
.exam-q {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
  min-height: 3rem;
  text-align: center;
  color: var(--text-bright);
}
.exam-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: 1rem;
}
.exam-opt {
  padding: .7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .88rem;
  cursor: pointer;
  transition: all .3s;
  text-align: center;
}
.exam-opt:hover {
  border-color: var(--gold);
  background: rgba(197,153,62,.08);
  color: var(--text-bright);
}
.exam-opt.correct {
  border-color: #22c55e;
  background: rgba(34,197,94,.12);
  color: #4ade80;
}
.exam-opt.wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,.12);
  color: #f87171;
}
.exam-opt.disabled {
  pointer-events: none;
  opacity: .7;
}
.exam-feedback {
  font-size: .9rem;
  min-height: 2rem;
  margin-bottom: .8rem;
  font-style: italic;
  text-align: center;
}
.exam-score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  box-shadow: 0 0 30px #c5993e15;
}
.exam-score-circle .score-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.8rem;
  color: var(--gold-light);
  line-height: 1;
}
.exam-score-circle .score-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.exam-title {
  text-align: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: .8rem;
}
.exam-details {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.exam-best {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-style: italic;
}
.exam-screen {
  text-align: center;
}

/* ── Diploma overlay ── */
.diploma-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 10010;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}
.diploma-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  align-items: center;
}
.diploma-input {
  padding: .5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: 'Lora', serif;
  font-size: .9rem;
  outline: none;
  min-width: 180px;
}
.diploma-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(197,153,62,.2);
}
.diploma-input::placeholder {
  color: #8a8070;
}
.diploma-select {
  padding: .5rem .8rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: 'Lora', serif;
  font-size: .9rem;
  outline: none;
  cursor: pointer;
}
.diploma-print {
  width: 100%;
  max-width: 700px;
  background: #f5e6c8;
  color: #1a1a2e;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.diploma-border {
  margin: 15px;
  padding: 20px;
  border: 8px double var(--gold);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.diploma-border::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-dark);
  pointer-events: none;
}
.diploma-header {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  color: var(--gryffindor);
  text-align: center;
  margin-bottom: 1rem;
}
.diploma-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  font-size: 1rem;
  line-height: 1.8;
  color: #2a2a2a;
  text-align: center;
}
.diploma-covers {
  display: flex;
  justify-content: center;
  gap: .3rem;
  margin: .8rem 0;
  flex-wrap: wrap;
  max-width: 100%;
  overflow: hidden;
}
.diploma-covers img {
  height: 65px;
  width: 43px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  flex-shrink: 0;
}
.diploma-footer {
  text-align: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: .85rem;
  color: #555;
  border-top: 1px solid #c5993e55;
  padding-top: .8rem;
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: #fff !important; }
  body > * { display: none !important; }
  body > .diploma-overlay { display: block !important; }
  .diploma-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }
  .diploma-controls { display: none !important; }
  .diploma-print {
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    break-inside: avoid;
  }
  .diploma-border {
    margin: 10px !important;
    padding: 15px !important;
    border-width: 6px !important;
  }
  .diploma-covers img {
    height: 55px !important;
    width: 37px !important;
  }
}

/* ── Easter eggs panel ── */
.egg-panel {
  max-width: 800px;
  margin: 1rem auto;
  text-align: center;
}
.egg-panel h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  margin-bottom: .5rem;
}
.egg-panel .hint {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  font-size: .88rem;
}
.egg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.egg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all .3s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.egg-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px #c5993e10;
}
.egg-card.found {
  border-color: #22c55e;
  background: rgba(34,197,94,.06);
}
.egg-card .egg-icon {
  font-size: 2.5rem;
  margin-bottom: .4rem;
}
.egg-card .egg-name {
  font-size: .83rem;
  color: var(--gold);
}
.egg-card.locked .egg-icon {
  filter: grayscale(1) brightness(.4);
}
.egg-card.locked .egg-name {
  color: #444;
}

/* ── Platform 9 3/4 ── */
.platform-934 {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  perspective: 1000px;
}
.platform-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}
.platform-badge {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid var(--gold-dark);
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.platform-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #f4d47a, #7b4b20 72%);
  font-size: 2.8rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.65);
}
.diagon-hero-art {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 25%, rgba(197,153,62,.35), transparent 28%),
    linear-gradient(135deg, #22142b 0%, #51301c 48%, #111827 100%);
  color: var(--gold-light);
  font-size: 5rem;
  text-shadow: 0 3px 18px rgba(0,0,0,.8);
}
.platform-title {
  text-align: center;
}
.platform-title h3 {
  font-family: 'HarryP','Cinzel Decorative', serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  margin: 0;
  letter-spacing: .05em;
}
.platform-title small {
  font-family: 'Lora', serif;
  font-size: .8rem;
  color: var(--text-muted);
  letter-spacing: .1em;
}
.brick-wall {
  height: 320px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  /* BRICKWALL-CSS-MARKER: tijolos desenhados em CSS.
     A imagem externa que aqui estava (alltrippers.com) passou a 404. */
  /* REALISMO: imagem real da parede da Plataforma 9 3/4 (fornecida pelo Vasco).
     Substitui os tijolos em SVG que estavam aqui. */
  background-color: #2e1a10;
  background-image: url('/platform-934-hp.png');
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  transition: all 1s cubic-bezier(.4,0,.2,1);
}
.brick-wall::before {
  content:'';
  position:absolute;inset:0;
  /* fiadas alternadas deslocadas meia-largura + vinheta e desgaste */
  background-image:
    radial-gradient(ellipse 70% 55% at 32% 22%, rgba(255,190,130,.13), transparent 65%),
    linear-gradient(transparent 30%, rgba(0,0,0,.78) 100%);
  pointer-events:none;
}
.platform-btn {
  font-size: .95rem;
  position: relative;
  z-index: 2;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 10px rgba(197,153,62,.2); }
  50% { box-shadow: 0 0 25px rgba(197,153,62,.5); }
}
/* Crossing animation: wall rushes toward camera */
.brick-wall.crossing {
  transform: scale(3) translateZ(200px);
  opacity: 0;
  filter: blur(15px) brightness(2);
  transition: all 1.5s cubic-bezier(.4,0,.2,1);
}
.hogwarts-reveal {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(197,153,62,.08) 0%, transparent 60%),
    var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hogwarts-reveal::before {
  content:'';
  position:absolute;inset:0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(197,153,62,.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 20%, rgba(197,153,62,.2) 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 70%, rgba(197,153,62,.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 40% 80%, rgba(197,153,62,.2) 0%, transparent 100%);
  animation: twinkle 3s ease-in-out infinite alternate;
  pointer-events:none;
}
@keyframes twinkle { 0%{opacity:.4} 100%{opacity:1} }
.hogwarts-reveal .steam {
  position:absolute; bottom:0; left:0; right:0; height:60px;
  background:linear-gradient(transparent, rgba(200,200,200,.08));
  pointer-events:none;
  animation: steamRise 3s ease-in-out infinite;
}
@keyframes steamRise {
  0%,100% { opacity:.3; transform:translateY(0); }
  50% { opacity:.6; transform:translateY(-10px); }
}
.hogwarts-title {
  font-family: 'HarryP','Cinzel Decorative', serif;
  font-size: clamp(1.5rem,4vw,2.2rem);
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.hogwarts-crests {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.house-crest {
  width: 90px;
  height: 100px;
  background: var(--bg-secondary);
  border: 2px solid var(--hc, var(--border));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--text);
  line-height: 1.6;
  transition: all .3s;
  cursor: default;
}
.house-crest:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--hc, #c5993e) 30%, transparent);
}
.hogwarts-lore {
  color: var(--text-muted);
  font-style: italic;
  font-size: .88rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  min-height: 2rem;
}

/* ── Spell casting overlay ── */
.spell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  flex-direction: column;
}
.spell-overlay.active {
  display: flex;
}
.spell-text {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 8vw, 5rem);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: spellPulse 1.5s ease-in-out;
}
@keyframes spellPulse {
  0% { opacity:0; transform:scale(.5); }
  50% { opacity:1; transform:scale(1.2); }
  100% { opacity:0; transform:scale(2); }
}

/* ── Sorting Hat mini-game ── */
.sorting-hat {
  text-align: center;
  padding: 1rem;
}
.sorting-hat .hat-img {
  font-size: 5rem;
  animation: hatWobble 2s ease-in-out infinite;
  cursor: pointer;
}
@keyframes hatWobble {
  0%,100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.sorting-result {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  margin-top: 1rem;
  animation: fadeIn .5s;
}

/* ── Wand sparkle cursor ── */
.wand-spark {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: spark .6s ease-out forwards;
}
@keyframes spark {
  0% { opacity:1; transform:scale(1); }
  100% { opacity:0; transform:scale(0) translateY(-30px); }
}

/* ── Lightbox with navigation ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}
.lightbox.active {
  display: flex;
}
.lb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  cursor: pointer;
  max-height: 100vh;
  padding: 1rem;
}
.lightbox img {
  max-width: min(75vw, 600px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 50px #c5993e18;
  cursor: default;
  transition: transform .3s;
}
.lb-info {
  color: var(--gold);
  font-size: .82rem;
  margin-top: .8rem;
  text-align: center;
  font-style: italic;
  opacity: .8;
}
.lightbox .lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5002;
  transition: all .3s;
}
.lb-close:hover {
  background: var(--bg-secondary);
  border-color: var(--gold-dark);
  color: var(--gold);
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 2.8rem;
  width: 52px;
  height: 76px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 5001;
  transition: all .3s;
  line-height: 1;
}
.lb-nav:hover {
  background: var(--bg-secondary);
  border-color: var(--gold-dark);
  color: var(--gold);
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
/* lb-fav-btn now part of lb-actions group */

/* ── Zona Mágica ── */
.magic-zone {
  max-width: 900px;
  margin: 0 auto;
}
.magic-zone h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}

/* Big magic button */
.magic-btn-area {
  text-align: center;
  margin: 1.5rem 0;
}
.big-magic-btn {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 3px solid var(--gold-dark);
  background: radial-gradient(circle at 40% 40%, #1e0e30, var(--bg-primary) 70%);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  transition: all .4s;
  box-shadow: 0 0 30px rgba(107,33,168,.2), inset 0 0 30px rgba(107,33,168,.15);
  animation: btnGlow 3s ease-in-out infinite alternate;
}
.big-magic-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 50px #c5993e30, inset 0 0 40px #c5993e12;
  border-color: var(--gold);
}
.big-magic-btn:active {
  transform: scale(.95);
}
@keyframes btnGlow {
  0% { box-shadow: 0 0 30px rgba(107,33,168,.2), inset 0 0 30px rgba(107,33,168,.15); }
  100% { box-shadow: 0 0 40px #c5993e25, inset 0 0 30px #c5993e10; }
}
.big-magic-btn .btn-label {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel Decorative', serif;
  font-size: .8rem;
  color: var(--gold-dark);
  white-space: nowrap;
}

/* Character stage */
.char-stage {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10003;
  background: rgba(0,0,0,.88);
  flex-direction: column;
}
.char-stage.active {
  display: flex;
}
.char-figure {
  font-size: clamp(8rem, 25vw, 16rem);
  animation: charEnter 1.2s cubic-bezier(.34,1.56,.64,1);
  filter: drop-shadow(0 0 40px #c5993e40);
  user-select: none;
}
@keyframes charEnter {
  0% { opacity:0; transform:scale(0) rotate(-30deg); }
  60% { opacity:1; transform:scale(1.15) rotate(5deg); }
  100% { transform:scale(1) rotate(0); }
}
.char-caption {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.2rem, 4vw, 2.5rem);
  color: var(--gold);
  margin-top: 1rem;
  animation: fadeIn .6s .3s both;
  text-align: center;
}
.char-sub {
  font-size: clamp(.8rem, 2vw, 1.1rem);
  color: var(--text-muted);
  font-style: italic;
  margin-top: .5rem;
  animation: fadeIn .6s .6s both;
  text-align: center;
  max-width: 80vw;
}
.char-stage .close-char {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
}
.char-stage .close-char:hover {
  border-color: var(--gold-dark);
  color: var(--gold);
}

/* Spell playground */
.spell-playground {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.spell-playground h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: .5rem;
  font-size: 1.1rem;
}
.spell-playground .spell-hint {
  text-align: center;
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}
.spell-input-area {
  display: flex;
  gap: .5rem;
  max-width: 500px;
  margin: 0 auto 1rem;
}
.spell-input {
  flex: 1;
  padding: .6rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: 'Lora', serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .3s;
}
.spell-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(197,153,62,.2);
}
.spell-input::placeholder {
  color: #8a8070;
}
.spell-cast-btn {
  padding: .6rem 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--magic-purple);
  color: #a78bfa;
  border-radius: 6px;
  font-family: 'Cinzel Decorative', serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .3s;
}
.spell-cast-btn:hover {
  background: var(--magic-purple);
  color: #fff;
  transform: scale(1.03);
}
.spell-book {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: 1rem;
}
/* Expandable spell card */
.spell-chip-expanded {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .3s;
}
.spell-chip-expanded:hover { border-color: var(--gold-dark); }
.spell-chip-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  cursor: pointer;
  transition: background .3s;
}
.spell-chip-header:hover { background: rgba(197,153,62,.06); }
.spell-chip-name {
  font-weight: 700;
  color: var(--gold-light);
  font-size: .9rem;
  flex-shrink: 0;
}
.spell-chip-type {
  color: var(--text-muted);
  font-size: .7rem;
  flex: 1;
}
.spell-chip-body {
  display: none;
  padding: .5rem .8rem .6rem;
  border-top: 1px solid var(--border);
}
.spell-chip-expanded.open .spell-chip-body { display: block; }
.spell-chip-desc {
  font-size: .8rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: .3rem;
}
.spell-chip-book {
  font-size: .72rem;
  color: var(--gold-dark);
  font-style: italic;
}
.spell-result {
  text-align: center;
  min-height: 50px;
  margin: 1rem 0;
  font-size: .95rem;
}

/* Spell favorites section */
.spell-favorites {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-gold);
}
.spell-favorites h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: .4rem;
  font-size: 1rem;
}
.spell-fav-hint {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}
.spell-fav-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .8rem;
}
.spell-fav-card {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  padding: .8rem;
}
.spell-fav-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .3rem;
}
.spell-fav-card-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: .85rem;
  color: var(--gold);
}
.spell-fav-card-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
  transition: color .2s;
}
.spell-fav-card-remove:hover {
  color: var(--accent-red);
}
.spell-fav-card-desc {
  font-size: .72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: .5rem;
}
.spell-fav-card textarea {
  width: 100%;
  min-height: 50px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .75rem;
  padding: .4rem;
  outline: none;
  resize: vertical;
  transition: border-color .3s;
}
.spell-fav-card textarea:focus {
  border-color: var(--gold-dark);
}
.spell-fav-card textarea::placeholder {
  color: #444;
}

/* Drawing canvas area */
.wand-draw-area {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}
.wand-draw-area canvas {
  display: block;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='3' fill='%23c5993e'/%3E%3Ccircle cx='12' cy='12' r='6' fill='none' stroke='%23c5993e44' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair;
}
.wand-draw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}
.wand-draw-title {
  font-size: .85rem;
  color: var(--gold);
  font-family: 'Cinzel Decorative', serif;
}
.wand-controls {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.wand-color-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
}
.wand-color-btn:hover, .wand-color-btn.active {
  border-color: #fff;
  transform: scale(1.2);
}
.wand-width-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 4px;
  padding: .15rem .4rem; font-size: .7rem;
  cursor: pointer; transition: all .2s;
}
.wand-width-btn:hover, .wand-width-btn.active {
  border-color: var(--gold); color: var(--gold);
}
.wand-score {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .8rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
}
.wand-score-bar {
  flex: 1; height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}
.wand-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s, background .5s;
}
.wand-score-label {
  color: var(--gold); font-weight: 700;
  min-width: 3rem; text-align: right;
}
.wand-score-title {
  color: var(--text-muted); font-style: italic;
  font-size: .75rem;
}
.wand-challenge {
  text-align: center; padding: .6rem;
  border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text-muted);
}
.wand-challenge strong { color: var(--gold-light); }

/* Cloud sync indicator */
.sync-indicator {
  padding: .15rem .4rem;
  border-radius: 8px;
  font-size: .58rem;
  transition: all .5s;
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
}
.sync-indicator.synced {
  background: rgba(34,197,94,.08);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,.2);
}
.sync-indicator.syncing {
  background: rgba(197,153,62,.08);
  color: var(--gold);
  border: 1px solid rgba(197,153,62,.2);
}
.sync-indicator.offline {
  background: rgba(255,255,255,.03);
  color: #8a8070;
  border: 1px solid rgba(255,255,255,.08);
}
.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Konami hint ── */
.secret-hint {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #222;
  font-size: .55rem;
  z-index: 1;
  transition: color .3s;
}
.secret-hint:hover {
  color: #908878;
}

/* ── Trivia legacy (kept for backward compat, mostly superseded by exam) ── */
.trivia-box {
  max-width: 700px;
  margin: 1rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}
.trivia-box h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  margin-bottom: 1rem;
}
.trivia-q {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
  min-height: 3rem;
}
.trivia-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: 1rem;
}
.trivia-opt {
  padding: .7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .88rem;
  cursor: pointer;
  transition: all .3s;
}
.trivia-opt:hover {
  border-color: var(--gold);
  background: rgba(197,153,62,.08);
}
.trivia-opt.correct {
  border-color: #22c55e;
  background: rgba(34,197,94,.1);
}
.trivia-opt.wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,.1);
}
.trivia-opt.disabled {
  pointer-events: none;
  opacity: .7;
}
.trivia-score {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: .8rem;
}
.trivia-feedback {
  font-size: .9rem;
  min-height: 1.5rem;
  margin-bottom: .8rem;
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .lb-nav { width: 38px; height: 56px; font-size: 2rem; }
  .lb-prev { left: .3rem; }
  .lb-next { right: .3rem; }
  .lightbox img { max-width: 88vw; }
  .exam-opts { grid-template-columns: 1fr; }
  .diploma-print { min-height: auto; }
  .diploma-border { margin: 10px; padding: 15px; }
  .hogwarts-crests { gap: .5rem; }
  .house-crest { width: 70px; height: 80px; font-size: .65rem; }
}
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; }
  .trivia-opts { grid-template-columns: 1fr; }
  .nav-cat { padding: .35rem .7rem; font-size: .78rem; }
  .lang-toggle { top: auto; bottom: 52px; left: 8px; z-index: 201; }
  .lang-btn { width: 44px; height: 44px; font-size: 1rem; }
  .nav-cat .cat-icon { margin-right: .2rem; font-size: .85rem; }
  .tab { padding: .3rem .6rem; font-size: .72rem; }
  .big-magic-btn { width: 130px; height: 130px; font-size: 3rem; }
  .exam-levels { grid-template-columns: repeat(2, 1fr); }
  .spell-fav-list { grid-template-columns: 1fr; }
  .journal-entry { flex-direction: column; }
}

/* ── Share & Notes System ── */
.lb-actions {
  display: flex; gap: .5rem;
  position: absolute; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  z-index: 5001;
}
.lb-action-btn {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  color: var(--text);
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  transition: all .3s;
}
.lb-action-btn:hover { background: rgba(197,153,62,.15); border-color: var(--gold); color: var(--gold-light); }
.lb-action-btn.active { color: #e74c3c; background: rgba(231,76,60,.15); border-color: rgba(231,76,60,.4); }

/* Cover note in lightbox */
.lb-note-area {
  position: absolute; bottom: 5.5rem; left: 50%;
  transform: translateX(-50%);
  width: min(500px, 80vw);
  z-index: 5001;
}
.lb-note-area textarea {
  width: 100%;
  min-height: 50px;
  padding: .5rem .7rem;
  background: rgba(10,10,20,.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .85rem;
  resize: vertical;
}
.lb-note-area textarea:focus { border-color: var(--gold); outline: none; }
.lb-note-area textarea::placeholder { color: #8a8070; }

/* Journal / Notebook tab */
.journal-container { max-width: 800px; margin: 0 auto; }
.journal-container h2 {
  font-family: 'HarryP','Cinzel Decorative', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: .3rem;
}
.journal-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}
.journal-new {
  display: flex; gap: .5rem;
  margin-bottom: 1.5rem;
}
.journal-new textarea {
  flex: 1;
  min-height: 60px;
  padding: .6rem .8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .9rem;
  resize: vertical;
}
.journal-new textarea:focus { border-color: var(--gold); outline: none; }
.journal-new textarea::placeholder { color: #8a8070; }
.journal-entries { display: flex; flex-direction: column; gap: .6rem; }
.journal-entry {
  display: flex; gap: .8rem;
  padding: .8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
}
.journal-entry:hover { border-color: var(--gold-dark); }
.journal-entry-cover {
  width: 50px; height: 75px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.journal-entry-text {
  flex: 1;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.journal-entry-meta {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .3rem;
}
.journal-entry-tag {
  display: inline-block;
  padding: .1rem .4rem;
  background: rgba(197,153,62,.1);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  font-size: .65rem;
  color: var(--gold);
  margin-right: .3rem;
}
.journal-entry-actions {
  position: absolute; top: .5rem; right: .5rem;
  display: flex; gap: .3rem;
}
.journal-entry-actions button {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: .8rem; padding: .2rem;
  transition: color .2s;
}
.journal-entry-actions button:hover { color: var(--gold); }
.journal-export-bar {
  display: flex; gap: .5rem; justify-content: center;
  margin-top: 1.5rem; flex-wrap: wrap;
}
/* ── Suggestions ── */
.suggestions-bar {
  max-width: 600px;
  margin: 2rem auto 1rem;
  text-align: center;
}
.suggestions-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: .4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Lora', serif;
  font-size: .8rem;
  transition: all .3s;
}
.suggestions-toggle:hover {
  border-color: var(--gold-dark);
  color: var(--gold);
}
.suggestions-form {
  margin-top: .8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.suggestions-form textarea {
  width: 100%;
  min-height: 60px;
  padding: .5rem .7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .85rem;
  resize: vertical;
  margin-bottom: .5rem;
}
.suggestions-form textarea:focus { border-color: var(--gold); outline: none; }
.suggestion-item {
  text-align: left;
  padding: .5rem;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item .s-name { color: var(--gold-dark); font-weight: 700; }
.suggestion-item .s-date { font-size: .7rem; color: #8a8070; }

/* ── Warp Tunnel ── */
.warp-overlay {
  position: fixed; inset: 0;
  z-index: 25000;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  pointer-events: none;
}
.warp-tunnel {
  position: absolute; inset: 0;
  overflow: hidden;
}
.warp-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 2px solid;
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
}
@keyframes warpExpand {
  0% { transform: translate(-50%,-50%) scale(0); opacity: .9; }
  80% { opacity: .6; }
  100% { transform: translate(-50%,-50%) scale(8); opacity: 0; }
}
.warp-destination {
  font-family: 'HarryP','Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 5vw, 3rem);
  color: var(--gold-light);
  text-align: center;
  z-index: 25001;
  animation: warpTextIn 1.2s .6s both;
  text-shadow: 0 0 30px rgba(197,153,62,.5);
}
@keyframes warpTextIn {
  0% { opacity: 0; transform: scale(.3) rotateX(40deg); filter: blur(10px); }
  60% { opacity: 1; transform: scale(1.05) rotateX(-2deg); filter: blur(0); }
  100% { opacity: 1; transform: scale(1) rotateX(0); }
}

/* ── Marauder's Map ── */
.marauder-overlay {
  position: fixed; inset: 0;
  z-index: 30000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  overflow: hidden;
  cursor: pointer;
}
.marauder-overlay.active { display: flex; }

/* Parchment — immersive map */
.marauder-parchment {
  width: min(98vw, 1200px);
  height: 94vh;
  border-radius: 8px;
  border: 3px solid #8a6d2b;
  box-shadow: 0 0 80px rgba(138,109,43,.5), inset 0 0 30px rgba(100,70,30,.2);
  overflow: hidden;
  position: relative;
  animation: mapUnfold .8s ease-out;
  display: flex;
  flex-direction: column;
  cursor: default;
}
@keyframes mapUnfold {
  0% { transform: scaleY(0) scaleX(.7); opacity: 0; }
  50% { transform: scaleY(.5) scaleX(.9); opacity: .7; }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; }
}

/* Cover page (first view) */
.map-cover {
  width: 100%;
  flex: 1;
  background: url('/marauder-map-cover.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem;
  position: relative;
  cursor: pointer;
}
.map-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(30,20,10,.6) 100%);
  pointer-events: none;
}
.map-cover-text {
  position: relative; z-index: 1;
  text-align: center;
  color: #c5993e;
  font-family: 'Cinzel Decorative', serif;
  font-size: .85rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Scrollable map surface */
.map-surface {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #dcc9a0;
  -webkit-overflow-scrolling: touch;
}
.map-canvas {
  width: 1300px;
  height: 1300px;
  background: url('/marauder-map-bg.jpg') center/cover no-repeat;
  background-color: #dcc9a0;
  position: relative;
  transform-origin: 0 0;
  transition: transform .3s ease;
}

/* Zoom controls — fixed inside map-surface so they don't scroll */
.map-zoom {
  position: absolute; bottom: .8rem; right: .8rem;
  display: flex; flex-direction: column; gap: .3rem;
  z-index: 20;
}
.map-zoom button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid #8a6d2b;
  background: rgba(220,200,160,.92);
  color: #5a3e25;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  backdrop-filter: blur(4px);
  transition: all .2s;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.map-zoom button:hover { background: rgba(180,160,120,.95); border-color: #5a3e25; }

/* X close button — top-right of parchment */
.map-x-close {
  position: absolute; top: .6rem; right: .6rem;
  z-index: 25;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid #8a6d2b;
  background: rgba(60,40,20,.85);
  color: #dcc9a0;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  line-height: 1;
}
.map-x-close:hover { background: rgba(120,30,30,.8); border-color: #c55; color: #fff; }

/* Room hotspots on the map */
/* ══ AULA-V2-MARKER — Aula do Dia v2: horário, mapa, professores ══ */
/* ══ AULA-V2B-MARKER — roda das casas + avatar ══ */
.house-wheel-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto 1rem; }
.house-wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 0 30px rgba(197,153,62,.45), inset 0 0 40px rgba(0,0,0,.6);
  transition: transform 4s cubic-bezier(.17,.67,.16,1);
  position: relative;
}
.house-wheel-sector {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14px; font-size: 1.9rem;
  pointer-events: none;
}
.house-wheel-pin {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid var(--gold);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); z-index: 3;
}
.mentor-card {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 10px; padding: .55rem .9rem; margin-top: .8rem;
}
.mentor-card .m-emoji { font-size: 1.5rem; }
.mentor-card .m-label { font-size: .62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }
.mentor-card .m-name { font-family: 'Cinzel Decorative', serif; font-size: .8rem; color: var(--gold-light); }

/* ══ AULA-V2C-MARKER — avatar em SVG (feedback do Vasco) ══ */
/* Figura desenhada em SVG: corpo a serio, oculos nos olhos, cachecol ao pescoco. */
.avatar { position: relative; display: inline-block; flex-shrink: 0; line-height: 0; }
.avatar svg { display: block; width: 100%; height: auto; overflow: visible; }
.avatar .robe-shape { transition: fill .8s ease; }
.avatar-pet {
  position: absolute; right: -8%; bottom: 2%;
  font-size: calc(var(--sz, 64px) * .3); line-height: 1;
}

/* Portas do Salao Principal */
.hall-doors { position: fixed; inset: 0; z-index: 20001; overflow: hidden; background: #07070d; }
.hall-hall {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 58%, rgba(255,214,140,.55), rgba(150,100,30,.18) 45%, transparent 72%),
    linear-gradient(180deg, #120d08 0%, #1d1509 45%, #0b0906 100%);
}
.hall-candle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #ffd98a; box-shadow: 0 0 8px 3px rgba(255,200,110,.75);
  animation: candleFloat 3.5s ease-in-out infinite;
}
@keyframes candleFloat {
  0%,100% { transform: translateY(0); opacity: .85; }
  50%     { transform: translateY(-9px); opacity: 1; }
}
.hall-door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, #5a3a1e, #3b240f 55%, #26170a);
  border-top: 6px solid #2a1a0a;
  transition: transform 2.4s cubic-bezier(.55,.02,.3,1);
  will-change: transform;
  z-index: 2;
}
.hall-door::after {
  content: ''; position: absolute; top: 12%; bottom: 12%; width: 62%; left: 19%;
  border: 3px solid rgba(197,153,62,.5); border-radius: 50% 50% 6px 6px / 22% 22% 6px 6px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.55);
}
.hall-door.l { left: 0; transform-origin: left center; }
.hall-door.r { right: 0; transform-origin: right center; }
.hall-door .ring {
  position: absolute; top: 50%; width: 34px; height: 34px; margin-top: -17px;
  border: 4px solid rgba(197,153,62,.75); border-radius: 50%;
}
.hall-door.l .ring { right: 14px; }
.hall-door.r .ring { left: 14px; }
.hall-doors.open .hall-door.l { transform: perspective(1400px) rotateY(-108deg); }
.hall-doors.open .hall-door.r { transform: perspective(1400px) rotateY(108deg); }
.hall-caption {
  position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; z-index: 3;
  /* Cinzel, nao HarryP: a fonte decorativa nao tem glifos acentuados (ã, ç) */
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1rem, 3.2vw, 1.6rem); color: var(--gold-light);
  text-shadow: 0 0 18px rgba(255,200,110,.55); opacity: 0;
  transition: opacity 1.2s ease .9s;
}
.hall-doors.open .hall-caption { opacity: 1; }
/* ══ MODO-HISTORIA-A-MARKER — Grande Salao ══ */
/* ══ REALISMO-MARKER ══ */
/* Portoes do Salao — imagem fornecida pelo Vasco, com aproximacao lenta */
.gates-scene { position: fixed; inset: 0; z-index: 20003; overflow: hidden; background: #05040a; }
.gates-img {
  position: absolute; inset: -6%;
  background: url('/portoes-hogwarts.png') center 42%/cover no-repeat;
  animation: gateApproach 5s cubic-bezier(.4,0,.5,1) forwards;
}
@keyframes gateApproach {
  0%   { transform: scale(1);    filter: brightness(.72); }
  70%  { transform: scale(1.55); filter: brightness(1); }
  100% { transform: scale(2.1);  filter: brightness(1.25); }
}
.gates-veil {
  position: absolute; inset: 0; background: #f6e2ba; opacity: 0;
  animation: gateVeil 5s ease-in forwards;
}
@keyframes gateVeil { 0%,72% { opacity: 0; } 100% { opacity: 1; } }
.gates-caption {
  position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; z-index: 3;
  font-family: 'Cinzel Decorative', serif; font-size: clamp(.95rem, 3vw, 1.5rem);
  color: #f6dfae; text-shadow: 0 2px 14px rgba(0,0,0,.9);
  animation: fadeIn 1.4s .5s both;
}
/* Ecra de criacao do aluno — a zona "O teu aluno" vive aqui agora */
.create-scene {
  position: fixed; inset: 0; z-index: 20002; overflow-y: auto;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #1b1430, #0a0812 70%);
  padding: 1.2rem;
}
.create-inner { max-width: 560px; margin: 0 auto; }
.create-title {
  font-family: 'Cinzel Decorative', serif; color: var(--gold-light);
  text-align: center; font-size: clamp(1.1rem, 3.6vw, 1.6rem); margin-bottom: .8rem;
}
/* Placa de indicacao nos Segredos: a zona do aluno mudou-se para o jogo.
   Nao e o editor (o Vasco pediu para sair daqui) — e so a indicacao. */
.moved-note {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: center;
  background: linear-gradient(135deg,#1d1636,#141126);
  border: 1px solid var(--border-gold); border-radius: 12px;
  padding: .9rem 1.1rem; margin-bottom: 1.2rem; text-align: center;
}
.moved-note-txt { font-size: .84rem; color: var(--text-muted); }
.moved-note-txt b { color: var(--gold-light); font-family: 'Cinzel Decorative', serif; }
/* ══ AULAS-MARKER — horario do dia ══ */
/* ══ NOITE-MARKER ══ */
.game-clock {
  position: fixed; top: 12px; right: 12px; z-index: 20050;
  background: rgba(10,8,18,.88); border: 1px solid var(--border-gold);
  border-radius: 999px; padding: .32rem .8rem;
  font-family: 'Cinzel Decorative', serif; font-size: .78rem; color: var(--gold-light);
  box-shadow: 0 3px 14px rgba(0,0,0,.6); pointer-events: none;
}
/* ══ FINAL-MARKER — exames, noite, festas, profissoes ══ */
/* Prefixo game- : `.exam-q` e `.exam-progress` JA EXISTEM no site (N.I.E.M.s)
   e sem prefixo eu estava a alterar o espacamento desse exame. */
.game-exam-q { text-align: left; margin-bottom: 1rem; }
.game-exam-progress {
  font-family: 'Cinzel Decorative', serif; color: var(--gold);
  font-size: .72rem; letter-spacing: .1em; margin-bottom: .5rem;
}
.grade-badge {
  display: inline-block; font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.3rem, 5vw, 2rem); padding: .5rem 1.2rem; border-radius: 12px;
  border: 2px solid currentColor; margin: .6rem 0;
}
.grade-pass { color: #9fd49f; }
.grade-fail { color: #e0a0a0; }
.risk-row { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: .4rem; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.job-card {
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 12px; padding: .9rem .7rem; cursor: pointer; transition: all .2s;
}
.job-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.job-emoji { font-size: 1.9rem; display: block; margin-bottom: .3rem; }
.job-name { font-family: 'Cinzel Decorative', serif; color: var(--gold-light); font-size: .8rem; }
.job-desc { color: var(--text-muted); font-size: .7rem; margin-top: .2rem; line-height: 1.35; }
.feast.halloween span { filter: hue-rotate(-18deg) saturate(1.3); }
.night-scene {
  position: fixed; inset: 0; z-index: 20002; overflow-y: auto; padding: 1.2rem;
  background: radial-gradient(ellipse 90% 60% at 50% 10%, #1a1533, #08070f 72%);
  display: flex; align-items: center; justify-content: center;
}
.night-inner { max-width: 520px; width: 100%; text-align: center; }
.night-title {
  font-family: 'Cinzel Decorative', serif; color: var(--gold-light);
  font-size: clamp(1.1rem, 3.6vw, 1.55rem); margin-bottom: .4rem;
}
.night-txt { color: var(--text-muted); font-size: .86rem; margin-bottom: 1rem; line-height: 1.5; }
.feast { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1rem 0; }
.feast span { font-size: 1.7rem; animation: feastPop .5s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes feastPop { from { transform: scale(0) translateY(10px); } to { transform: none; } }
.pet-box {
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 14px; padding: 1.2rem; margin-bottom: 1rem;
}
.pet-emoji { font-size: 3.4rem; line-height: 1; display: block; margin-bottom: .5rem; }
.pet-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.key-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--bg-secondary); border: 1px solid var(--gold);
  border-radius: 10px; padding: .5rem .9rem; cursor: pointer;
  color: var(--gold-light); font-family: 'Lora', serif; font-size: .84rem;
}
.key-btn:hover { background: rgba(197,153,62,.16); }
.key-btn.done { opacity: .5; border-color: var(--border); color: var(--text-muted); cursor: default; }
.key-cap {
  display: inline-block; min-width: 1.3rem; text-align: center;
  background: #2a2340; border: 1px solid var(--border-gold); border-radius: 5px;
  padding: .05rem .3rem; font-family: 'Cinzel Decorative', serif; font-size: .74rem;
}
.stairs { display: flex; gap: .7rem; justify-content: center; margin: 1.2rem 0; flex-wrap: wrap; }
.stair {
  width: 78px; height: 108px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-gold); position: relative; overflow: hidden;
  background: linear-gradient(180deg, #3a2f22, #241c14);
  transition: transform .7s cubic-bezier(.5,0,.3,1), box-shadow .25s;
}
.stair:hover { box-shadow: 0 0 16px rgba(197,153,62,.4); }
.stair::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.09) 0 3px, transparent 3px 14px);
}
.stair-label {
  position: absolute; bottom: 4px; left: 0; right: 0; text-align: center;
  font-size: .68rem; color: var(--gold-light); z-index: 2;
}
.dorm-bed {
  width: 110px; height: 70px; margin: 0 auto 1rem; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--dormc, #9d1f1f), #2a1a12);
  border: 1px solid rgba(0,0,0,.5); position: relative;
}
.dorm-bed::before {
  content: ''; position: absolute; top: 6px; left: 10px; width: 34px; height: 18px;
  border-radius: 4px; background: #efe6d2; opacity: .85;
}
.sched-scene {
  position: fixed; inset: 0; z-index: 20002; overflow-y: auto; padding: 1.2rem;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #1a1530, #0a0812 70%);
}
.sched-inner { max-width: 540px; margin: 0 auto; }
.sched-title {
  font-family: 'Cinzel Decorative', serif; color: var(--gold-light);
  text-align: center; font-size: clamp(1.1rem, 3.6vw, 1.6rem);
}
.sched-sub { text-align: center; color: var(--text-muted); font-size: .82rem; margin-bottom: 1rem; }
.sched-row {
  display: flex; align-items: center; gap: .8rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: .8rem .9rem; margin-bottom: .6rem;
}
.sched-row.done { opacity: .55; border-color: rgba(120,200,120,.35); }
.sched-time {
  font-family: 'Cinzel Decorative', serif; color: var(--gold);
  font-size: .82rem; min-width: 3.4rem;
}
.sched-info { flex: 1; min-width: 0; }
.sched-subject { color: var(--bright); font-size: .92rem; }
.sched-meta { color: var(--text-muted); font-size: .74rem; }
.sched-go {
  border: 1px solid var(--gold); background: rgba(197,153,62,.12);
  color: var(--gold-light); border-radius: 8px; padding: .4rem .8rem;
  font-family: 'Lora', serif; font-size: .8rem; cursor: pointer; white-space: nowrap;
}
.sched-go:hover { background: rgba(197,153,62,.25); }
.sched-done-mark { color: #9fd49f; font-size: 1.1rem; }
.sched-foot { text-align: center; margin-top: 1rem; }
.year-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 999px; padding: .35rem .9rem; font-size: .76rem; color: var(--text-muted);
}
.year-chip b { color: var(--gold-light); font-family: 'Cinzel Decorative', serif; }
.gh-scene {
  position: fixed; inset: 0; z-index: 20002; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 40% at 50% 12%, rgba(60,44,20,.55), transparent 70%),
    linear-gradient(180deg, #0a0812 0%, #140f14 40%, #0a0810 100%);
  display: flex; flex-direction: column; align-items: center;
}
.gh-ceiling { position: absolute; top: 0; left: 0; right: 0; height: 42%; pointer-events: none; }
.gh-banners {
  position: absolute; top: 4%; left: 0; right: 0;
  display: flex; justify-content: center; gap: clamp(8px, 3vw, 36px); pointer-events: none;
}
.gh-banner {
  width: clamp(26px, 5vw, 52px); height: clamp(60px, 12vh, 110px);
  border-radius: 3px 3px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 8px; font-size: clamp(.9rem, 2.4vw, 1.4rem);
  box-shadow: 0 6px 20px rgba(0,0,0,.6); opacity: .9;
}
.gh-front {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; z-index: 6;
}
.gh-hat-img {
  width: clamp(64px, 12vw, 104px); height: auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.7));
  transition: transform 1.1s cubic-bezier(.4,1.3,.5,1);
}
/* O Chapeu desce e assenta MESMO na cabeca do aluno (pedido do Vasco). */
.gh-front.hat-on-head .gh-hat-img { transform: translateY(clamp(14px, 3vw, 26px)) scale(.92); }
.gh-stool {
  width: clamp(50px, 9vw, 76px); height: clamp(26px, 5vw, 40px); margin-top: -6px;
  background: linear-gradient(180deg, #6b4a24, #3a2712);
  border-radius: 6px 6px 3px 3px; box-shadow: 0 8px 16px rgba(0,0,0,.6);
  position: relative;
}
.gh-stool::after {
  content: ''; position: absolute; bottom: -14px; left: 12%; right: 12%; height: 14px;
  background: linear-gradient(180deg, #4a3218, #2a1c0c);
  clip-path: polygon(0 0, 18% 0, 26% 100%, 12% 100%, 100% 0, 82% 0, 74% 100%, 88% 100%);
}
.gh-mcg {
  position: absolute; top: 30%; left: 50%; margin-left: clamp(60px, 13vw, 130px);
  display: flex; flex-direction: column; align-items: center; z-index: 4; font-size: 2rem;
}
.gh-mcg-label { font-family: 'Cinzel Decorative', serif; font-size: .58rem; color: var(--gold); white-space: nowrap; }
.gh-tables {
  position: absolute; bottom: 0; left: 0; right: 0; height: 46%;
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(4px, 1.6vw, 20px);
  perspective: 700px;
}
.gh-table {
  width: clamp(66px, 17vw, 168px); height: 100%;
  transform: rotateX(52deg); transform-origin: bottom center;
  background: linear-gradient(180deg, rgba(120,90,50,.16), rgba(90,66,34,.5));
  border-top: 3px solid rgba(197,153,62,.35);
  border-radius: 6px 6px 0 0;
  display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center;
  gap: 4px; padding: 6px 4px;
}
.gh-seat { width: 24px; height: 30px; line-height: 0; opacity: .82; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.gh-seat svg { display: block; }
.gh-seat.new { animation: seatPop .5s cubic-bezier(.34,1.56,.64,1); opacity: 1; }
@keyframes seatPop { from { transform: scale(0); } to { transform: scale(1); } }
/* Coluna unica: nome, casa, mentor e boas-vindas nunca se sobrepoem. */
.gh-caller {
  position: absolute; top: 58%; left: 0; right: 0; bottom: 4%; z-index: 5; padding: 0 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: .4rem; overflow-y: auto;
}
.gh-call-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.1rem, 3.4vw, 1.9rem); color: var(--gold-light);
  text-shadow: 0 0 16px rgba(255,200,110,.4); min-height: 1.6em;
}
.gh-call-house { font-family: 'Lora', serif; font-size: clamp(.8rem,2.2vw,1rem); margin-top: .3rem; min-height: 1.4em; }
/* Sem position/transform: vive na coluna .gh-caller, para nao colidir com o
   transform proprio de .btn-magic nem tapar as mesas no telemovel. */
.gh-cta { margin-top: .5rem; animation: fadeIn .6s both; }
/* Bloco final de boas-vindas — dentro da coluna, nao sobreposto */
.gh-welcome { text-align: center; animation: fadeIn .6s both; margin-top: .3rem; }
.gh-avatar-seat { position: absolute; top: 31%; left: 50%; transform: translateX(-50%); z-index: 5; }
/* ══ RESORT-MARKER — repetir a seleccao ══ */
.resort-row { margin-top: .5rem; min-height: 1.6rem; }
.resort-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-family: 'Lora', serif; font-size: .74rem;
  text-decoration: underline; text-underline-offset: 3px; padding: .25rem .4rem;
  transition: color .2s;
}
.resort-btn:hover { color: var(--gold-light); }
.resort-confirm { font-size: .74rem; color: var(--text); display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.resort-yes, .resort-no {
  border-radius: 6px; padding: .2rem .6rem; cursor: pointer; font-size: .72rem;
  font-family: 'Lora', serif; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
}
.resort-yes { border-color: rgba(197,153,62,.6); color: var(--gold-light); }
.resort-yes:hover { background: rgba(197,153,62,.15); }
.resort-no:hover { background: rgba(255,255,255,.06); }
.game-start-btn {
  display: block; width: 100%; margin-top: .9rem;
  background: linear-gradient(135deg, #2a1f47, #1a1530);
  border: 1px solid var(--gold); border-radius: 10px; padding: .7rem 1rem;
  color: var(--gold-light); font-family: 'Cinzel Decorative', serif; font-size: .9rem;
  cursor: pointer; transition: all .25s;
}
.game-start-btn:hover { background: linear-gradient(135deg,#3a2b5f,#241d42); box-shadow: 0 0 18px rgba(197,153,62,.3); }
.game-start-btn:disabled { opacity: .45; cursor: not-allowed; }
.avatar-name-row { margin: .6rem auto .2rem; max-width: 260px; }
.avatar-name-input {
  width: 100%; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 8px; padding: .5rem .7rem; margin-top: .25rem;
  color: var(--gold-light); font-family: 'Cinzel Decorative', serif; font-size: .9rem;
}
.avatar-name-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 10px rgba(197,153,62,.3); }
.avatar-name-input::placeholder { color: var(--text-muted); font-family: 'Lora', serif; font-style: italic; font-size: .8rem; }
.avatar-name-msg { display: none; color: #e0a0a0; font-size: .72rem; margin-top: .3rem; }
.avatar-editor-grid { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: .5rem 0 1rem; }
.avatar-opt {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: .4rem .6rem; cursor: pointer;
  font-size: 1.15rem; line-height: 1; transition: all .2s;
}
.avatar-opt:hover { border-color: var(--gold); transform: translateY(-2px); }
.avatar-opt.sel { border-color: var(--gold); background: rgba(197,153,62,.16); box-shadow: 0 0 10px rgba(197,153,62,.25); }
.avatar-opt.swatch { width: 34px; height: 34px; padding: 0; }
.avatar-row-label {
  font-family: 'Cinzel Decorative', serif; font-size: .62rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em; text-align: center; margin-top: .5rem;
}
.avatar-section {
  background: var(--bg-secondary); border: 1px solid var(--border-gold);
  border-radius: 12px; padding: 1.1rem; margin-bottom: 1.2rem; text-align: center;
}
@media (max-width: 480px) {
  .house-wheel-wrap { width: 210px; height: 210px; }
  .house-wheel-sector { font-size: 1.5rem; }
}
.timetable-card {
  background: linear-gradient(135deg, #17131f, #0e0e1a);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  text-align: center;
}
.timetable-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.timetable-subject {
  font-family: 'HarryP', 'Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  color: var(--gold-light);
  line-height: 1.1;
  margin: .25rem 0 .1rem;
}
.timetable-room {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: .85rem;
  color: var(--text-muted);
}
.timetable-prof {
  font-size: .8rem;
  color: var(--text);
  margin-top: .5rem;
}
.mini-map {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 2;
  margin: 1rem auto .4rem;
  border-radius: 10px;
  border: 1px solid rgba(197,153,62,.35);
  background: #d9c9a3 url('/marauder-map-bg.jpg') center/cover no-repeat;
  overflow: hidden;
}
.mini-map-dot {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid #7a2020;
  background: rgba(120,20,20,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.mini-map-dot::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(120,20,20,.5);
  animation: hotspotPulse 2s ease-in-out infinite;
}
.mini-map-name {
  position: absolute;
  transform: translate(-50%, 22px);
  font-family: 'Cinzel Decorative', serif;
  font-size: .58rem;
  color: #5a2020;
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(220,200,160,.9);
}
.prof-stage {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
  margin-bottom: .8rem;
}
.prof-portrait {
  flex-shrink: 0;
  width: 62px; height: 74px;
  border-radius: 8px;
  border: 2px solid var(--gold-dark);
  background: radial-gradient(circle at 50% 35%, #241d33, #12101c);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 14px rgba(197,153,62,.18), inset 0 0 18px rgba(0,0,0,.5);
}
.prof-bubble { flex: 1; min-width: 0; }
.prof-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: .74rem;
  color: var(--gold);
  margin-bottom: .25rem;
}
.prof-says {
  font-family: 'Lora', serif;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}
.prof-says.scold { color: #e0a0a0; }
.prof-says.praise { color: #b9dcb0; }
@media (max-width: 480px) {
  .prof-portrait { width: 50px; height: 60px; font-size: 1.6rem; }
  .prof-says { font-size: .82rem; }
}
.map-hotspot {
  position: absolute;
  cursor: pointer;
  text-align: center;
  transition: transform .3s;
  z-index: 5;
}
.map-hotspot:hover { transform: scale(1.12); }
.map-hotspot-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid #7a2020;
  background: rgba(120,20,20,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto;
  box-shadow: 0 0 12px rgba(120,20,20,.2);
  transition: all .3s;
  position: relative;
}
.map-hotspot:hover .map-hotspot-ring {
  border-color: #a03030;
  background: rgba(120,20,20,.25);
  box-shadow: 0 0 20px rgba(160,40,40,.4);
}
.map-hotspot-ring::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(120,20,20,.25);
  animation: hotspotPulse 2.5s ease-in-out infinite;
}
@keyframes hotspotPulse {
  0%,100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.15); opacity: .2; }
}
.map-hotspot-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: .52rem;
  color: #5a2020;
  margin-top: .15rem;
  text-shadow: 0 0 3px rgba(220,200,160,.8);
  max-width: 80px;
  line-height: 1.2;
}
.map-hotspot-sub {
  font-size: .45rem;
  color: #8a6d2b;
  font-family: 'Lora', serif;
  font-style: italic;
}

/* Footprints walking across the map */
.map-footprint {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.map-footprint-steps {
  font-size: .6rem;
  color: #5a3020;
  letter-spacing: .1em;
}
.map-footprint-name {
  font-size: .44rem;
  color: #5a3020;
  font-family: 'Cinzel Decorative', serif;
  white-space: nowrap;
}
/* Walking animation: footprints move along a path */
@keyframes walkRight { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(120px,-30px);opacity:0} }
@keyframes walkLeft { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(-100px,20px);opacity:0} }
@keyframes walkDown { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(30px,100px);opacity:0} }
@keyframes walkUp { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(-20px,-110px);opacity:0} }
@keyframes walkDiag { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(80px,70px);opacity:0} }
@keyframes walkDiag2 { 0%{transform:translate(0,0);opacity:.7} 100%{transform:translate(-70px,-80px);opacity:0} }

/* Map header overlay (top of map surface) */
.map-header-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  text-align: center;
  padding: .6rem;
  background: linear-gradient(rgba(220,200,160,.9), rgba(220,200,160,0));
  z-index: 10;
  pointer-events: none;
}
.map-header-overlay .map-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: .8rem;
  color: #4a3520;
  letter-spacing: .08em;
}

/* Map bottom bar */
.map-bottom-bar {
  background: rgba(60,40,20,.9);
  padding: .5rem .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.map-close-btn {
  background: none;
  border: 1.5px solid #b8a07a;
  color: #dcc9a0;
  padding: .3rem 1rem;
  border-radius: 20px;
  font-family: 'Cinzel Decorative', serif;
  font-size: .7rem;
  cursor: pointer;
  transition: all .3s;
}
.map-close-btn:hover {
  background: rgba(220,200,160,.15);
  border-color: #dcc9a0;
}
.map-authors {
  font-size: .5rem;
  color: #9a8060;
  font-style: italic;
}

@media (max-width: 600px) {
  .map-canvas { width: 1000px; height: 1000px; }
  .map-hotspot-ring { width: 44px; height: 44px; font-size: 1.1rem; }
  .map-hotspot-label { font-size: .5rem; }
  .map-zoom button { width: 34px; height: 34px; font-size: 1.1rem; }
  .map-x-close { width: 34px; height: 34px; font-size: 1rem; }
}

.share-toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  color: var(--gold-light);
  padding: .6rem 1.2rem;
  border-radius: 20px;
  font-size: .85rem;
  z-index: 30000;
  animation: fadeIn .3s;
  pointer-events: none;
}

/* ── Diagon Alley / Wands ── */
.wand-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.wand-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.wand-owner {
  font-family: 'HarryP', 'Cinzel Decorative', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: .3rem;
}
.wand-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
  margin: .8rem 0;
}
.wand-spec {
  background: rgba(197,153,62,.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .4rem .6rem;
  font-size: .78rem;
}
.wand-spec-label { color: var(--text-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.wand-spec-value { color: var(--gold-light); font-weight: 700; }
.wand-history { margin-top: .8rem; }
.wand-history-item {
  padding: .3rem 0 .3rem 1rem;
  border-left: 2px solid var(--border);
  font-size: .8rem;
  color: var(--text);
  margin-bottom: .3rem;
  position: relative;
}
.wand-history-item::before {
  content: '';
  position: absolute;
  left: -5px; top: .55rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-dark);
}
.wand-spells-list {
  display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem;
}
.wand-spell-tag {
  padding: .2rem .5rem;
  background: rgba(197,153,62,.1);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  font-size: .72rem;
  color: var(--gold);
}
.wand-power-bar {
  display: flex; align-items: center; gap: .4rem; margin: .2rem 0;
  font-size: .75rem;
}
.wand-power-bar-label { color: var(--text-muted); min-width: 80px; }
.wand-power-bar-track {
  flex: 1; height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}
.wand-power-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s;
}
.wand-lore-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .8rem;
}
.wand-lore-card h4 { color: var(--gold); font-size: .9rem; margin-bottom: .3rem; }
.wand-lore-card p { color: var(--text-muted); font-size: .78rem; line-height: 1.5; }
/* ── Creatures ── */
.creature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem;
  cursor: pointer;
  transition: all .3s;
  text-align: center;
}
.creature-card:hover { border-color: var(--gold-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,.3); }
.creature-card.active { border-color: var(--gold); background: rgba(197,153,62,.06); }
.creature-emoji { font-size: 2.8rem; margin-bottom: .3rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.creature-name { font-size: .8rem; color: var(--gold-light); font-weight: 700; }
.creature-class { font-size: .65rem; color: var(--text-muted); }
.creature-detail {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.creature-detail::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.creature-detail h3 { font-family: 'HarryP','Cinzel Decorative',serif; color: var(--gold-light); font-size: 1.3rem; margin-bottom: .2rem; }
.creature-danger { display: flex; gap: .15rem; margin: .5rem 0; }
.creature-danger-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--border); }
.creature-danger-dot.filled { background: #e74c3c; border-color: #e74c3c; }
.cq-question { font-size: .95rem; color: var(--text); margin-bottom: .8rem; line-height: 1.5; }
.cq-opt {
  display: block; width: 100%; text-align: left;
  padding: .5rem .8rem; margin-bottom: .4rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'Lora',serif;
  font-size: .85rem; cursor: pointer; transition: all .2s;
}
.cq-opt:hover { border-color: var(--gold-dark); background: rgba(197,153,62,.06); }
.cq-opt.correct { border-color: #22c55e; background: rgba(34,197,94,.1); }
.cq-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); }
.cq-opt:disabled { pointer-events: none; opacity: .7; }

/* Beco Diagonal anchor scroll offset */
#diagon-wands, #diagon-gringotts, #diagon-beasts, #diagon-potions {
  scroll-margin-top: 140px;
}

/* ══ GRINGOTTS BANK ══ */
.gringotts-poem {
  background: linear-gradient(135deg, rgba(60,40,20,.15), rgba(120,80,30,.08));
  border: 1px solid rgba(138,109,43,.3);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin: 1rem auto 1.5rem;
  max-width: 500px;
  text-align: center;
  font-family: 'Lora', serif;
  font-size: .82rem;
  color: #b8a07a;
  line-height: 2;
  font-style: italic;
  position: relative;
}
.gringotts-poem::before {
  content: '⚔️';
  position: absolute;
  top: -.6rem; left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  background: var(--bg-card);
  padding: 0 .4rem;
}
.coin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.coin-card {
  text-align: center;
  padding: 1.2rem .8rem;
  border-radius: 12px;
  border: 2px solid;
  position: relative;
  overflow: hidden;
}
.coin-card::before {
  content: '';
  position: absolute; inset: 0;
  opacity: .06;
  border-radius: 12px;
}
.coin-card.gold {
  border-color: #c5993e;
  background: linear-gradient(135deg, rgba(197,153,62,.12), rgba(197,153,62,.04));
}
.coin-card.silver {
  border-color: #a0a8b4;
  background: linear-gradient(135deg, rgba(160,168,180,.12), rgba(160,168,180,.04));
}
.coin-card.bronze {
  border-color: #b87333;
  background: linear-gradient(135deg, rgba(184,115,51,.12), rgba(184,115,51,.04));
}
.coin-emoji {
  font-size: 2.8rem;
  margin-bottom: .4rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}
.coin-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: .9rem;
  margin-bottom: .2rem;
}
.coin-card.gold .coin-name { color: #dbb65c; }
.coin-card.silver .coin-name { color: #c8cdd4; }
.coin-card.bronze .coin-name { color: #d4944a; }
.coin-value {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.coin-converter {
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.2rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.coin-converter input {
  width: 80px;
  padding: .4rem .6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .95rem;
  text-align: center;
}
.coin-converter select {
  padding: .4rem .6rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--gold-light);
  font-family: 'Lora', serif;
  font-size: .85rem;
}
.coin-result {
  font-size: .85rem;
  color: var(--gold-light);
  min-width: 180px;
  text-align: center;
  line-height: 1.5;
}

/* Vault */
.vault-container {
  position: relative;
  max-width: 400px;
  margin: 1.5rem auto;
  text-align: center;
}
.vault-door {
  width: 180px; height: 200px;
  margin: 0 auto;
  border-radius: 90px 90px 8px 8px;
  border: 3px solid #8a6d2b;
  background: linear-gradient(145deg, #5a4a2a, #3a2a18);
  position: relative;
  cursor: pointer;
  transition: all .6s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.5), inset 0 2px 10px rgba(0,0,0,.3);
  overflow: hidden;
}
.vault-door::before {
  content: '';
  position: absolute;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 3px solid #c5993e;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(197,153,62,.3);
  transition: all .6s;
}
.vault-door::after {
  content: '🔒';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  transition: all .6s;
}
.vault-door.open {
  transform: perspective(600px) rotateY(-75deg);
  border-color: #c5993e;
  box-shadow: 5px 4px 30px rgba(197,153,62,.3);
}
.vault-door.open::after { content: '🔓'; opacity: .3; }
.vault-inside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 .5rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .5s .3s, max-height .5s .2s;
}
.vault-inside.visible {
  opacity: 1;
  max-height: 150px;
}
.vault-balance {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.6rem;
  color: #dbb65c;
  text-shadow: 0 2px 8px rgba(197,153,62,.4);
}
.vault-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.vault-number {
  font-size: .7rem;
  color: #8a6d2b;
  margin-bottom: .6rem;
  font-family: 'Cinzel Decorative', serif;
}

@media (max-width: 600px) {
  .coin-grid { grid-template-columns: 1fr; max-width: 260px; margin: 1rem auto; }
  .coin-converter { flex-direction: column; gap: .4rem; }
  .vault-door { width: 140px; height: 160px; }
  .wand-specs { grid-template-columns: 1fr 1fr; }
  #wandLoreGrid { grid-template-columns: 1fr; }
  #creatureGrid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ══ CARD ALBUM ══ */
.card-album { max-width: 750px; margin: 0 auto; padding: 1rem 0; }
.card-album-stats {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 1rem; font-size: .8rem; color: var(--text-muted);
}
.card-album-stats strong { color: var(--gold-light); }
.card-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: .6rem;
}
.frog-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .6rem .4rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  position: relative;
  min-height: 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.frog-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.frog-card.collected { border-color: var(--gold-dark); }
.frog-card.locked { opacity: .5; }
.frog-card.locked .fc-emoji { filter: grayscale(1) brightness(.3); }
.frog-card.rarity-comum { border-color: #6b7280; }
.frog-card.rarity-rara { border-color: #3b82f6; }
.frog-card.rarity-lendaria { border-color: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,.15); }
.frog-card.rarity-lendaria.collected { box-shadow: 0 0 20px rgba(245,158,11,.25); }
.fc-emoji { font-size: 2rem; margin-bottom: .3rem; }
.fc-name { font-size: .7rem; color: var(--text); font-weight: 600; line-height: 1.3; }
.fc-rarity {
  font-size: .55rem; margin-top: .2rem; padding: .1rem .4rem;
  border-radius: 4px; display: inline-block;
}
.fc-rarity.comum { background: rgba(107,114,128,.2); color: #9ca3af; }
.fc-rarity.rara { background: rgba(59,130,246,.15); color: #60a5fa; }
.fc-rarity.lendaria { background: rgba(245,158,11,.15); color: #fbbf24; }

/* Card detail overlay */
.card-detail-overlay {
  position: fixed; inset: 0; z-index: 20000;
  background: rgba(0,0,0,.8);
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.card-detail-overlay.active { display: flex; }
.card-detail {
  background: var(--bg-card);
  border: 3px solid var(--gold-dark);
  border-radius: 16px;
  padding: 2rem;
  max-width: 320px; width: 90%;
  text-align: center;
  cursor: default;
  animation: cardReveal .4s ease-out;
}
@keyframes cardReveal {
  0% { opacity: 0; transform: scale(.7) rotateY(90deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0); }
}

/* Pack opening */
.pack-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.2rem;
  background: linear-gradient(135deg, rgba(197,153,62,.15), rgba(197,153,62,.05));
  border: 1.5px solid var(--gold-dark);
  border-radius: 10px;
  color: var(--gold-light);
  font-family: 'Lora', serif;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.pack-btn:hover { background: rgba(197,153,62,.2); transform: translateY(-1px); }
.pack-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.pack-result {
  display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1rem; min-height: 60px;
}
.pack-card-reveal {
  animation: packCardIn .5s ease-out both;
  border-radius: 10px;
  padding: .5rem;
  text-align: center;
  min-width: 80px;
}
@keyframes packCardIn {
  0% { opacity: 0; transform: translateY(20px) rotateY(90deg); }
  100% { opacity: 1; transform: translateY(0) rotateY(0); }
}
.card-cat-tabs {
  display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card-cat-tab {
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .72rem;
  cursor: pointer;
  transition: all .2s;
}
.card-cat-tab.active { border-color: var(--gold-dark); color: var(--gold-light); background: rgba(197,153,62,.08); }

/* ══ DOBBY'S ROOM ══ */
.dobby-room {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 0;
}
.dobby-room-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.dobby-room-portrait {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(197,153,62,.3));
  margin-bottom: .5rem;
}
.dobby-chat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  min-height: 300px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  scroll-behavior: smooth;
}
.dobby-msg {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  animation: dobbyMsgIn .3s ease-out;
}
.dobby-msg.user {
  flex-direction: row-reverse;
}
@keyframes dobbyMsgIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.dobby-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(197,153,62,.12);
  border: 1px solid rgba(197,153,62,.3);
}
.dobby-msg-avatar img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.dobby-msg-bubble {
  background: rgba(197,153,62,.08);
  border: 1px solid rgba(197,153,62,.2);
  border-radius: 12px 12px 12px 4px;
  padding: .6rem .9rem;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.6;
  max-width: 80%;
}
.dobby-msg.user .dobby-msg-bubble {
  background: rgba(99,102,241,.1);
  border-color: rgba(99,102,241,.25);
  border-radius: 12px 12px 4px 12px;
}
.dobby-msg-bubble em { color: var(--gold-light); }
.dobby-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .6rem;
}
.dobby-quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: .45rem .7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.dobby-quiz-opt:hover { border-color: var(--gold-dark); background: rgba(197,153,62,.06); }
.dobby-quiz-opt.correct { border-color: #22c55e; background: rgba(34,197,94,.1); }
.dobby-quiz-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); }
.dobby-quiz-opt:disabled { pointer-events: none; opacity: .7; }
.dobby-actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.dobby-action-btn {
  padding: .5rem 1rem;
  background: rgba(197,153,62,.1);
  border: 1.5px solid rgba(197,153,62,.3);
  border-radius: 20px;
  color: var(--gold-light);
  font-family: 'Lora', serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.dobby-action-btn:hover {
  background: rgba(197,153,62,.2);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* ══ OWL POST ══ */
.owl-post-btn {
  position: relative;
}
.owl-post-badge {
  position: absolute; top: -5px; right: -5px;
  background: #ef4444; color: #fff;
  border-radius: 50%;
  width: 16px; height: 16px;
  font-size: .6rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  line-height: 1;
}
.owl-post-badge.visible { display: flex; }
.owl-post-overlay {
  position: fixed; inset: 0; z-index: 25000;
  background: rgba(0,0,0,.75);
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.owl-post-overlay.active { display: flex; }
.owl-post-box {
  background: var(--bg-card);
  border: 2px solid #8a6d2b;
  border-radius: 14px;
  width: min(95vw, 420px);
  max-height: 80vh;
  overflow-y: auto;
  cursor: default;
  animation: cardReveal .4s ease-out;
}
.owl-post-header {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .6rem;
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.owl-post-header h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold-light);
  font-size: .9rem;
  margin: 0; flex: 1;
}
.owl-post-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer; padding: 0;
}
.owl-letter {
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  display: flex; gap: .6rem;
  align-items: flex-start;
  transition: background .2s;
}
.owl-letter:last-child { border-bottom: none; }
.owl-letter.unread { background: rgba(197,153,62,.06); }
.owl-letter-icon {
  font-size: 1.3rem; flex-shrink: 0; margin-top: .1rem;
}
.owl-letter-body { flex: 1; }
.owl-letter-from {
  font-size: .68rem; color: var(--gold-dark);
  font-weight: 600; margin-bottom: .15rem;
}
.owl-letter-text {
  font-size: .78rem; color: var(--text);
  line-height: 1.5;
}
.owl-letter-time {
  font-size: .6rem; color: var(--text-muted);
  margin-top: .2rem;
}
.owl-letter-action {
  display: inline-block; margin-top: .3rem;
  padding: .2rem .5rem;
  background: rgba(197,153,62,.1);
  border: 1px solid rgba(197,153,62,.2);
  border-radius: 6px;
  color: var(--gold-light);
  font-size: .68rem;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.owl-letter-action:hover { background: rgba(197,153,62,.2); }
.owl-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: .8rem;
}

/* ══ SNITCH CHASE GAME ══ */
.snitch-game {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 0;
  text-align: center;
}
.snitch-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #8a6d2b;
  box-shadow: 0 4px 30px rgba(0,0,0,.5);
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.snitch-canvas-wrap canvas {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #0a1628 0%, #1a2a1a 50%, #0a1a10 100%);
  touch-action: none;
}
.snitch-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 1rem;
  background: rgba(10,10,20,.8);
  border-bottom: 1px solid #8a6d2b44;
  font-size: .8rem;
}
.snitch-score { color: #dbb65c; font-weight: 700; font-family: 'Cinzel Decorative', serif; }
.snitch-lives { color: #ef4444; }
.snitch-start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8,8,16,.85);
  z-index: 5;
  transition: opacity .4s;
}
.snitch-start-overlay.hidden { opacity: 0; pointer-events: none; }
.snitch-high { font-size: .75rem; color: var(--text-muted); margin-top: .8rem; }

/* ══ BASILISCO GAME ══ */
.basilisk-game {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 0;
  text-align: center;
}
.basilisk-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #1A472A;
  box-shadow: 0 4px 30px rgba(0,0,0,.5);
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.basilisk-canvas-wrap canvas {
  display: block;
  width: 100%;
  background: #0a0f0a;
  touch-action: none;
}
.basilisk-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 1rem;
  background: rgba(10,15,10,.9);
  border-bottom: 1px solid #1A472A44;
  font-size: .8rem;
}
.basilisk-score { color: #4ade80; font-weight: 700; font-family: 'Cinzel Decorative', serif; }
.basilisk-length { color: var(--text-muted); font-size: .75rem; }
.basilisk-start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8,12,8,.88);
  z-index: 5;
  transition: opacity .4s;
}
.basilisk-start-overlay.hidden { opacity: 0; pointer-events: none; }
.basilisk-controls {
  justify-content: center;
  margin-top: .6rem;
}
.basilisk-dir-btn {
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1.5px solid #1A472A;
  background: rgba(26,71,42,.15);
  color: #4ade80;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.basilisk-dir-btn:active { background: rgba(26,71,42,.4); transform: scale(.95); }
@media (min-width: 601px) {
  .basilisk-controls { display: none !important; }
}

/* Game expand — larger inline, not fullscreen */
.game-expand-btn {
  position: absolute;
  top: .4rem; right: .4rem;
  z-index: 10;
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5);
  color: #ddd;
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: all .2s;
}
.game-expand-btn:hover { background: rgba(0,0,0,.7); border-color: var(--gold-dark); }

.snitch-canvas-wrap.expanded { max-width: min(95vw, 900px); }
.basilisk-canvas-wrap.expanded { max-width: min(95vw, 800px); }

/* Leaderboard */
.game-leaderboard {
  max-width: 400px;
  margin: 1.2rem auto 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.game-lb-title {
  padding: .5rem .8rem;
  font-family: 'Cinzel Decorative', serif;
  font-size: .8rem;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.game-lb-row {
  display: flex;
  align-items: center;
  padding: .35rem .8rem;
  font-size: .78rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.game-lb-row:last-child { border-bottom: none; }
.game-lb-rank {
  width: 24px;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
}
.game-lb-rank.gold { color: #dbb65c; }
.game-lb-rank.silver { color: #c8cdd4; }
.game-lb-rank.bronze { color: #d4944a; }
.game-lb-name {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-lb-score {
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
  margin-left: .5rem;
}
.game-lb-input {
  display: flex;
  gap: .4rem;
  padding: .5rem .8rem;
  border-top: 1px solid var(--border);
}
.game-lb-input input {
  flex: 1;
  padding: .3rem .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: .8rem;
}
.game-lb-input button {
  padding: .3rem .6rem;
  background: rgba(197,153,62,.1);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--gold-light);
  font-size: .75rem;
  cursor: pointer;
}

/* ══ LIVRARIA ══ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .8rem;
  margin: 1rem 0;
}
.book-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem;
  text-align: center;
  transition: all .2s;
}
.book-card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
}
.book-card-num {
  font-family: 'HarryP', 'Cinzel Decorative', serif;
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-bottom: .3rem;
}
.book-card-title {
  font-size: .75rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: .3rem;
}
.book-card-year {
  font-size: .65rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.book-card a {
  display: inline-block;
  padding: .25rem .6rem;
  background: rgba(197,153,62,.1);
  border: 1px solid rgba(197,153,62,.3);
  border-radius: 6px;
  color: var(--gold-light);
  font-size: .7rem;
  text-decoration: none;
  transition: all .2s;
}
.book-card a:hover {
  background: rgba(197,153,62,.2);
  border-color: var(--gold);
}

/* ══ HOUSE POINTS BAR ══ */
.hp-bar {
  position:fixed; bottom:0; left:0; right:0; height:44px; z-index:200;
  display:flex; align-items:center; gap:.4rem; padding:0 .6rem;
  background:rgba(8,8,16,.94); backdrop-filter:blur(8px);
  border-top:1px solid var(--border);
  overflow-x:auto; overflow-y:hidden;
  scrollbar-width:none;
}
.hp-bar::-webkit-scrollbar { display:none; }
.hp-bar-house { font-size:1rem; flex-shrink:0; }
.hp-bar-name { font-family:'Cinzel Decorative',serif; font-size:.62rem; color:var(--gold); flex-shrink:0; max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hp-bar-track { flex:0 0 auto; width:80px; height:5px; background:var(--bg-card); border-radius:3px; overflow:hidden; }
.hp-bar-fill { height:100%; border-radius:3px; transition:width .6s; }
.hp-bar-pts { font-size:.72rem; font-weight:700; flex-shrink:0; }
.hp-bar-gold { font-size:.68rem; color:#dbb65c; flex-shrink:0; cursor:pointer; }
.hp-bar-gold:hover { color:#fbbf24; }
.hp-bar-level { font-size:.58rem; color:var(--text-muted); flex-shrink:0; display:none; }
@media(min-width:800px){ .hp-bar-level { display:block; } }
.hp-bar-sort-btn { background:none; border:1px solid var(--border); border-radius:8px; padding:.15rem .4rem; font-size:.6rem; color:var(--text-muted); cursor:pointer; white-space:nowrap; transition:all .2s; flex-shrink:0; }
.hp-bar-sort-btn:hover { border-color:var(--gold); color:var(--gold); }
.pts-popup { position:fixed; z-index:20001; pointer-events:none; font-family:'Cinzel Decorative',serif; font-size:.85rem; color:var(--gold-light); text-shadow:0 0 8px rgba(197,153,62,.6); animation:ptsFloat 1.8s ease-out forwards; }
@keyframes ptsFloat { 0%{opacity:1;transform:translateY(0) scale(1)} 60%{opacity:1;transform:translateY(-40px) scale(1.1)} 100%{opacity:0;transform:translateY(-70px) scale(.9)} }
body { padding-bottom:50px; }

/* ══ SPELL DUEL ══ */
.duel-container { max-width:860px; margin:0 auto; }
.duel-arena { position:relative; border-radius:12px; overflow:hidden; background:radial-gradient(ellipse at 50% 20%,#1a0a2e 0%,#080810 70%); border:1px solid #3a3060; padding:1.5rem 1rem; margin-bottom:1rem; }
.duel-vs-row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:1rem; }
.duel-fighter { flex:1; text-align:center; }
.duel-fighter-emoji { font-size:2.8rem; }
.duel-fighter-name { font-family:'Cinzel Decorative',serif; font-size:.75rem; color:var(--gold-light); margin:.2rem 0; }
.duel-hp-track { height:8px; background:rgba(255,255,255,.1); border-radius:4px; margin:.3rem auto; max-width:160px; overflow:hidden; }
.duel-hp-fill { height:100%; border-radius:4px; transition:width .5s; background:linear-gradient(90deg,#22c55e,#86efac); }
.duel-hp-fill.low { background:linear-gradient(90deg,#ef4444,#fca5a5); }
.duel-hp-text { font-size:.72rem; color:var(--text-muted); }
.duel-vs-divider { font-family:'Cinzel Decorative',serif; font-size:1.2rem; color:var(--gold); flex-shrink:0; }
.duel-log { background:rgba(0,0,0,.3); border:1px solid var(--border); border-radius:8px; padding:.6rem; height:100px; overflow-y:auto; font-size:.75rem; margin-bottom:1rem; scrollbar-width:thin; }
.duel-log-entry { padding:.15rem 0; border-bottom:1px solid rgba(255,255,255,.05); }
.duel-log-entry:last-child { border-bottom:none; }
.duel-log-hit { color:#f87171; }
.duel-log-shield { color:#60a5fa; }
.duel-log-special { color:#a78bfa; }
.duel-log-heal { color:#4ade80; }
.duel-log-sys { color:var(--text-muted); font-style:italic; }
.duel-spells-panel { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:.4rem; }
.duel-spell-btn { padding:.45rem .6rem; border-radius:8px; border:1.5px solid var(--border); background:var(--bg-secondary); color:var(--text); font-family:'Lora',serif; font-size:.78rem; cursor:pointer; transition:all .2s; text-align:left; display:flex; flex-direction:column; gap:.1rem; }
.duel-spell-btn:hover:not(:disabled) { border-color:var(--gold); background:rgba(197,153,62,.08); }
.duel-spell-btn:disabled { opacity:.4; pointer-events:none; }
.duel-spell-btn.used { opacity:.3; }
.duel-spell-cat { font-size:.62rem; }
.duel-spell-cat.attack { color:#f87171; }
.duel-spell-cat.shield { color:#60a5fa; }
.duel-spell-cat.special { color:#a78bfa; }
.duel-spell-cat.heal { color:#4ade80; }
.duel-result { text-align:center; padding:2rem; font-family:'Cinzel Decorative',serif; font-size:1.4rem; animation:fadeIn .5s; }
.duel-opponent-select { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.6rem; margin:.8rem 0; }
.duel-opp-card { background:var(--bg-secondary); border:1.5px solid var(--border); border-radius:10px; padding:.8rem; text-align:center; cursor:pointer; transition:all .3s; }
.duel-opp-card:hover { border-color:var(--gold); transform:translateY(-2px); }
.duel-opp-emoji { font-size:2rem; margin-bottom:.3rem; }
.duel-opp-name { font-size:.8rem; color:var(--gold-light); font-weight:700; }
.duel-opp-diff { font-size:.65rem; color:var(--text-muted); margin-top:.2rem; }
.duel-multi-area { background:rgba(123,45,142,.06); border:1px solid var(--magic-purple); border-radius:10px; padding:1rem; margin-top:.8rem; text-align:center; }
.duel-room-code { font-family:'Cinzel Decorative',serif; font-size:1.8rem; color:var(--gold-light); letter-spacing:.2em; background:rgba(0,0,0,.3); padding:.4rem 1rem; border-radius:8px; display:inline-block; margin:.5rem 0; }
.duel-input { padding:.5rem .8rem; background:var(--bg-card); border:1.5px solid var(--border); border-radius:8px; color:var(--text-bright); font-family:'Lora',serif; font-size:.9rem; outline:none; max-width:180px; text-align:center; letter-spacing:.1em; text-transform:uppercase; }
.duel-input:focus { border-color:var(--gold); }
.duel-waiting::after { content:''; animation:dots 1.5s infinite; }
@keyframes dots { 0%{content:'.'} 50%{content:'..'} 100%{content:'...'} }

/* ══ POTION BREWING ══ */
.potion-lab { max-width:700px; margin:1.5rem auto 0; }
.potion-lab-title { font-family:'HarryP','Cinzel Decorative',serif; color:var(--gold); text-align:center; font-size:1.3rem; margin-bottom:.3rem; }
.cauldron-area { display:flex; flex-direction:column; align-items:center; margin:1rem 0; }
.cauldron { width:120px; height:100px; position:relative; background:radial-gradient(ellipse at 40% 30%,#2a1a0a,#0a0a0a); border-radius:10px 10px 40px 40px; border:3px solid #3a2a1a; display:flex; align-items:center; justify-content:center; font-size:2rem; overflow:hidden; box-shadow:0 4px 20px rgba(0,0,0,.5),inset 0 0 20px rgba(0,100,50,.1); }
.cauldron-bubble { position:absolute; border-radius:50%; background:rgba(0,180,80,.15); animation:bubble linear infinite; }
@keyframes bubble { 0%{bottom:-10px;opacity:.8;transform:scale(1)} 100%{bottom:110px;opacity:0;transform:scale(.5)} }
.cauldron-slots { min-height:30px; display:flex; gap:.3rem; flex-wrap:wrap; justify-content:center; margin-top:.4rem; font-size:1.2rem; }
.ingredient-shelf { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:.4rem; margin:.8rem 0; }
.ingredient-btn { padding:.4rem .5rem; border-radius:8px; border:1.5px solid var(--border); background:var(--bg-secondary); color:var(--text); font-size:.78rem; cursor:pointer; transition:all .2s; display:flex; align-items:center; gap:.3rem; }
.ingredient-btn:hover:not(:disabled) { border-color:var(--gold); background:rgba(197,153,62,.08); }
.ingredient-btn.selected { border-color:#22c55e; background:rgba(34,197,94,.1); }
.ingredient-btn:disabled { opacity:.4; pointer-events:none; }
.potion-result-area { min-height:80px; text-align:center; margin:.8rem 0; }
.recipe-book h4 { font-family:'Cinzel Decorative',serif; color:var(--gold); font-size:.9rem; margin-bottom:.5rem; text-align:center; }
.recipe-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:.4rem; }
.recipe-card { padding:.5rem; border-radius:8px; border:1px solid var(--border); background:var(--bg-secondary); text-align:center; font-size:.72rem; }
.recipe-card.discovered { border-color:var(--gold-dark); background:rgba(197,153,62,.06); }
.recipe-card.undiscovered { color:var(--text-muted); filter:brightness(.5); }
.recipe-icon { font-size:1.4rem; margin-bottom:.2rem; }
.recipe-name { color:var(--gold-light); font-weight:700; }
@media(max-width:600px){ .duel-spells-panel{grid-template-columns:repeat(2,1fr)} .duel-opponent-select{grid-template-columns:repeat(2,1fr)} .ingredient-shelf{grid-template-columns:repeat(3,1fr)} }
