:root {
    --bg-deep: #0b0719;
    --bg-mid: #160e33;
    --panel-bg: rgba(24, 16, 52, 0.72);
    --panel-border: rgba(255, 255, 255, 0.14);
    --text-main: #f8f7ff;
    --text-muted: #b8b0d8;

    --neon-pink: #ff4ecd;
    --neon-cyan: #00f5d4;
    --neon-purple: #a855f7;
    --neon-gold: #ffd166;
    --neon-coral: #ff6b6b;

    /* Pirštų spalvos */
    --f-l-pinky: #ff4ecd;
    --f-l-ring: #ff8552;
    --f-l-middle: #ffd166;
    --f-l-index: #00f5d4;
    --f-r-index: #38bdf8;
    --f-r-middle: #a855f7;
    --f-r-ring: #fb7185;
    --f-r-pinky: #c084fc;
    --f-thumb: #e2e8f0;
}

/* Spalvų temos iš krautuvėlės */
body[data-theme="mint-aurora"] {
    --bg-deep: #04171a;
    --bg-mid: #0a2a30;
    --panel-bg: rgba(8, 36, 42, 0.74);
    --neon-pink: #2dd4bf;
    --neon-cyan: #6ee7b7;
    --neon-purple: #38bdf8;
}

body[data-theme="sunset-gold"] {
    --bg-deep: #1a0b16;
    --bg-mid: #2e1226;
    --panel-bg: rgba(44, 17, 37, 0.75);
    --neon-pink: #ff758f;
    --neon-cyan: #ffd166;
    --neon-purple: #f97316;
}

body[data-theme="rainbow-magic"] {
    --bg-deep: #110824;
    --bg-mid: #231145;
    --panel-bg: rgba(34, 17, 68, 0.72);
    --neon-pink: #ff66c4;
    --neon-cyan: #5ce1e6;
    --neon-purple: #cb6ce6;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: radial-gradient(circle at top left, var(--bg-mid), var(--bg-deep) 70%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, .brand-title, .neon-btn {
    font-family: 'Fredoka', sans-serif;
}

/* Kosminis fonas */
.cosmos-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: drift 18s ease-in-out infinite alternate;
}

.nebula-1 {
    width: 450px;
    height: 450px;
    background: var(--neon-pink);
    top: -120px;
    left: -100px;
}

.nebula-2 {
    width: 500px;
    height: 500px;
    background: var(--neon-cyan);
    bottom: -160px;
    right: -120px;
    animation-delay: -6s;
}

.nebula-3 {
    width: 380px;
    height: 380px;
    background: var(--neon-purple);
    top: 40%;
    left: 45%;
    opacity: 0.22;
    animation-delay: -11s;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, -30px) scale(1.12); }
}

.stars-layer {
    position: absolute;
    inset: 0;
}

.bg-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--dur, 3s) ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.2; transform: scale(0.8); }
    to { opacity: 0.95; transform: scale(1.3); }
}

#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
}

/* Stiklo efektas */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 20px 50px;
}

/* Viršutinė juosta */
.top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    border-color: rgba(255, 78, 205, 0.28);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    display: grid;
    place-items: center;
    font-size: 26px;
    box-shadow: 0 0 20px rgba(255, 78, 205, 0.55);
}

.brand-title {
    font-size: 1.35rem;
    background: linear-gradient(90deg, #fff, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
    min-width: 260px;
}

.avatar-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 6px 14px 6px 8px;
    color: inherit;
    cursor: pointer;
    transition: 0.2s;
}

.avatar-chip:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.3);
}

.avatar-emoji {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 78, 205, 0.22);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.player-name {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.1;
}

.player-rank {
    font-size: 0.75rem;
    color: var(--neon-cyan);
}

.xp-meter {
    width: 150px;
}

.xp-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.xp-bar-track {
    height: 9px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.xp-bar-track.large {
    height: 12px;
}

.xp-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    box-shadow: 0 0 12px var(--neon-pink);
    transition: width 0.35s ease;
}

.xp-bar-fill.neon-rainbow {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-gold));
}

