:root {
    color-scheme: light dark;
}

body {
    font-family: ui-monospace, monospace;
    max-width: 40rem;
    margin: 4rem auto;
    padding: 0 1rem;
    line-height: 1.5;
}

.logo {
    display: block;
    width: 100%;
    max-width: 24rem;
    aspect-ratio: 18 / 5;
    object-fit: cover;
    object-position: center;
}

#arcade {
    margin-top: 2.5rem;
}

#game-picker {
    display: flex;
    gap: 0.5rem;
}

button {
    font: inherit;
    cursor: pointer;
    background: none;
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
}

#game-picker button[aria-pressed="true"] {
    background: CanvasText;
    color: Canvas;
}

#game-stage {
    margin-top: 1rem;
}

.game-hud {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
    margin-bottom: 0.5rem;
}

.game-hint {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 0.5rem 0 0;
}

.game-canvas {
    display: block;
    width: 100%;
    image-rendering: pixelated;
    touch-action: none;
}

.game-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.typing-field {
    position: relative;
    height: 14rem;
    border: 1px solid currentColor;
    border-radius: 0.25rem;
    overflow: hidden;
}

.typing-field .falling {
    position: absolute;
    top: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.typing-pad {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.typing-pad button {
    flex: 1 1 1.5rem;
}

.game-over {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid currentColor;
    font-size: 0.85rem;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#music-toggle {
    font: inherit;
    cursor: pointer;
    background: none;
    border: 1px solid currentColor;
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
}

#music-toggle.bee-target {
    animation: bee-target-pulse 0.6s ease-in-out infinite;
}

#bee {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 1.5rem;
    line-height: 1;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: left 0.7s ease-in-out, top 0.7s ease-in-out, opacity 0.4s ease;
    animation: bee-flutter 0.3s ease-in-out infinite alternate;
}

#bee.visible {
    opacity: 1;
}

@keyframes bee-flutter {
    from { transform: rotate(-8deg) scale(1); }
    to { transform: rotate(8deg) scale(1.05); }
}

@keyframes bee-target-pulse {
    from { box-shadow: 0 0 0 0 currentColor; }
    to { box-shadow: 0 0 0 0.4rem transparent; }
}

@media (prefers-reduced-motion: reduce) {
    #bee { display: none; }
    #music-toggle.bee-target { animation: none; }
}
