.kknk-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto 3rem auto;
    color: #f5f1f1;
    font-family: "Press Start 2P", "VT323", "Courier New", monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kknk-wrapper::before {
    content: "";
    position: absolute;
    inset: -12px;
    border: 3px solid #ff0055;
    pointer-events: none;
    z-index: 0;
}

.kknk-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: radial-gradient(circle at 50% 15%, #2a2a2a, #070707);
    image-rendering: pixelated;
    border: 4px solid #ffffff;
    box-shadow: 0 0 24px rgba(255, 0, 85, 0.65);
}

.kknk-ui {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

.kknk-stat {
    background-color: rgba(0, 0, 0, 0.75);
    padding: 8px 12px;
    border: 2px solid #ff0055;
    font-size: 0.75rem;
    pointer-events: auto;
}

.kknk-stat--status {
    flex: 1 1 100%;
    text-align: center;
    min-height: 1.5em;
}

.kknk-stat--highscore {
    margin-left: auto;
}

.kknk-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(5, 5, 5, 0.94);
    text-align: center;
    z-index: 10;
}

.kknk-overlay[hidden] {
    display: none;
}

.kknk-overlay h2 {
    font-size: 1.4rem;
    color: #ff0055;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.kknk-overlay p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #f7f7f7;
}

.kknk-highscore-text {
    font-size: 0.85rem;
    color: #ffef4c;
}

.kknk-gameover-note {
    font-size: 0.8rem;
    color: #f7f7f7;
}

.kknk-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.4rem;
    border: 3px solid #ffffff;
    background: #ff0055;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kknk-button:hover,
.kknk-button:focus {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(255, 0, 85, 0.65);
    outline: none;
}

.kknk-touch-controls {
    display: none;
    margin-top: 1rem;
    gap: 0.75rem;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    z-index: 15;
}

.kknk-touch-controls__row {
    display: flex;
    gap: 0.75rem;
}

.kknk-touch-button {
    width: 68px;
    height: 68px;
    border: 3px solid #ffffff;
    background: rgba(20, 20, 20, 0.9);
    color: #ff0055;
    font-size: 1.4rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
}

.kknk-touch-button--attack {
    width: 120px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .kknk-wrapper {
        padding: 1rem;
    }

    .kknk-wrapper::before {
        inset: -6px;
    }

    .kknk-overlay {
        padding: 1.5rem 1rem;
    }

    .kknk-overlay h2 {
        font-size: 1rem;
    }

    .kknk-overlay p {
        font-size: 0.75rem;
    }

    .kknk-button {
        font-size: 0.8rem;
    }

    .kknk-ui {
        flex-direction: column;
        align-items: stretch;
    }

    .kknk-stat {
        font-size: 0.65rem;
        text-align: center;
    }

    .kknk-stat--highscore {
        margin-left: 0;
    }

    .kknk-touch-controls {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kknk-button,
    .kknk-canvas {
        transition: none;
    }
}