.header-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pill-streak { border-color: rgba(255, 133, 82, 0.45); box-shadow: 0 0 12px rgba(255, 133, 82, 0.2); }
.pill-stars  { border-color: rgba(255, 209, 102, 0.45); box-shadow: 0 0 12px rgba(255, 209, 102, 0.2); }
.pill-crystals { border-color: rgba(0, 245, 212, 0.45); box-shadow: 0 0 12px rgba(0, 245, 212, 0.25); }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:hover {
    transform: scale(1.08);
    border-color: var(--neon-pink);
}

/* Navigacija */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.nav-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 78, 205, 0.32), rgba(0, 245, 212, 0.22));
    border-color: var(--neon-pink);
    box-shadow: 0 0 18px rgba(255, 78, 205, 0.38);
}

.nav-badge {
    background: var(--neon-gold);
    color: #1a0f2e;
    font-size: 0.72rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
}

.hidden { display: none !important; }

.view { display: none; animation: fadeIn 0.28s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mygtukai */
.neon-btn {
    border: none;
    border-radius: 15px;
    padding: 11px 22px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.neon-btn-primary {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    box-shadow: 0 0 22px rgba(255, 78, 205, 0.48);
}

.neon-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 30px rgba(255, 78, 205, 0.72);
}

.neon-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.neon-btn-ghost:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 245, 212, 0.28);
}

.neon-btn-danger-outline {
    background: transparent;
    color: var(--neon-coral);
    border: 1px solid rgba(255, 107, 107, 0.45);
}

.neon-btn-danger-outline:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* Pasisveikinimo juosta ir Pasauliai */
.welcome-banner {
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    border-color: rgba(0, 245, 212, 0.3);
}

.welcome-banner h2 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.welcome-banner p {
    color: var(--text-muted);
    max-width: 650px;
}

.worlds-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.world-card {
    padding: 22px;
    border-left: 5px solid var(--world-color, var(--neon-cyan));
}

.world-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.world-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.world-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
}

.world-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.levels-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 14px;
}

.level-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: left;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-card:hover:not(.locked) {
    transform: translateY(-4px);
    border-color: var(--world-color, var(--neon-pink));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 78, 205, 0.25);
}

.level-card.next-up {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-num {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.level-stars {
    font-size: 1rem;
    letter-spacing: 2px;
}

.level-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.08rem;
}

.level-sub {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.level-keys-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
    padding-top: 4px;
}

.mini-key {
    background: rgba(0, 245, 212, 0.14);
    border: 1px solid rgba(0, 245, 212, 0.35);
    color: var(--neon-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

/* SPAUSDINIMO ARENA */
.typing-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 14px;
}

.typing-level-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: #0b0719;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 4px 11px;
    border-radius: 999px;
}

.typing-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blind-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.07);
    padding: 7px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.88rem;
    font-weight: 700;
}

.blind-toggle input { display: none; }

.toggle-slider {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    position: relative;
    transition: 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: 0.2s;
}

.blind-toggle input:checked + .toggle-slider {
    background: var(--neon-pink);
    box-shadow: 0 0 12px var(--neon-pink);
}

.blind-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

/* Patarimas ir augintinis */
.tip-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 14px 20px;
    margin-bottom: 14px;
    border-color: rgba(255, 209, 102, 0.28);
}

.pet-companion {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pet-avatar {
    font-size: 2.3rem;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 78, 205, 0.18);
    border: 1px solid rgba(255, 78, 205, 0.45);
    display: grid;
    place-items: center;
    animation: floatPet 2.6s ease-in-out infinite;
}

@keyframes floatPet {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.pet-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--neon-gold);
    max-width: 240px;
}

.tip-text-box {
    flex: 1;
    min-width: 240px;
}

.new-keys-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.88rem;
    font-weight: 700;
}

.tip-keycap {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(180deg, rgba(0, 245, 212, 0.28), rgba(0, 245, 212, 0.12));
    border: 1px solid var(--neon-cyan);
    color: #fff;
    padding: 2px 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.35);
}

.tip-text-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Gyva statistika */
.live-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-progress-card {
    grid-column: span 2;
}

.metric-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-cyan);
}

.metric-value small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Spausdinimo juosta */
.typing-stage {
    padding: 28px 26px;
    margin-bottom: 16px;
    border: 2px solid rgba(255, 78, 205, 0.4);
    box-shadow: 0 0 30px rgba(255, 78, 205, 0.18);
    outline: none;
    position: relative;
}

