:root {
  --game-purple: #6d4aff;
  --game-purple-dark: #4b2fd0;
  --game-cyan: #26c6da;
  --game-yellow: #ffd54a;
  --game-pink: #ff6fae;
  --game-lime: #8bdc65;
  --game-navy: #182348;
  --game-card-shadow: 0 12px 0 rgba(54, 39, 127, .08), 0 18px 36px rgba(48, 42, 98, .10);
}

body {
  font-family: "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(109, 74, 255, .10), transparent 24%),
    radial-gradient(circle at 90% 20%, rgba(38, 198, 218, .10), transparent 22%),
    #f5f4ff;
}

body[data-game-theme="jungle"] { background: radial-gradient(circle at 10% 10%, rgba(139, 220, 101, .22), transparent 26%), #f3faec; }
body[data-game-theme="space"] { background: radial-gradient(circle at 20% 10%, rgba(109, 74, 255, .25), transparent 24%), radial-gradient(circle at 85% 18%, rgba(38, 198, 218, .16), transparent 22%), #eef0ff; }
body[data-game-theme="candy"] { background: radial-gradient(circle at 12% 10%, rgba(255, 111, 174, .20), transparent 24%), radial-gradient(circle at 88% 18%, rgba(255, 213, 74, .20), transparent 20%), #fff3fa; }

.card { border: 0; box-shadow: var(--game-card-shadow); }
.button { border-radius: 14px; box-shadow: 0 4px 0 rgba(37, 29, 98, .13); }
.button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(37, 29, 98, .13); }
.button.primary { background: linear-gradient(135deg, var(--game-purple), #825cff); }
.button.primary:hover { background: linear-gradient(135deg, var(--game-purple-dark), var(--game-purple)); }
.button.soft { color: var(--game-purple-dark); background: #eeeaff; }
.button.treasure { color: #684800; background: linear-gradient(135deg, #ffe37e, #ffca37); }
.button:disabled { cursor: default; opacity: .58; transform: none; box-shadow: none; }
.big-cta { padding: 14px 20px; font-size: 15px; }

.game-auth-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 23%, rgba(255, 213, 74, .32), transparent 20%),
    linear-gradient(150deg, #3c2a9e 0%, #6d4aff 55%, #1c9fc5 100%);
}
.game-auth-hero::before,
.game-auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.game-auth-hero::before { width: 420px; height: 420px; right: -180px; bottom: -160px; }
.game-auth-hero::after { width: 190px; height: 190px; left: -70px; top: 8%; }
.game-auth-hero > * { position: relative; z-index: 2; }
.game-auth-hero h1 { text-shadow: 0 5px 0 rgba(42, 25, 113, .25); }
.game-auth-hero .brand-mark { animation: mascotFloat 3s ease-in-out infinite; }
.floating-island {
  position: absolute;
  z-index: 1;
  width: 88px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 48% 48% 45% 45%;
  font-size: 32px;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
  animation: islandFloat 4s ease-in-out infinite;
}
.island-one { right: 11%; top: 16%; }
.island-two { right: 26%; bottom: 14%; animation-delay: -.8s; }
.island-three { right: 4%; bottom: 32%; animation-delay: -1.7s; }
.auth-panel { background: linear-gradient(145deg, #f1efff, #eaf9ff); }
.auth-card { border: 2px solid #fff; box-shadow: 0 16px 0 rgba(74, 47, 178, .08), 0 30px 70px rgba(51, 42, 105, .16); }
.login-mascots { display: flex; gap: 8px; margin-bottom: 12px; font-size: 34px; }
.login-mascots span:nth-child(2) { transform: translateY(-7px); }
.auth-card h2 { color: var(--game-navy); }
.brand-mark { color: #fff; background: linear-gradient(145deg, #ffd95b, #ffb52e); }

.sidebar {
  background:
    radial-gradient(circle at 40% 0%, rgba(130,92,255,.32), transparent 30%),
    linear-gradient(180deg, #24185f, #16224c 70%);
}
.sidebar-brand .brand-mark { font-size: 23px; }
.main-nav { gap: 4px; }
.main-nav button { padding: 9px 11px; border-radius: 13px; color: #d9dcff; }
.main-nav button span { background: rgba(255,255,255,.10); font-size: 15px; }
.main-nav button:hover, .main-nav button.active { background: rgba(255,255,255,.14); }
.main-nav button.active { box-shadow: inset 3px 0 0 var(--game-yellow); }
.main-nav button.active span { color: inherit; background: var(--game-yellow); }
.game-avatar { font-size: 23px; background: #fff5c4; }

.topbar { background: rgba(247,246,255,.90); border-bottom: 1px solid rgba(109,74,255,.10); }
body[data-game-theme="jungle"] .topbar { background: rgba(246,252,240,.92); }
body[data-game-theme="space"] .topbar { background: rgba(238,240,255,.92); }
body[data-game-theme="candy"] .topbar { background: rgba(255,245,251,.92); }
.topbar h2 { color: var(--game-navy); }
.game-hud { display: flex; gap: 8px; align-items: center; }
.hud-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 0;
  border-radius: 14px;
  color: #35246d;
  background: #fff;
  box-shadow: 0 4px 0 rgba(75, 47, 208, .10);
}
.hud-chip span { font-size: 18px; }
.hud-chip strong { font-size: 12px; }
.avatar-hud { cursor: pointer; }

.game-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, .5fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: clamp(26px, 4vw, 44px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(255,213,74,.38), transparent 20%),
    radial-gradient(circle at 20% 100%, rgba(38,198,218,.28), transparent 35%),
    linear-gradient(135deg, #4930cb, #7654ff 58%, #1bb2ce);
}
.game-hero::before { content: ""; position: absolute; right: -80px; bottom: -170px; width: 430px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.10); }
.game-hero::after { content: "✦  ✧  ✦"; position: absolute; right: 6%; top: 8%; color: rgba(255,255,255,.48); letter-spacing: 14px; font-size: 24px; }
.hero-copy, .mascot-stage { position: relative; z-index: 2; }
.quest-kicker { display: inline-block; margin-bottom: 8px; font-size: 11px; font-weight: 900; letter-spacing: .14em; color: #fff1a3; }
.game-hero h2, .quest-banner h2, .treasure-hero h2, .hero-scoreboard h2 { margin: 0 0 10px; font-size: clamp(29px, 4vw, 46px); line-height: 1.03; }
.game-hero p { max-width: 680px; margin: 0; color: #eceaff; font-size: 16px; line-height: 1.55; }
.level-strip { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; gap: 10px; align-items: center; max-width: 620px; margin-top: 20px; }
.level-strip span, .level-strip strong { font-size: 12px; }
.level-track { height: 13px; overflow: hidden; border: 2px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(20,13,71,.28); }
.level-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffe45e, #ffad35); }
.level-strip.dark .level-track { border-color: rgba(52,33,111,.16); background: rgba(69,45,151,.10); }
.mascot-stage { display: grid; justify-items: center; align-self: end; }
.mascot { font-size: clamp(94px, 12vw, 154px); filter: drop-shadow(0 16px 8px rgba(36,21,95,.20)); animation: mascotFloat 3s ease-in-out infinite; }
.mascot-stage > span { padding: 7px 12px; border-radius: 999px; background: rgba(35,22,94,.28); font-size: 12px; font-weight: 900; }
.mascot-bubble { position: relative; max-width: 190px; margin-bottom: 4px; padding: 11px 13px; border-radius: 16px 16px 5px 16px; color: #3f2d72; background: #fff; font-size: 12px; font-weight: 800; text-align: center; box-shadow: 0 8px 20px rgba(38,22,100,.18); }

.game-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.game-stat { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; min-height: 105px; padding: 17px; }
.game-stat-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 17px; font-size: 26px; background: #f0edff; }
.game-stat small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.game-stat strong { display: block; margin: 2px 0; color: var(--game-navy); font-size: 25px; }
.game-stat p { margin: 0; color: var(--muted); font-size: 11px; }
.game-heading h3 { color: var(--game-navy); font-size: 22px; }

.daily-chest { display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: center; padding: 18px 22px; background: linear-gradient(135deg, #fff8d7, #fff); }
.daily-chest.opened { background: linear-gradient(135deg, #e9fff0, #fff); }
.chest-visual { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 24px; font-size: 42px; background: #ffe58d; animation: chestBounce 2.8s ease-in-out infinite; }
.daily-chest.opened .chest-visual { background: #c9f4d8; }
.daily-chest h3 { margin: 0 0 5px; color: var(--game-navy); }
.daily-chest p { margin: 0; color: var(--muted); font-size: 13px; }

.mission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mission-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; min-height: 165px; padding: 17px; border: 2px dashed #d9d3ff; border-radius: 20px; background: rgba(255,255,255,.78); }
.mission-card.complete { border-style: solid; border-color: #8bdc65; background: #f3ffef; }
.mission-card.claimed { opacity: .72; }
.mission-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; font-size: 26px; background: #eeeaff; }
.mission-card h4 { margin: 0 0 3px; color: var(--game-navy); }
.mission-card p { margin: 0; color: var(--muted); font-size: 12px; }
.mission-reward { grid-column: 1 / -1; color: #6d4a00; font-size: 12px; font-weight: 900; }
.mission-card .button { grid-column: 1 / -1; }

.map-card { overflow: hidden; padding: 24px; background: linear-gradient(180deg, #eefbff, #f7f4ff); }
.adventure-map { position: relative; display: flex; align-items: stretch; justify-content: space-between; gap: 12px; min-height: 210px; }
.map-stop { position: relative; z-index: 1; flex: 1; display: grid; justify-items: center; align-content: start; text-align: center; }
.map-path { position: absolute; top: 38px; left: 50%; width: calc(100% + 24px); height: 8px; background: repeating-linear-gradient(90deg, #c9c2f5 0 18px, transparent 18px 27px); }
.map-stop:last-of-type .map-path { display: none; }
.map-node { position: relative; z-index: 2; width: 82px; height: 82px; display: grid; place-items: center; border: 6px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 8px 0 rgba(58,45,131,.14), 0 13px 25px rgba(51,44,110,.15); }
.map-node span { font-size: 18px; font-weight: 900; }
.map-node.polish { background: linear-gradient(145deg, #ff759d, #e74878); }
.map-node.english { background: linear-gradient(145deg, #29cbe3, #168ebc); }
.map-node.math { background: linear-gradient(145deg, #a273ff, #7048dc); }
.map-stop.done .map-node { background: linear-gradient(145deg, #9be379, #55b84a); }
.map-node:hover { transform: translateY(-4px) rotate(-2deg); }
.map-label { max-width: 180px; margin-top: 13px; }
.map-label small, .map-label strong, .map-label span { display: block; }
.map-label small { color: var(--game-purple); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.map-label strong { margin: 4px 0; color: var(--game-navy); font-size: 13px; }
.map-label span { color: var(--muted); font-size: 11px; }
.map-castle { align-self: start; min-width: 85px; display: grid; justify-items: center; padding-top: 3px; font-size: 58px; }
.map-castle span { margin-top: 7px; color: var(--game-navy); font-size: 11px; font-weight: 900; }

.subject-worlds { align-items: stretch; }
.world-card { position: relative; overflow: hidden; }
.world-art { position: relative; min-height: 145px; display: grid; place-items: center; overflow: hidden; }
.world-card.polish .world-art { background: linear-gradient(145deg, #ffe0eb, #ffd1a7); }
.world-card.english .world-art { background: linear-gradient(145deg, #d8f8ff, #c5e8ff); }
.world-card.math .world-art { background: linear-gradient(145deg, #eae0ff, #d8d2ff); }
.world-art span { position: relative; z-index: 2; font-size: 72px; filter: drop-shadow(0 10px 5px rgba(44,35,96,.13)); }
.world-art i { position: absolute; left: -10%; right: -10%; bottom: -42%; height: 100px; border-radius: 50%; background: rgba(255,255,255,.55); }
.world-art b { position: absolute; right: 18px; top: 14px; font-size: 24px; }
.world-card .subject-head { align-items: flex-start; }
.world-card .subject-meta small { color: var(--game-purple); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.world-progress > span { background: linear-gradient(90deg, var(--game-purple), var(--game-cyan)); }

.quest-banner { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 28px; color: #fff; background: linear-gradient(135deg, #1c9fc5, #6d4aff); }
.quest-banner p { margin: 0; color: #e9faff; }
.quest-ring { width: 112px; height: 112px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#ffe45e var(--score), rgba(255,255,255,.18) 0); position: relative; }
.quest-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #5b4bd7; }
.quest-ring span { position: relative; z-index: 1; font-size: 23px; font-weight: 900; }

.game-subject-hero { position: relative; overflow: hidden; grid-template-columns: auto 1fr auto; }
.game-subject-hero.polish { background: linear-gradient(135deg, #fff2f5, #ffe7da); }
.game-subject-hero.english { background: linear-gradient(135deg, #e9fbff, #e5f2ff); }
.game-subject-hero.math { background: linear-gradient(135deg, #f3edff, #eceaff); }
.world-hero-icon { font-size: 76px; }
.game-subject-hero small { display: block; margin: 10px 0 2px; color: var(--game-purple); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.subject-stars { margin-top: 14px; color: #7b5500; font-weight: 900; }
.world-path { position: relative; }
.world-path::before { content: ""; position: absolute; left: 26px; top: 42px; bottom: 20px; width: 6px; border-radius: 999px; background: repeating-linear-gradient(#cfc7f6 0 18px, transparent 18px 27px); }
.world-level { position: relative; z-index: 1; padding-left: 0; }
.unit-title > div { display: flex; align-items: center; gap: 10px; }
.unit-number { width: 52px; height: 52px; display: grid; place-items: center; border: 6px solid #f5f4ff; border-radius: 50%; color: #fff !important; background: linear-gradient(145deg, #7a58ff, #5132cc); font-size: 17px !important; font-weight: 900; }
.adventure-lessons { gap: 12px; }
.adventure-lesson { border: 0; background: #f9f8ff; }
.adventure-lesson.completed { background: #effbea; }
.lesson-node { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #8a6cff, #5b3bd1); font-weight: 900; box-shadow: 0 4px 0 rgba(68,43,164,.18); }
.adventure-lesson.completed .lesson-node { background: linear-gradient(145deg, #8bdc65, #4aad44); }
.mini-stars { display: flex; gap: 2px; margin-top: 5px; }
.mini-stars span { color: #d8d5e7; }
.mini-stars .earned { color: #ffc928; text-shadow: 0 1px 0 #a97700; }
.soft-locked { opacity: .82; }

.treasure-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 32px; color: #3d2a74; background: linear-gradient(135deg, #fff4b8, #fff 48%, #e8e1ff); }
.treasure-hero p { max-width: 720px; color: #675a82; }
.treasure-pile { width: 150px; height: 150px; display: grid; place-items: center; position: relative; border-radius: 50%; background: rgba(255,255,255,.55); font-size: 82px; }
.treasure-pile span { position: absolute; right: 1px; bottom: 5px; min-width: 50px; padding: 7px 11px; border-radius: 999px; color: #6d4800; background: #ffd84e; font-size: 17px; font-weight: 900; }
.badge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.badge-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.badge-card { padding: 18px; border-radius: 20px; text-align: center; background: #fff; box-shadow: var(--game-card-shadow); }
.badge-card.locked { filter: grayscale(1); opacity: .55; }
.badge-card.unlocked { background: linear-gradient(160deg, #fffdf3, #fff); }
.badge-medal { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 10px; border: 5px solid #fff2a5; border-radius: 50%; font-size: 40px; background: linear-gradient(145deg, #fff3ac, #ffc63d); box-shadow: 0 7px 0 rgba(174,116,0,.14); }
.badge-card h4 { margin: 0 0 6px; color: var(--game-navy); }
.badge-card p { min-height: 34px; margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.badge-card > span { color: var(--game-purple); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.shop-card { padding: 18px; border: 2px solid transparent; border-radius: 20px; background: #fff; box-shadow: var(--game-card-shadow); }
.shop-card.selected { border-color: var(--game-purple); background: #f3f0ff; }
.shop-icon { font-size: 48px; }
.shop-card h4 { margin: 8px 0 5px; color: var(--game-navy); }
.shop-card p { min-height: 34px; margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.shop-bottom { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.shop-bottom > span { color: #6d4a00; font-size: 11px; font-weight: 900; }
.coupon-list { display: grid; gap: 12px; }
.reward-coupon { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; overflow: hidden; padding: 17px; border: 2px dashed #8c73e7; border-radius: 18px; background: linear-gradient(90deg, #f5f1ff, #fff); }
.reward-coupon > span { font-size: 37px; }
.reward-coupon strong, .reward-coupon small { display: block; }
.reward-coupon small { margin-top: 3px; color: var(--muted); }
.reward-coupon b { color: var(--game-purple); font-size: 11px; letter-spacing: .12em; }

.hero-scoreboard { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 30px; color: #fff; background: linear-gradient(135deg, #1b315f, #6046d5); }
.hero-scoreboard p { max-width: 720px; margin: 0; color: #e1e5ff; }
.scoreboard-avatar { font-size: 100px; }
.game-chart .chart-bar { background: linear-gradient(#8e72ff, #6546dc); }
.game-chart .chart-bar.polish { background: linear-gradient(#ff85a8, #df4772); }
.game-chart .chart-bar.english { background: linear-gradient(#49d6e9, #188db7); }
.game-chart .chart-bar.math { background: linear-gradient(#aa7dff, #7048dc); }

.game-notice { border-left-color: var(--game-purple); background: #f1edff; color: #4b387d; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 14px; background: #f6f4ff; }
.switch-row input { width: 44px; height: 22px; accent-color: var(--game-purple); }

.modal-card { border: 3px solid rgba(255,255,255,.72); border-radius: 28px; background: #fff; box-shadow: 0 25px 0 rgba(43,30,105,.10), 0 35px 80px rgba(18,19,57,.32); }
.quiz-game-shell { position: relative; }
.quiz-top-hud { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding-right: 42px; }
.quiz-mascot { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; font-size: 38px; background: #fff0b7; }
.quiz-head { padding-right: 0; }
.quiz-head p { margin: 0; }
.combo-chip { padding: 8px 11px; border-radius: 999px; color: #704800; background: #ffe68a; font-weight: 900; }
.quiz-progress small { display: block; margin-top: 5px; color: var(--muted); text-align: right; font-size: 10px; }
.quiz-progress .progress-track { height: 13px; }
.quiz-progress .progress-track span { background: linear-gradient(90deg, var(--game-purple), var(--game-cyan)); }
.game-question { border: 0; border-radius: 22px; background: linear-gradient(145deg, #f7f5ff, #f0fbff); }
.challenge-label { display: inline-block; margin-bottom: 9px; padding: 5px 8px; border-radius: 8px; color: #fff; background: var(--game-purple); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.game-question h3 { color: var(--game-navy); font-size: 21px; }
.game-answers { grid-template-columns: 1fr 1fr; }
.game-answers .answer-option { min-height: 70px; align-items: center; border: 2px solid #ddd8f4; border-radius: 16px; }
.game-answers .answer-option:hover { border-color: var(--game-purple); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(74,47,178,.09); }
.game-answers .answer-option b { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--game-purple); background: #eeeaff; }
.game-input { min-height: 56px; border: 2px solid #d7d0f0; font-size: 16px; }
.feedback.retry { background: #fff6da; color: #8a5b00; }
.result-game { position: relative; overflow: hidden; text-align: center; }
.result-rays { position: absolute; width: 420px; height: 420px; left: 50%; top: 70px; transform: translateX(-50%); border-radius: 50%; opacity: .18; background: repeating-conic-gradient(#ffd849 0 12deg, transparent 12deg 24deg); animation: spin 12s linear infinite; }
.result-game > *:not(.result-rays) { position: relative; z-index: 1; }
.result-mascot { margin: 5px 0 -14px; font-size: 80px; animation: mascotFloat 2s ease-in-out infinite; }
.result-stars { display: flex; justify-content: center; gap: 3px; font-size: 38px; }
.result-stars span { color: #d8d5e7; transform: scale(.9); }
.result-stars .earned { color: #ffc928; text-shadow: 0 3px 0 #a97100; animation: starPop .45s ease both; }
.result-stars .earned:nth-child(2) { animation-delay: .12s; }
.result-stars .earned:nth-child(3) { animation-delay: .24s; }
.result-circle { background: linear-gradient(145deg, #7958ff, #4c30c7); box-shadow: 0 10px 0 rgba(64,41,158,.18); }
.reward-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0; }
.reward-row > div { padding: 12px; border-radius: 15px; background: #f4f1ff; }
.reward-row span, .reward-row strong { display: block; }
.reward-row span { font-size: 24px; }
.reward-row strong { margin-top: 3px; color: var(--game-navy); font-size: 12px; }
.level-up { margin: 12px 0; padding: 14px; border-radius: 15px; color: #634000; background: linear-gradient(135deg, #fff0a8, #ffd34c); font-weight: 900; }
.new-badges { margin: 12px 0; padding: 14px; border-radius: 15px; color: #4c327e; background: #f0ebff; }
.new-badges h3 { margin: 0 0 7px; }
.new-badges span { display: block; font-weight: 900; }
.result-message { color: var(--muted); line-height: 1.5; }

.celebration { position: fixed; inset: 0; z-index: 1000; pointer-events: none; overflow: hidden; }
.celebration i { position: absolute; left: calc((var(--i) * 4.17%) + 1%); top: -20px; width: 10px; height: 18px; border-radius: 3px; background: #ffd54a; animation: confettiFall 1.25s cubic-bezier(.15,.65,.3,1) forwards; animation-delay: calc((var(--i) % 7) * .035s); }
.celebration i:nth-child(3n) { background: #6d4aff; transform: rotate(20deg); }
.celebration i:nth-child(3n + 1) { background: #26c6da; border-radius: 50%; }
.celebration i:nth-child(4n) { background: #ff6fae; }

@keyframes mascotFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes islandFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes chestBounce { 0%,90%,100% { transform: translateY(0) rotate(0); } 94% { transform: translateY(-7px) rotate(-3deg); } 97% { transform: translateY(-2px) rotate(3deg); } }
@keyframes spin { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes starPop { 0% { transform: scale(.2) rotate(-30deg); } 70% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes confettiFall { 0% { transform: translateY(-30px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(680deg); opacity: .4; } }

.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

@media (max-width: 1180px) {
  .game-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge-grid, .badge-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-hud .avatar-hud strong { display: none; }
}

@media (max-width: 920px) {
  .game-hero { grid-template-columns: 1fr; }
  .mascot-stage { display: none; }
  .mission-grid, .shop-grid { grid-template-columns: 1fr 1fr; }
  .badge-grid, .badge-grid.compact { grid-template-columns: 1fr 1fr; }
  .adventure-map { overflow-x: auto; justify-content: flex-start; padding-bottom: 12px; }
  .map-stop { min-width: 165px; }
  .map-castle { min-width: 100px; }
  .game-hud { display: none; }
  .game-subject-hero { grid-template-columns: auto 1fr; }
  .game-subject-hero .big-score { grid-column: 1 / -1; justify-self: center; }
}

@media (max-width: 620px) {
  .floating-island { display: none; }
  .auth-hero h1 { font-size: 48px; }
  .game-hero, .quest-banner, .treasure-hero, .hero-scoreboard { grid-template-columns: 1fr; padding: 22px; }
  .game-stats, .mission-grid, .shop-grid, .badge-grid, .badge-grid.compact, .toggle-grid { grid-template-columns: 1fr; }
  .game-stat { min-height: 88px; }
  .daily-chest { grid-template-columns: auto 1fr; padding: 14px; }
  .chest-visual { width: 58px; height: 58px; font-size: 32px; }
  .quest-ring, .treasure-pile, .scoreboard-avatar { justify-self: center; }
  .world-art { min-height: 120px; }
  .game-subject-hero { grid-template-columns: 1fr; text-align: center; }
  .world-hero-icon { font-size: 62px; }
  .game-answers { grid-template-columns: 1fr; }
  .quiz-top-hud { grid-template-columns: auto 1fr; }
  .combo-chip { grid-column: 1 / -1; justify-self: start; }
  .reward-row { grid-template-columns: 1fr; }
  .reward-coupon { grid-template-columns: auto 1fr; }
  .reward-coupon b { grid-column: 2; }
  .topbar-actions .button { display: none; }
}

/* Rozszerzona przygoda: sezony, bossowie, towarzysz, pokój i misje poza ekranem */
body[data-game-theme="underwater"] {
  --game-purple: #087ca7;
  --game-purple-dark: #075d7d;
  --game-cyan: #25d8cf;
  background:
    radial-gradient(circle at 12% 12%, rgba(37,216,207,.24), transparent 25%),
    radial-gradient(circle at 88% 20%, rgba(8,124,167,.20), transparent 24%),
    #e9fbff;
}
body[data-game-theme="medieval"] {
  --game-purple: #80521d;
  --game-purple-dark: #5f3c15;
  --game-cyan: #dba84a;
  background:
    radial-gradient(circle at 10% 10%, rgba(219,168,74,.25), transparent 25%),
    radial-gradient(circle at 85% 18%, rgba(128,82,29,.12), transparent 24%),
    #fff8e7;
}
body[data-game-theme="underwater"] .topbar { background: rgba(235,252,255,.93); }
body[data-game-theme="medieval"] .topbar { background: rgba(255,248,231,.94); }
body[data-game-theme="underwater"] .sidebar { background: radial-gradient(circle at 40% 0%, rgba(37,216,207,.28), transparent 30%), linear-gradient(180deg, #064f70, #07344e 70%); }
body[data-game-theme="medieval"] .sidebar { background: radial-gradient(circle at 40% 0%, rgba(219,168,74,.30), transparent 30%), linear-gradient(180deg, #583612, #2f251c 70%); }

.companion-stack { position: relative; min-width: 170px; min-height: 145px; }
.companion-stack .hero-avatar { position: absolute; left: 5px; bottom: 0; font-size: 105px; }
.companion-stack .hero-pet { position: absolute; right: 0; bottom: 4px; font-size: 72px; filter: drop-shadow(0 10px 7px rgba(36,21,95,.20)); animation: mascotFloat 2.4s ease-in-out infinite; }

.dashboard-adventure-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.adventure-link { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px; border: 0; text-align: left; cursor: pointer; background: #fff; }
.adventure-link > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; font-size: 38px; background: #f0edff; }
.adventure-link small { display: block; margin-bottom: 3px; color: var(--game-purple); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.adventure-link strong { display: block; color: var(--game-navy); font-size: 17px; }
.adventure-link p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.adventure-link b { color: var(--game-purple); font-size: 12px; }
.adventure-link:hover { transform: translateY(-3px); }
.adventure-link.pet-link { background: linear-gradient(135deg, #fff8d7, #fff); }
.adventure-link.season-jungle { background: linear-gradient(135deg, #efffe9, #fff); }
.adventure-link.season-underwater { background: linear-gradient(135deg, #e5fbff, #fff); }
.adventure-link.season-medieval { background: linear-gradient(135deg, #fff3d8, #fff); }
.adventure-link.season-space { background: linear-gradient(135deg, #eeebff, #fff); }

.boss-row { margin-top: 12px; border: 2px dashed #e1b35b; border-radius: 18px; background: linear-gradient(135deg, #fff8df, #fff); }
.boss-row.ready { border-style: solid; box-shadow: inset 0 0 0 2px rgba(255,208,85,.22); }
.boss-row.defeated { border-style: solid; border-color: #84d66f; background: linear-gradient(135deg, #eeffe8, #fff); }
.boss-row.locked { opacity: .72; filter: saturate(.65); }
.boss-node { width: 55px; height: 55px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 18px; font-size: 30px; background: #ffedbd; box-shadow: 0 5px 0 rgba(138,83,22,.12); }
.boss-row.defeated .boss-node { background: #d9f7cf; }
.boss-quiz .game-question { background: linear-gradient(145deg, #fff6dc, #fff); }
.boss-quiz .challenge-label { background: linear-gradient(135deg, #ad621e, #db9a35); }
.boss-result .result-circle { background: linear-gradient(145deg, #c77824, #7d3d12); }

.movement-card, .family-coop-card, .weekend-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 18px; align-items: center; margin-bottom: 14px; padding: 20px; }
.movement-card { background: linear-gradient(135deg, #ecfff0, #fff); }
.family-coop-card { background: linear-gradient(135deg, #fff1f8, #fff); }
.weekend-card { background: linear-gradient(135deg, #fff8d6, #f4f0ff); }
.movement-card.complete, .family-coop-card.complete, .weekend-card.complete { box-shadow: 0 12px 0 rgba(72,163,75,.09), 0 18px 36px rgba(48,42,98,.08); }
.movement-icon, .coop-people, .weekend-trophy { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 24px; font-size: 40px; background: rgba(255,255,255,.78); }
.movement-card h3, .family-coop-card h3, .weekend-card h3 { margin: 0 0 6px; color: var(--game-navy); }
.movement-card p, .family-coop-card p, .weekend-card p { margin: 0 0 6px; color: var(--muted); line-height: 1.45; }
.movement-card small, .family-coop-card small { color: #6a6f82; }

.season-hero { min-height: 260px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 25px; overflow: hidden; padding: clamp(28px,4vw,46px); color: #fff; }
.season-hero h2 { margin: 0 0 10px; font-size: clamp(31px,5vw,52px); }
.season-hero p { max-width: 680px; margin: 0; color: rgba(255,255,255,.88); font-size: 16px; line-height: 1.55; }
.season-hero.season-jungle { background: radial-gradient(circle at 85% 18%, rgba(255,232,101,.28), transparent 20%), linear-gradient(135deg, #23733a, #57a447); }
.season-hero.season-underwater { background: radial-gradient(circle at 85% 18%, rgba(167,246,255,.28), transparent 20%), linear-gradient(135deg, #065d87, #13a9b5); }
.season-hero.season-medieval { background: radial-gradient(circle at 85% 18%, rgba(255,220,124,.30), transparent 20%), linear-gradient(135deg, #684019, #b47a2e); }
.season-hero.season-space { background: radial-gradient(circle at 85% 18%, rgba(95,218,255,.30), transparent 20%), linear-gradient(135deg, #24215f, #664ad8 60%, #147fa0); }
.season-progress { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.season-progress strong, .season-progress span { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 12px; }
.season-orbit { width: 170px; height: 170px; display: grid; place-items: center; border: 2px dashed rgba(255,255,255,.46); border-radius: 50%; font-size: 84px; animation: mascotFloat 3s ease-in-out infinite; }
.season-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.season-card { position: relative; overflow: hidden; padding: 20px; }
.season-card.selected { border: 3px solid var(--game-yellow); }
.season-card.locked { opacity: .62; filter: grayscale(.35); }
.season-card.jungle { background: linear-gradient(145deg,#edffe8,#fff); }
.season-card.underwater { background: linear-gradient(145deg,#e8fbff,#fff); }
.season-card.medieval { background: linear-gradient(145deg,#fff2d2,#fff); }
.season-card.space { background: linear-gradient(145deg,#eeeaff,#fff); }
.season-icon { font-size: 52px; }
.season-card h3 { margin: 8px 0 7px; color: var(--game-navy); }
.season-card p { min-height: 82px; margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.season-card > span { display: block; margin-bottom: 12px; color: var(--game-purple); font-size: 10px; font-weight: 900; text-transform: uppercase; }

.mystery-map { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(220px,.4fr); gap: 22px; align-items: center; padding: 24px; background: linear-gradient(145deg,#fff6d8,#f3efff); }
.map-fragment-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 14px; border: 8px solid #9b6b34; border-radius: 12px; background: #dec08c; box-shadow: inset 0 0 0 3px #f0d8a9; transform: rotate(-.5deg); }
.map-fragment { min-height: 88px; display: grid; place-items: center; align-content: center; border: 1px dashed rgba(86,55,26,.32); color: #7c674c; background: repeating-linear-gradient(calc(45deg + var(--fragment) * 3deg), rgba(116,81,38,.08) 0 8px, rgba(255,255,255,.08) 8px 16px), #e7d4aa; }
.map-fragment.revealed { color: #563916; background: radial-gradient(circle at 50% 50%, rgba(255,244,184,.74), transparent 50%), #d7b577; box-shadow: inset 0 0 18px rgba(99,61,21,.18); }
.map-fragment span { font-size: 31px; }
.map-fragment small { margin-top: 4px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.map-legend strong { display: block; color: var(--game-navy); font-size: 22px; }
.map-legend p { color: var(--muted); line-height: 1.5; }

.story-book { padding: 26px; background: linear-gradient(90deg,#fffdf5,#fff8df); }
.story-entry { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px dashed #d9c9a5; }
.story-entry:last-child { border-bottom: 0; }
.story-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,var(--game-purple),var(--game-purple-dark)); font-weight: 900; }
.story-entry small { color: #967647; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.story-entry h4 { margin: 4px 0 7px; color: #4e3a24; font-family: Georgia,serif; font-size: 19px; }
.story-entry p { margin: 0; color: #62513b; font-family: Georgia,serif; line-height: 1.65; }
.story-unlock { margin: 14px 0; padding: 18px; border-radius: 18px; text-align: left; color: #5d492d; background: linear-gradient(135deg,#fff8d9,#fffdf5); box-shadow: inset 0 0 0 2px #ead5a3; }
.story-unlock > span { color: #9a6b20; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.story-unlock h3 { margin: 5px 0; font-family: Georgia,serif; }
.story-unlock p { margin: 0; font-family: Georgia,serif; line-height: 1.55; }

.companion-hero { display: grid; grid-template-columns: minmax(220px,.45fr) minmax(0,1fr); gap: 30px; align-items: center; min-height: 330px; padding: clamp(26px,4vw,44px); overflow: hidden; background: radial-gradient(circle at 18% 25%,rgba(255,230,119,.42),transparent 24%),linear-gradient(135deg,#5238cc,#7759fb 58%,#22aec8); color: #fff; }
.companion-hero h2 { margin: 0 0 10px; font-size: clamp(34px,5vw,50px); }
.companion-hero p { max-width: 720px; color: #eeeaff; line-height: 1.55; }
.pet-stage { position: relative; min-height: 230px; display: grid; place-items: center; align-content: center; }
.pet-glow { position: absolute; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle,rgba(255,239,144,.78),rgba(255,255,255,.08) 60%,transparent 70%); animation: petPulse 2.4s ease-in-out infinite; }
.pet-emoji { position: relative; z-index: 2; font-size: 125px; filter: drop-shadow(0 18px 10px rgba(39,22,102,.22)); animation: mascotFloat 2.8s ease-in-out infinite; }
.pet-stage > span { position: relative; z-index: 3; padding: 7px 12px; border-radius: 999px; background: rgba(30,19,87,.34); font-size: 12px; font-weight: 900; }
.pet-bond { max-width: 620px; margin-top: 18px; }
.pet-bond > div:first-child { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; }
.pet-bond small { display: block; margin-top: 5px; color: #ddd8ff; }

.hero-room { position: relative; min-height: 460px; overflow: hidden; border: 10px solid #fff; border-radius: 28px; background: linear-gradient(#bde8ff 0 60%,#d8b27b 60%); box-shadow: var(--game-card-shadow); }
.hero-room::before { content:""; position:absolute; inset:0 0 40% 0; background: repeating-linear-gradient(90deg,rgba(255,255,255,.26) 0 2px,transparent 2px 80px); }
.hero-room.season-jungle { background: linear-gradient(#caefbf 0 60%,#b98a59 60%); }
.hero-room.season-underwater { background: linear-gradient(#a8eafa 0 60%,#d6c495 60%); }
.hero-room.season-medieval { background: linear-gradient(#e6d1a7 0 60%,#91663e 60%); }
.hero-room.season-space { background: linear-gradient(#8b83da 0 60%,#b9b6cb 60%); }
.room-window { position: absolute; top: 38px; right: 45px; width: 95px; height: 95px; display:grid;place-items:center;border:8px solid #fff;border-radius:50%;font-size:48px;background:#bcefff;box-shadow:0 6px 0 rgba(48,42,98,.12); }
.room-wall-items { position:absolute;top:45px;left:45px;display:flex;gap:25px;font-size:55px; }
.room-left,.room-right { position:absolute;bottom:55px;display:flex;align-items:flex-end;gap:10px;font-size:75px; }
.room-left { left:30px; }
.room-right { right:30px; }
.room-center { position:absolute;left:50%;bottom:52px;transform:translateX(-50%);display:grid;justify-items:center;z-index:3; }
.room-pet { font-size:120px;filter:drop-shadow(0 15px 8px rgba(41,29,80,.22));animation:mascotFloat 3s ease-in-out infinite; }
.room-center strong { padding:7px 13px;border-radius:999px;background:rgba(255,255,255,.82);color:var(--game-navy); }
.room-floor { position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:flex;align-items:flex-end;gap:25px;font-size:72px; }
.decoration-shop .shop-card { min-height: 275px; }

@keyframes petPulse { 0%,100% { transform:scale(.92);opacity:.72; } 50% { transform:scale(1.05);opacity:1; } }

@media (max-width: 1180px) {
  .season-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 920px) {
  .dashboard-adventure-links { grid-template-columns: 1fr; }
  .movement-card,.family-coop-card,.weekend-card { grid-template-columns:auto 1fr; }
  .movement-card .button,.family-coop-card .button,.weekend-card .button,.movement-card .pill,.family-coop-card .pill,.weekend-card .pill { grid-column:1/-1; }
  .mystery-map { grid-template-columns:1fr; }
  .companion-hero { grid-template-columns:1fr; text-align:center; }
  .companion-hero p,.pet-bond { margin-left:auto;margin-right:auto; }
}

@media (max-width: 620px) {
  .season-hero { grid-template-columns:1fr; text-align:center; }
  .season-orbit { width:120px;height:120px;justify-self:center;font-size:62px; }
  .season-progress { justify-content:center; }
  .season-grid { grid-template-columns:1fr; }
  .season-card p { min-height:0; }
  .map-fragment-grid { grid-template-columns:repeat(3,1fr); padding:8px;border-width:5px; }
  .map-fragment { min-height:72px; }
  .story-entry { grid-template-columns:1fr; }
  .story-number { width:34px;height:34px; }
  .companion-hero { padding:22px; }
  .pet-emoji { font-size:96px; }
  .hero-room { min-height:390px; }
  .room-window { width:68px;height:68px;right:20px;top:25px;font-size:35px;border-width:5px; }
  .room-wall-items { left:20px;top:28px;font-size:40px; }
  .room-left,.room-right { bottom:50px;font-size:52px; }
  .room-left { left:10px; }
  .room-right { right:10px; }
  .room-pet { font-size:88px; }
  .room-floor { font-size:52px;gap:10px; }
  .movement-card,.family-coop-card,.weekend-card { grid-template-columns:1fr;text-align:center; }
  .movement-icon,.coop-people,.weekend-trophy { justify-self:center; }
  .boss-row { align-items:flex-start; }
  .companion-stack .hero-avatar { font-size:80px; }
  .companion-stack .hero-pet { font-size:56px; }
}
