html, body {
    margin: 0;
    height: 100%;
    background: #000;
    color: #c77dff;
    font-family: "VT323", "Consolas", ui-monospace, monospace;
    overflow: hidden;
}

/* .app (the play area) is defined in ../../arcade/arcade-shell.css. */

#stage {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Shared arcade control layout lives in ../../arcade/arcade-shell.css.
   Attack overrides only the theme colour. */
.arcade-btn {
    color: #c77dff;
    border-color: rgba(199, 125, 255, 0.55);
}
.arcade-btn:hover:not(:disabled) { background: rgba(199, 125, 255, 0.15); }

.hud__item span {
    margin-left: 0.5rem;
    color: #c77dff;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.75);
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
}

.overlay.hidden {
    display: none;
}

.overlay__title {
    font-size: clamp(2rem, 8vw, 4.5rem);
    letter-spacing: 0.35em;
    color: #c77dff;
    text-shadow: 0 0 12px rgba(199, 125, 255, 0.7);
}

.overlay__hint {
    max-width: 32rem;
    font-size: 1.15rem;
    line-height: 1.6;
    color: #d0d0d0;
}

.overlay.is-game-over {
    background: rgba(0, 0, 0, 0.86);
    gap: 1rem;
}

.overlay.is-game-over .overlay__hint,
.overlay.is-game-over .mode-select {
    display: none;
}

.mode-select {
    display: grid;
    grid-template-columns: repeat(4, 4.6rem);
    justify-content: center;
    gap: 0.35rem;
    max-width: 100%;
    overflow-x: auto;
}

.mode-btn {
    box-sizing: border-box;
    width: 100%;
    background: transparent;
    color: #e3c2ff;
    border: 2px solid rgba(199, 125, 255, 0.55);
    border-radius: 0;
    padding: 0.3rem 0.3rem;
    font-family: inherit;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mode-btn:hover,
.mode-btn.selected {
    color: #fff;
    background: rgba(199, 125, 255, 0.15);
    border-color: #c77dff;
    text-shadow: 0 0 6px rgba(199, 125, 255, 0.55);
}

.btn {
    background: transparent;
    color: #c77dff;
    border: 2px solid #c77dff;
    border-radius: 0;
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 1.3rem;
    letter-spacing: 0.2em;
    cursor: pointer;
}

.btn:hover {
    background: rgba(199, 125, 255, 0.15);
}

.btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#btn-start {
    min-width: 12rem;
    box-sizing: border-box;
    padding: 0.6rem 1.5rem;
    font-size: 1.3rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
}

.highscore-panel {
    width: min(92vw, 46rem);
    max-height: min(54vh, 30rem);
    border: 2px solid rgba(199, 125, 255, 0.72);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 18px rgba(199, 125, 255, 0.22), inset 0 0 0 1px rgba(199, 125, 255, 0.12);
    padding: 0.9rem;
    box-sizing: border-box;
}

.highscore-panel.hidden,
.highscore-panel[hidden] {
    display: none;
}

.highscore-status {
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 6px rgba(199, 125, 255, 0.55);
}

.highscore-table-wrap {
    max-height: min(42vh, 23rem);
    overflow: auto;
}

.highscore-table {
    width: 100%;
    border-collapse: collapse;
    color: #e3c2ff;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.highscore-table th,
.highscore-table td {
    border-bottom: 1px solid rgba(199, 125, 255, 0.24);
    padding: 0.35rem 0.45rem;
    text-align: left;
}

.highscore-table th:first-child,
.highscore-table td:first-child {
    width: 3.5rem;
    text-align: right;
}

.highscore-table th:last-child,
.highscore-table td:last-child {
    text-align: right;
}

.highscore-table tr.achieved {
    color: #fff;
    text-shadow: 0 0 8px rgba(199, 125, 255, 0.85);
    background: rgba(199, 125, 255, 0.12);
}

/* Base .touch-controls / .touch-btn layout lives in
   ../../arcade/arcade-shell.css - only the theme colour is overridden here. */
.touch-btn {
    color: #c77dff;
    border-color: rgba(199, 125, 255, 0.55);
}

.touch-btn.pressed {
    background: rgba(199, 125, 255, 0.25);
    color: #ffffff;
}