.typing-prompt-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.typing-stream {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    line-height: 1.75;
    letter-spacing: 0.04em;
    word-wrap: break-word;
    user-select: none;
}

.char {
    display: inline-block;
    padding: 0 1px;
    border-radius: 5px;
    transition: all 0.1s ease;
}

.char.space-char {
    min-width: 0.58em;
}

.char.done {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 245, 212, 0.45);
}

.char.current {
    background: rgba(255, 78, 205, 0.35);
    color: #fff;
    border-bottom: 3px solid var(--neon-pink);
    box-shadow: 0 0 16px rgba(255, 78, 205, 0.65);
    animation: pulseCursor 1s ease-in-out infinite;
}

.char.current.space-char::after {
    content: '␣';
    font-size: 0.9rem;
    opacity: 0.85;
}

.char.error-flash {
    background: rgba(255, 107, 107, 0.45);
    border-bottom-color: var(--neon-coral);
    animation: shakeKey 0.25s ease;
}

@keyframes pulseCursor {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 78, 205, 0.6); }
    50% { box-shadow: 0 0 22px rgba(255, 78, 205, 0.95); }
}

@keyframes shakeKey {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Virtuali klaviatūra */
.keyboard-wrapper {
    padding: 18px;
}

.virtual-keyboard {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 820px;
    margin: 0 auto 16px;
}

.kb-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.kb-key {
    position: relative;
    height: 48px;
    min-width: 46px;
    padding: 0 8px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-bottom-width: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.98rem;
    color: #fff;
    transition: all 0.12s ease;
    user-select: none;
}

.kb-key .sub-lt {
    font-size: 0.68rem;
    color: var(--neon-gold);
    line-height: 1;
}

.kb-key.wide-15 { min-width: 72px; font-size: 0.8rem; }
.kb-key.wide-18 { min-width: 86px; font-size: 0.8rem; }
.kb-key.wide-22 { min-width: 105px; font-size: 0.8rem; }
.kb-key.space-key { min-width: 290px; font-size: 0.82rem; }

/* Pirštų spalvų akcentai ant klavišų */
.kb-key[data-finger="l-pinky"]  { border-color: rgba(255, 78, 205, 0.4); }
.kb-key[data-finger="l-ring"]   { border-color: rgba(255, 133, 82, 0.4); }
.kb-key[data-finger="l-middle"] { border-color: rgba(255, 209, 102, 0.4); }
.kb-key[data-finger="l-index"]  { border-color: rgba(0, 245, 212, 0.45); }
.kb-key[data-finger="r-index"]  { border-color: rgba(56, 189, 248, 0.45); }
.kb-key[data-finger="r-middle"] { border-color: rgba(168, 85, 247, 0.4); }
.kb-key[data-finger="r-ring"]   { border-color: rgba(251, 113, 133, 0.4); }
.kb-key[data-finger="r-pinky"]  { border-color: rgba(192, 132, 252, 0.4); }

/* F ir J iškilimų žymė */
.kb-key.home-bump::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 14px;
    height: 3px;
    border-radius: 3px;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* Aktyvus (reikalingas paspausti) klavišas */
.kb-key.target-active {
    background: linear-gradient(135deg, rgba(255, 78, 205, 0.55), rgba(0, 245, 212, 0.45));
    border-color: #fff;
    box-shadow: 0 0 22px var(--neon-pink), 0 0 10px var(--neon-cyan);
    transform: translateY(-3px) scale(1.06);
    z-index: 2;
}

.kb-key.wrong-flash {
    background: rgba(255, 107, 107, 0.6);
    border-color: var(--neon-coral);
}

/* Aklasis režimas paslepia raidžių užrašus */
.virtual-keyboard.blind-mode .kb-key .key-main,
.virtual-keyboard.blind-mode .kb-key .sub-lt {
    opacity: 0;
}

.virtual-keyboard.blind-mode .kb-key.target-active {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
}

/* Rankų ir pirštų gidas */
.hands-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.active-finger-pill {
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(0, 245, 212, 0.14);
    border: 1px solid rgba(0, 245, 212, 0.4);
    color: var(--neon-cyan);
    font-weight: 800;
    font-size: 0.92rem;
}

.hands-svg-row {
    display: flex;
    justify-content: center;
    gap: 44px;
    flex-wrap: wrap;
}

.hand-svg {
    width: 170px;
    height: 115px;
    overflow: visible;
}

.hand-svg .palm {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.24);
    stroke-width: 2;
}

