:root {
    --bg-color: #0d1117;
    --primary-gradient: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    --accent-color: #00e5ff;
    --success-color: #2e7d32;
    --error-color: #c62828;
    --pending-color: #0d47a1;
    --active-color: #ffeb3b;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background floating letters */
body::before {
    content: 'A B C D E F G H I J K L M N Ñ O P Q R S T U V W X Y Z';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    font-size: 10rem;
    font-weight: 800;
    display: flex;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    line-height: 0.8;
    filter: blur(5px);
}

#game-container {
    width: 100vmin;
    height: 100vmin;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding: 1%;
    /* Reduced from 2% to give more space */
}

/* Header Integration */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    z-index: 10;
    pointer-events: none;
}

.logo h1 {
    font-size: clamp(1rem, 4vmin, 1.8rem);
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to bottom, #fff, #b3e5fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.stat-box {
    text-align: center;
    min-width: 70px;
    background: var(--glass-bg);
    padding: 5px 10px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

.stat-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #90caf9;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
}

/* Main Rosco Area */
.game-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* Prevent scrollbars during animations */
}

.rosco-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rosco {
    position: relative;
    width: 98%;
    /* Increased from 90% to occupy full width */
    height: 98%;
    /* Critical: Maintain 1:1 ratio regardless of parent size */
    aspect-ratio: 1 / 1;
    max-width: 100%;
    max-height: 100%;
}

.letter {
    position: absolute;
    width: 8%;
    aspect-ratio: 1/1;
    background: var(--pending-color);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: clamp(0.7rem, 2.5vmin, 1.1rem);
    color: #fff;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.letter.active {
    background: var(--active-color);
    color: #000;
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 20px var(--active-color);
}

.letter.success {
    background: var(--success-color);
}

.letter.error {
    background: var(--error-color);
}

/* Center Interaction Area */
.rosco-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72%;
    /* Increased from 65% to occupy more central space */
    height: 72%;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12%;
    /* Adjusted padding for larger content area */
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.definition-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

#definition-text {
    font-size: clamp(0.8rem, 3vmin, 1.1rem);
    line-height: 1.4;
    min-height: 4em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#user-answer {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    width: 100%;
    outline: none;
}

.button-group {
    display: flex;
    gap: 5px;
}

.btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: 0.2s;
}

.btn.primary {
    background: var(--accent-color);
    color: #000;
    flex: 1.5;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    flex: 1;
}

.btn.pulse {
    animation: pulse 2s infinite;
    background: var(--accent-color);
    padding: 12px 24px;
    font-size: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #1a237e;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 300px;
    border: 1px solid var(--glass-border);
}

#final-score {
    font-size: 2.5rem;
    color: var(--accent-color);
    font-weight: 800;
    display: block;
    margin: 10px 0;
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 229, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    }
}