:root {
    --bg-dark: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* CTA & Animations */
@keyframes bounce-x {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }
}

.pulse-attention {
    animation: pulse-red 2s infinite;
    /* Reusing pulse-red but slower */
    color: var(--accent-green) !important;
}

.cta-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--accent-green);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    animation: bounce-x 1s infinite;
    pointer-events: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: opacity 0.3s ease;
    background: var(--bg-dark);
    z-index: 1;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* Home */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    min-height: 48px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.icon-btn-text {
    background: var(--bg-card);
    border: 1px solid #444;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    min-width: 60px;
}

.icon-btn:active,
.icon-btn-text:active {
    opacity: 0.7;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.category-card {
    background-color: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: transform 0.1s;
}

.category-card:active {
    transform: scale(0.96);
}

.category-title {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.hint-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.9rem;
}

/* Instructions */
.content-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 3rem;
    border-radius: 999px;
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid #555;
    color: var(--text-secondary);
    padding: 0.8rem 2rem;
    border-radius: 999px;
    font-size: 1rem;
    margin-top: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-decoration: underline;
    font-size: 1rem;
}

/* Game */
.big-word {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    z-index: 10;
    word-break: break-word;
    /* Safety for long words */
}

.hud-timer {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-green);
    z-index: 10;
}

.manual-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    opacity: 0.3;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid;
}

.control-btn.pass {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.control-btn.correct {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.fullscreen-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background-color 0.1s;
    /* Faster flash */
    z-index: 0;
}

/* Results */
.results-header {
    text-align: center;
    margin-bottom: 1rem;
}

.big-score {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
}

.list-container {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid #333;
    padding-top: 1rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #333;
    font-size: 1.2rem;
}

.results-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        color: var(--accent-red);
    }

    50% {
        transform: scale(1.1);
        color: #ff0000;
        text-shadow: 0 0 10px red;
    }

    100% {
        transform: scale(1);
        color: var(--accent-red);
    }
}

.pulse-urgent {
    animation: pulse-red 0.5s infinite;
}