.hand-svg .finger {
    fill: rgba(255, 255, 255, 0.1);
    stroke: rgba(255, 255, 255, 0.28);
    stroke-width: 2;
    transition: all 0.15s ease;
}

.hand-svg .finger[data-finger="l-pinky"].active  { fill: var(--f-l-pinky);  stroke: #fff; filter: drop-shadow(0 0 10px var(--f-l-pinky)); }
.hand-svg .finger[data-finger="l-ring"].active   { fill: var(--f-l-ring);   stroke: #fff; filter: drop-shadow(0 0 10px var(--f-l-ring)); }
.hand-svg .finger[data-finger="l-middle"].active { fill: var(--f-l-middle); stroke: #fff; filter: drop-shadow(0 0 10px var(--f-l-middle)); }
.hand-svg .finger[data-finger="l-index"].active  { fill: var(--f-l-index);  stroke: #fff; filter: drop-shadow(0 0 10px var(--f-l-index)); }
.hand-svg .finger[data-finger="r-index"].active  { fill: var(--f-r-index);  stroke: #fff; filter: drop-shadow(0 0 10px var(--f-r-index)); }
.hand-svg .finger[data-finger="r-middle"].active { fill: var(--f-r-middle); stroke: #fff; filter: drop-shadow(0 0 10px var(--f-r-middle)); }
.hand-svg .finger[data-finger="r-ring"].active   { fill: var(--f-r-ring);   stroke: #fff; filter: drop-shadow(0 0 10px var(--f-r-ring)); }
.hand-svg .finger[data-finger="r-pinky"].active  { fill: var(--f-r-pinky);  stroke: #fff; filter: drop-shadow(0 0 10px var(--f-r-pinky)); }
.hand-svg .finger[data-finger="thumb"].active    { fill: var(--f-thumb);    stroke: #fff; filter: drop-shadow(0 0 10px var(--f-thumb)); }

/* DIENOS UŽDUOTYS */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-muted);
}

.streak-panel {
    padding: 20px;
    margin-bottom: 20px;
}

.streak-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.muted-note { color: var(--text-muted); font-size: 0.88rem; }

.streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.streak-day {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.streak-day.completed {
    background: linear-gradient(180deg, rgba(0, 245, 212, 0.22), rgba(255, 78, 205, 0.18));
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.streak-day-num { font-weight: 800; font-size: 0.86rem; }
.streak-day-reward { font-size: 0.85rem; color: var(--neon-gold); font-weight: 800; }

.daily-two-col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.daily-quests-panel, .daily-challenge-card {
    padding: 22px;
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.quest-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.quest-info { flex: 1; }
.quest-title { font-weight: 800; font-size: 1rem; margin-bottom: 2px; }
.quest-desc { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 8px; }

.daily-challenge-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-color: rgba(255, 209, 102, 0.4);
}

.challenge-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 14px var(--neon-gold));
}

.challenge-rewards {
    display: flex;
    gap: 10px;
}

.reward-tag {
    background: rgba(255, 209, 102, 0.18);
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 800;
}

.challenge-status {
    font-size: 0.88rem;
    color: var(--neon-cyan);
    font-weight: 700;
}

/* PASIEKIMAI */
.ranks-panel, .badges-panel {
    padding: 22px;
    margin-bottom: 22px;
}

.ranks-ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.rank-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    opacity: 0.55;
}

.rank-card.unlocked {
    opacity: 1;
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 212, 0.1);
}

.rank-card.current {
    border-color: var(--neon-pink);
    box-shadow: 0 0 20px rgba(255, 78, 205, 0.4);
}

.rank-icon { font-size: 2rem; margin-bottom: 6px; }
.rank-name { font-weight: 800; font-size: 0.92rem; }
.rank-xp { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.badge-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    opacity: 0.48;
}

.badge-card.unlocked {
    opacity: 1;
    border-color: var(--neon-gold);
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(255, 78, 205, 0.1));
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.18);
}

.badge-icon {
    font-size: 2.2rem;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.badge-title { font-weight: 800; font-size: 0.98rem; }
.badge-desc { font-size: 0.82rem; color: var(--text-muted); }

/* KRAUTUVĖLĖ */
.shop-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.shop-balance {
    padding: 10px 20px;
    font-size: 1.15rem;
    border-color: var(--neon-cyan);
}

.shop-section {
    margin-bottom: 26px;
}

.shop-section h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.shop-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: 0.2s;
}

.shop-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon-pink);
}

.shop-card.equipped {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
}

.shop-icon { font-size: 2.3rem; }
.shop-title { font-family: 'Fredoka', sans-serif; font-size: 1.1rem; }
.shop-desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; }

