* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', 'Nunito', sans-serif;
}

body {
    overflow: hidden;
    background-color: #070b19;
    color: #ffffff;
    user-select: none;
}

/* Viewport & 50,000px Sky World */
#viewport {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#celestial-body {
    position: fixed;
    top: 80px;
    right: 12%;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff9c4 0%, #ffd54f 60%, rgba(255, 193, 7, 0) 100%);
    box-shadow: 0 0 60px rgba(255, 213, 79, 0.6);
    pointer-events: none;
    z-index: 1;
}

#world {
    width: 100%;
    height: 60000px;
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        to top,
        #56ccf2 0%,        /* Bright .io Sky */
        #2f80ed 12%,       /* High Sky */
        #1e3c72 28%,       /* Stratosphere */
        #0f172a 50%,       /* Deep Space */
        #050510 80%,       /* Outer Nebula */
        #020107 100%       /* Cosmic Void */
    );
    will-change: transform;
}

/* Ground */
#ground {
    width: 100%;
    height: 110px;
    background: #573b26;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
    border-top: 6px solid #1e293b;
}

.grass-top {
    width: 100%;
    height: 32px;
    background: #2ed573;
    border-bottom: 6px solid #26af5f;
}

/* Height Markers */
.marker {
    position: absolute;
    left: 0;
    width: 100%;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.22);
    padding-left: 24px;
    padding-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

/* Floating Checkpoint Platforms */
.platform {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    border: 4px solid #1e293b;
    border-radius: 20px;
    box-shadow: 0 8px 0 #0f172a, 0 12px 25px rgba(0, 0, 0, 0.45);
    z-index: 4;
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.platform::after {
    content: attr(data-word);
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.2);
}

@keyframes popIn {
    0% { transform: translateX(-50%) scale(0); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Player Character (.io Vector Style) */
#player-wrapper {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#player-nametag {
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
    border: 2px solid #1e293b;
    letter-spacing: 0.5px;
}

#player {
    width: 64px;
    height: 64px;
    background: #ff4757;
    border: 5px solid #1e293b;
    border-radius: 22px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset -6px -6px 0 rgba(0, 0, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: background 0.3s, transform 0.2s;
    animation: idleBob 2s ease-in-out infinite;
}

#player.jumping {
    animation: none;
    transform: scaleX(0.82) scaleY(1.22);
}

@keyframes idleBob {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.helmet-glare {
    position: absolute;
    top: 6px;
    left: 8px;
    width: 14px;
    height: 7px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    transform: rotate(-20deg);
}

.visor {
    width: 44px;
    height: 28px;
    background: #1e293b;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15);
}

.eyes {
    display: flex;
    gap: 10px;
}

.eye {
    width: 9px;
    height: 12px;
    background: #00d2d3;
    border-radius: 50%;
    box-shadow: 0 0 8px #00d2d3;
}

/* Jetpack Flame */
#jetpack-flame {
    width: 28px;
    height: 0px;
    background: linear-gradient(to bottom, #ffffff, #ffdd59, #ff5e57, transparent);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    transition: height 0.2s;
    filter: drop-shadow(0 6px 12px #ff5e57);
}

/* .io Game Cards */
.io-card {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 4px solid #1e293b;
    border-radius: 22px;
    box-shadow: 0 8px 0 #0f172a, 0 15px 35px rgba(0, 0, 0, 0.5);
    padding: 16px 22px;
    pointer-events: auto;
}

#ui-container {
    position: fixed;
    top: 18px;
    left: 18px;
    right: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 12px 24px;
}

.stat-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 0 #000;
}

#word-history {
    width: 270px;
    max-height: 210px;
    overflow-y: auto;
}

#word-history h3 {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.07);
    font-size: 14px;
    font-weight: 600;
}

.badge {
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 12px;
    border: 2px solid #1e293b;
}

/* Center Question Card & 35s Timer */
#question-card {
    position: fixed;
    top: 145px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 92%;
    max-width: 580px;
    text-align: center;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.badge-pill {
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 12px;
    border: 2px solid #1e293b;
}

#timer-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    padding: 5px 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 16px;
    color: #2ed573;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: color 0.3s, transform 0.2s;
}

#timer-badge.danger {
    color: #ff4757;
    animation: pulseDanger 0.6s infinite alternate;
}

@keyframes pulseDanger {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

#skip-btn {
    background: #475569;
    color: #ffffff;
    border: 2px solid #1e293b;
    box-shadow: 0 3px 0 #1e293b;
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s;
}

#skip-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

#question-text {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    text-shadow: 0 2px 0 #0f172a;
}

#question-hint {
    font-size: 13px;
    color: #7bed9f;
    margin-bottom: 12px;
}

.timer-bar-bg {
    width: 100%;
    height: 10px;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
}

#timer-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2ed573, #7bed9f);
}

/* Input Bar */
#input-bar {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 92%;
    max-width: 540px;
}

#feedback {
    margin-bottom: 12px;
    padding: 10px 20px;
    border-radius: 16px;
    border: 3px solid #1e293b;
    font-weight: 800;
    font-size: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 6px 0 #0f172a;
    pointer-events: auto;
}

#feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* Clickable Spelling Suggestion Button */
.suggest-chip {
    display: inline-block;
    margin-left: 8px;
    background: #ffdd59;
    color: #0f172a;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 10px;
    border: 2px solid #1e293b;
    box-shadow: 0 3px 0 #1e293b;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s;
}

.suggest-chip:hover {
    background: #fff200;
    transform: scale(1.05);
}

.suggest-chip:active {
    transform: translateY(2px);
    box-shadow: none;
}

.input-group {
    display: flex;
    width: 100%;
    background: #0f172a;
    border: 4px solid #1e293b;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 8px 0 #090d16, 0 15px 30px rgba(0, 0, 0, 0.5);
}

#word-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: 10px 20px;
}

#word-input::placeholder {
    color: #64748b;
}

#jump-btn {
    background: linear-gradient(180deg, #ff6b81 0%, #ff4757 100%);
    border: 3px solid #1e293b;
    box-shadow: 0 4px 0 #1e293b;
    color: white;
    font-weight: 800;
    font-size: 16px;
    padding: 10px 28px;
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.1s;
}

#jump-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

#jump-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Vector Clouds, Stars & Particles */
.cloud, .star, .planet, .particle {
    position: absolute;
    pointer-events: none;
}

.cloud {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    box-shadow: 0 8px 0 rgba(203, 213, 225, 0.6);
}

.star {
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

.planet {
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.3);
    box-shadow: inset -12px -12px 0 rgba(0, 0, 0, 0.25);
}

.particle {
    border-radius: 50%;
    animation: fadeOutParticle 0.8s forwards;
}

@keyframes fadeOutParticle {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.1) translateY(30px); }
}

@keyframes twinkle {
    from { opacity: 0.25; }
    to { opacity: 1; }
}