/* static/css/games.css */

/* ── Layout ── */
.game-page { min-height: 100vh; background: #f4fdf9; font-family: 'Poppins', sans-serif; }

/* ── XP Header Bar ── */
.xp-bar { background: linear-gradient(135deg, #173e3e, #0d2b2b); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
.xp-bar__level { color: #67e0a6; font-weight: 700; font-size: 14px; }
.xp-bar__progress-wrap { width: 140px; }
.xp-bar__track { background: rgba(255,255,255,0.15); border-radius: 20px; height: 8px; overflow: hidden; }
.xp-bar__fill { background: #67e0a6; height: 100%; border-radius: 20px; transition: width 0.4s ease; }
.xp-bar__label { color: rgba(255,255,255,0.5); font-size: 10px; margin-top: 3px; }
.xp-bar__badges { background: rgba(103,224,166,0.2); border-radius: 12px; padding: 6px 12px; text-align: center; cursor: pointer; }

/* ── Game Card ── */
.game-card { background: #fff; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); overflow: hidden; max-width: 480px; margin: 24px auto; }
.game-card__header { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.game-card__round { font-size: 12px; font-weight: 700; }
.game-card__streak { font-size: 13px; font-weight: 700; }
.game-card__body { padding: 24px 20px; text-align: center; }

/* ── Progress segments ── */
.round-progress { display: flex; gap: 4px; }
.round-progress__seg { height: 6px; border-radius: 3px; flex: 1; background: rgba(0,0,0,0.15); }
.round-progress__seg--done { background: rgba(0,0,0,0.5); }

/* ── Word display ── */
.word-display { font-size: 48px; font-weight: 700; color: #2c2f35; letter-spacing: 2px; margin-bottom: 8px; }
.word-display--split { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.word-chunk { background: #e9fef4; border: 2px solid #67e0a6; border-radius: 10px; padding: 6px 14px; font-size: 28px; font-weight: 700; color: #173e3e; }
.word-chunk--error { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

/* ── Definition box ── */
.definition-box { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; text-align: left; }
.definition-box__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.definition-box__text { font-size: 13px; color: #32353e; font-style: italic; }

/* ── Tap button ── */
.tap-btn { border-radius: 50%; width: 90px; height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 6px 20px rgba(103,224,166,0.5); cursor: pointer; border: none; background: linear-gradient(135deg, #67e0a6, #38df95); transition: transform 0.1s; }
.tap-btn:active { transform: scale(0.93); }
.tap-btn__icon { font-size: 28px; line-height: 1; }
.tap-btn__label { font-size: 10px; font-weight: 700; color: #0d3d3d; }

/* ── Dot counter ── */
.dot-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #e5e7eb; background: #fff; transition: background 0.15s, border-color 0.15s; }
.dot--filled { background: #67e0a6; border-color: #38df95; }
.dot--error { background: #ef4444; border-color: #dc2626; }

/* ── Timer bar ── */
.timer-bar { height: 6px; width: 100%; transition: width 1s linear; }

/* ── Letter slots (Spell Blast) ── */
.letter-slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.letter-slot { width: 34px; height: 40px; border-bottom: 3px solid #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #2c2f35; transition: border-color 0.2s; }
.letter-slot--active { border-color: #3b81fd; box-shadow: 0 0 0 2px #3b81fd; border-radius: 4px; }
.letter-slot--correct { border-color: #67e0a6; background: #e9fef4; border-radius: 4px 4px 0 0; }
.letter-slot--filled { border-bottom-color: #67e0a6; }

/* ── Letter tiles (Spell Blast) ── */
.letter-tiles { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 16px; }
.letter-tile { border-radius: 10px; width: 38px; height: 42px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; cursor: pointer; transition: transform 0.1s, opacity 0.2s; user-select: none; }
.letter-tile:active { transform: scale(0.9); }
.letter-tile--used { opacity: 0.35; pointer-events: none; }
.letter-tile--shake { animation: shake 0.3s ease; background: #fee2e2 !important; border-color: #ef4444 !important; color: #991b1b !important; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.word-display--shake { animation: shake 0.3s ease; }

/* ── Sound Snap cards ── */
.snap-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.snap-card { border: 2px solid #e5e7eb; border-radius: 14px; padding: 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s; text-align: center; }
.snap-card--selected { border-color: #f59e0b; background: #fff5e0; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.snap-card--correct { border-color: #67e0a6; background: #e9fef4; pointer-events: none; }
.snap-card--wrong { border-color: #ef4444; background: #fee2e2; pointer-events: none; }
.snap-card__word { font-size: 20px; font-weight: 700; color: #2c2f35; }
.snap-card__result { font-size: 20px; margin-top: 4px; }

/* ── Syllable tiles (Word Puzzle) ── */
.syllable-tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.syllable-tile { border-radius: 14px; padding: 12px 18px; font-size: 20px; font-weight: 700; color: #fff; cursor: pointer; transition: opacity 0.2s, transform 0.1s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.syllable-tile:active { transform: scale(0.93); }
.syllable-tile--used { opacity: 0.35; pointer-events: none; }
.syllable-tile--shake { animation: shake 0.3s ease; background: #fee2e2 !important; color: #991b1b !important; }

/* ── Syllable slots (Word Puzzle) ── */
.syllable-slots { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; align-items: center; }
.syllable-slot { min-width: 64px; height: 50px; border: 2px dashed #c4b5fd; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #ede9fe; background: #faf5ff; transition: all 0.2s; }
.syllable-slot--active { border: 3px dashed #8b5cf6; animation: pulse-border 1s infinite; }
.syllable-slot--filled { border-color: #8b5cf6; background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }
.syllable-slot--correct { border-color: #67e0a6; background: linear-gradient(135deg, #67e0a6, #38df95); color: #fff; }
.syllable-sep { color: #c4b5fd; font-size: 20px; font-weight: 700; }
@keyframes pulse-border { 0%,100%{border-color:#8b5cf6} 50%{border-color:#c4b5fd} }

/* ── XP popup ── */
.xp-popup { position: fixed; font-size: 18px; font-weight: 700; color: #173e3e; background: #67e0a6; border-radius: 20px; padding: 6px 16px; pointer-events: none; animation: float-up 1.2s ease forwards; z-index: 999; }
@keyframes float-up { 0%{opacity:1;transform:translateY(0)} 100%{opacity:0;transform:translateY(-60px)} }

/* ── Result XP box ── */
.xp-result { background: #e9fef4; border-radius: 12px; padding: 12px; margin: 12px 0; }
.xp-result--blue { background: #eef3ff; }
.xp-result__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.xp-result__label { font-size: 13px; font-weight: 700; }
.xp-result__track { background: rgba(0,0,0,0.1); border-radius: 20px; height: 6px; overflow: hidden; }
.xp-result__fill { height: 100%; border-radius: 20px; transition: width 0.6s ease; }

/* ── Buttons ── */
.btn-primary { border: none; border-radius: 50px; padding: 12px 32px; font-weight: 700; font-size: 15px; cursor: pointer; font-family: 'Poppins', sans-serif; }
.btn-secondary { background: #fff; border: 2px solid #e5e7eb; border-radius: 20px; padding: 7px 14px; font-size: 12px; color: #73767e; cursor: pointer; font-family: 'Poppins', sans-serif; }
.btn-hint { background: #fff; border: 2px solid #f59e0b; border-radius: 20px; padding: 7px 14px; font-size: 12px; color: #d97706; font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif; }
.btn-hear { background: transparent; border: 2px solid currentColor; border-radius: 50px; padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif; }

/* ── Lightning Round (dark) ── */
.lightning-page { background: #1a1a2e; min-height: 100vh; font-family: 'Poppins', sans-serif; }
.lightning-header { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.lightning-score { text-align: center; }
.lightning-score__count { font-size: 28px; font-weight: 800; color: #fff; }
.lightning-score__label { font-size: 10px; color: rgba(255,255,255,0.5); }
.lightning-multiplier { border-radius: 12px; padding: 8px 14px; text-align: center; }
.lightning-multiplier__value { font-size: 18px; font-weight: 800; color: #fff; }
.lightning-multiplier__label { font-size: 10px; font-weight: 600; }
.lightning-body { padding: 20px 18px; text-align: center; }
.lightning-type-badge { border-radius: 20px; display: inline-block; padding: 4px 14px; margin-bottom: 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.lightning-word { font-size: 40px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.lightning-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 20px; }
.lightning-num-btns { display: flex; gap: 10px; justify-content: center; }
.lightning-num-btn { background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15); border-radius: 14px; width: 58px; height: 58px; font-size: 22px; font-weight: 700; color: #fff; cursor: pointer; font-family: 'Poppins', sans-serif; transition: background 0.1s; }
.lightning-num-btn:hover { background: rgba(255,255,255,0.15); }
.lightning-flash-correct { animation: flash-green 0.3s ease; }
.lightning-flash-wrong { animation: flash-red 0.3s ease; }
@keyframes flash-green { 0%,100%{background:#1a1a2e} 50%{background:rgba(103,224,166,0.2)} }
@keyframes flash-red { 0%,100%{background:#1a1a2e} 50%{background:rgba(239,68,68,0.2)} }
.lightning-type-strip { display: flex; gap: 6px; justify-content: center; padding: 10px 0; }
.lightning-type-strip__seg { width: 30px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.15); }
.lightning-type-strip__seg--active { background: #67e0a6; }

/* ── Hub page ── */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px; }
.hub-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); cursor: pointer; text-decoration: none; display: block; }
.hub-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); transition: all 0.2s; }
.hub-card--locked { opacity: 0.7; cursor: default; }
.hub-card--full { grid-column: 1 / -1; }
.hub-card__header { padding: 16px 16px 12px; }
.hub-card__tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.hub-card__name { font-size: 18px; font-weight: 700; margin-top: 2px; }
.hub-card__body { padding: 12px 16px; }
.hub-card__desc { font-size: 12px; color: #73767e; margin-bottom: 8px; }
.hub-card__footer { display: flex; justify-content: space-between; align-items: center; }
.hub-dots { display: flex; gap: 4px; }
.hub-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; }
.hub-dot--filled { background: currentColor; }
.hub-play-btn { border: none; border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Poppins', sans-serif; }
.lock-prereqs { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 10px 16px 14px; background: #f9fafb; }
.lock-prereq { border-radius: 8px; padding: 8px; text-align: center; }
.lock-prereq__name { font-size: 10px; font-weight: 700; }
.lock-prereq__status { font-size: 11px; margin-top: 2px; }