/* PROFILIS */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.profile-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-label {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.neon-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.neon-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 245, 212, 0.35);
}

.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-opt {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.6rem;
    cursor: pointer;
    transition: 0.18s;
}

.avatar-opt.selected {
    border-color: var(--neon-pink);
    background: rgba(255, 78, 205, 0.25);
    box-shadow: 0 0 15px rgba(255, 78, 205, 0.5);
    transform: scale(1.08);
}

.profile-stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.p-stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px;
}

.p-stat-box span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.p-stat-box strong { font-size: 1.2rem; color: var(--neon-cyan); }

.sticker-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 48px;
}

.sticker-pill {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 209, 102, 0.4);
    display: grid;
    place-items: center;
}

.danger-zone {
    margin-top: auto;
    padding-top: 10px;
}

/* MODALAS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 4, 20, 0.78);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 900;
}

.modal-card {
    max-width: 520px;
    width: 100%;
    padding: 30px 26px;
    text-align: center;
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 50px rgba(255, 78, 205, 0.45);
    animation: popIn 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-stars {
    font-size: 2.8rem;
    letter-spacing: 6px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px var(--neon-gold));
}

.modal-card h2 {
    font-size: 1.9rem;
    margin-bottom: 6px;
}

.modal-card p {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.modal-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.modal-stat {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 6px;
}

.modal-stat span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.modal-stat strong { font-size: 1.05rem; color: var(--neon-cyan); }

.modal-extras {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.extra-banner {
    background: linear-gradient(90deg, rgba(255, 209, 102, 0.2), rgba(255, 78, 205, 0.2));
    border: 1px solid var(--neon-gold);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 0.9rem;
}

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

/* Pranešimai */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 14, 44, 0.94);
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.35);
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    animation: fadeIn 0.25s ease;
}

@media (max-width: 820px) {
    .daily-two-col { grid-template-columns: 1fr; }
    .streak-calendar { grid-template-columns: repeat(4, 1fr); }
    .metric-progress-card { grid-column: span 1; }
    .kb-key { min-width: 28px; height: 40px; font-size: 0.78rem; padding: 0 4px; }
    .kb-key.space-key { min-width: 160px; }
    .kb-key.wide-15, .kb-key.wide-18, .kb-key.wide-22 { min-width: 48px; font-size: 0.68rem; }
    .modal-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Galaktikos Mėlyna tema */
body[data-theme="neon-galaxy"] {
    --bg-deep: #050a1f;
    --bg-mid: #0c1b47;
    --panel-bg: rgba(11, 23, 58, 0.76);
    --neon-pink: #38bdf8;
    --neon-cyan: #00f5d4;
    --neon-purple: #6366f1;
}

/* Tamsusis Neonas (Pro) - stilinga tema suaugusiems */
body[data-theme="pro-slate"] {
    --bg-deep: #090d16;
    --bg-mid: #111827;
    --panel-bg: rgba(17, 24, 39, 0.82);
    --neon-pink: #10b981;
    --neon-cyan: #38bdf8;
    --neon-purple: #6366f1;
}

/* PRISIJUNGIMO / REGISTRACIJOS EKRANAS */
.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 490px;
    padding: 28px 26px;
    border: 1.5px solid rgba(0, 245, 212, 0.35);
    box-shadow: 0 0 45px rgba(168, 85, 247, 0.32);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 16px;
}

.auth-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Fredoka', sans-serif;
    font-size: 0.96rem;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.auth-tab.active {
    background: linear-gradient(135deg, rgba(255, 78, 205, 0.38), rgba(0, 245, 212, 0.28));
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 78, 205, 0.35);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.auth-form .form-label {
    display: block;
    margin-bottom: 5px;
}

.auth-error {
    background: rgba(255, 107, 107, 0.18);
    border: 1px solid var(--neon-coral);
    color: #ffd4d4;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 4px;
    padding: 13px 20px;
}

.auth-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
    margin-top: 16px;
}

.pw-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.pw-rules span.ok {
    color: var(--neon-cyan);
    font-weight: 800;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* 3 kortelių pasirinkimas: Mergaitė / Berniukas / Suaugęs */
.gender-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 9px;
}

.gender-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    cursor: pointer;
    font-weight: 800;
    font-size: 0.92rem;
    transition: 0.2s;
}

.gender-card input {
    display: none;
}

.gender-card.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 212, 0.16);
    box-shadow: 0 0 16px rgba(0, 245, 212, 0.28);
}

.gender-emoji {
    font-size: 1.25rem;
}

.danger-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.support-box {
    margin-top: 14px;
    text-align: center;
}

.app-footer {
    margin-top: 28px;
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.donate-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--neon-gold);
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: 999px;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.45);
    transition: all 0.2s ease;
}

.donate-pill:hover {
    background: rgba(255, 209, 102, 0.24);
    box-shadow: 0 0 16px rgba(255, 209, 102, 0.4);
    transform: translateY(-2px);
}

/* Naujos 3 temos iš parduotuvės */
body[data-theme="candy-nebula"] {
    --bg-deep: #1b0b28;
    --bg-mid: #321447;
    --panel-bg: rgba(45, 19, 64, 0.74);
    --neon-pink: #ff85d0;
    --neon-cyan: #72f2eb;
    --neon-purple: #d896ff;
}

body[data-theme="emerald-matrix"] {
    --bg-deep: #04150d;
    --bg-mid: #082919;
    --panel-bg: rgba(8, 36, 22, 0.78);
    --neon-pink: #34d399;
    --neon-cyan: #a3e635;
    --neon-purple: #10b981;
}

body[data-theme="royal-diamond"] {
    --bg-deep: #060b24;
    --bg-mid: #0f1b4c;
    --panel-bg: rgba(15, 27, 74, 0.76);
    --neon-pink: #60a5fa;
    --neon-cyan: #e0f2fe;
    --neon-purple: #a78bfa;
}

/* Silpnųjų klavišų treniruoklio kortelė žemėlapyje */
.weak-keys-banner {
    padding: 18px 24px;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-color: rgba(56, 189, 248, 0.38);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.1));
}

.weak-keys-banner h3 {
    font-size: 1.18rem;
    margin-bottom: 3px;
}

.weak-keys-banner p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.weak-keys-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.weak-key-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 9px;
    background: rgba(255, 107, 107, 0.18);
    border: 1px solid rgba(255, 107, 107, 0.5);
    color: #ffd0d0;
}

.weak-key-pill.clean {
    background: rgba(0, 245, 212, 0.15);
    border-color: rgba(0, 245, 212, 0.45);
    color: var(--neon-cyan);
}

/* Lygio kortelės rekordai ir tikslas */
.level-best-row {
    display: flex;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--neon-gold);
}

.goal-pill {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 209, 102, 0.15);
    border: 1px solid rgba(255, 209, 102, 0.45);
    color: var(--neon-gold);
}

/* Klavišų efektai (dalelės ir vaivorykštės raštas) */
.typing-stage {
    overflow: hidden;
}

.particles-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.key-particle {
    position: absolute;
    font-size: 1.05rem;
    animation: floatParticle 0.6s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes floatParticle {
    0%   { transform: translate(-50%, 0) scale(0.7); opacity: 1; }
    100% { transform: translate(-50%, -34px) scale(1.25); opacity: 0; }
}

.fx-rainbow-stream .char.done:nth-child(5n+1) { color: #ff4ecd; text-shadow: 0 0 8px rgba(255, 78, 205, 0.5); }
.fx-rainbow-stream .char.done:nth-child(5n+2) { color: #ffd166; text-shadow: 0 0 8px rgba(255, 209, 102, 0.5); }
.fx-rainbow-stream .char.done:nth-child(5n+3) { color: #00f5d4; text-shadow: 0 0 8px rgba(0, 245, 212, 0.5); }
.fx-rainbow-stream .char.done:nth-child(5n+4) { color: #38bdf8; text-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
.fx-rainbow-stream .char.done:nth-child(5n+5) { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.5); }
