* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    color: #fbfbf0;
    background: #1a1d17;
    font-family: Verdana, "Gill Sans", "Trebuchet MS", sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    min-height: 100vh;
}

.shell {
    min-height: 100vh;
    padding: 12px;
}

.topbar,
.player-panel,
.turn-strip,
.move-panel,
.aim-panel,
.fire-button,
.footer-row {
    background: rgba(23, 26, 21, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.title-block {
    min-width: 0;
}

.label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 10px;
    line-height: 1.1;
    color: #e5c15a;
}

h1 {
    margin: 3px 0 0;
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Verdana, sans-serif;
    font-size: 38px;
    line-height: 0.95;
}

.top-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.small-button {
    display: inline-block;
    min-width: 58px;
    min-height: 38px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #fbfbf0;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.reset-button {
    color: #fbd7b0;
    background: rgba(183, 78, 37, 0.28);
}

.player-panel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
}

.player-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d29b3d;
    border: 2px solid rgba(255, 255, 255, 0.42);
}

.player-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 19px;
    font-weight: 800;
}

.player-status,
.turn-meta,
.meter-text,
#networkStatus {
    color: rgba(251, 251, 240, 0.68);
    font-size: 12px;
}

.player-stats {
    flex: 0 0 auto;
    text-align: right;
}

.name-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #fbfbf0;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

#healthValue {
    display: block;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
}

#winsValue {
    display: block;
    margin-top: 4px;
    color: #e5c15a;
    font-size: 11px;
}

.turn-strip,
.move-panel,
.aim-panel {
    margin-top: 10px;
    padding: 12px;
}

.turn-text {
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 22px;
    font-weight: 800;
}

.turn-meta {
    margin-top: 5px;
}

.move-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.move-button {
    flex: 1 1 0;
    min-height: 96px;
    border: 0;
    border-radius: 8px;
    color: #fbfbf0;
    background: #304032;
    font: inherit;
    font-size: 24px;
    font-weight: 900;
    touch-action: none;
}

.move-button.active {
    background: #4d6c43;
    color: #ffffff;
}

.meter-text {
    margin-top: 9px;
    text-align: center;
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.field-row label {
    color: #e5c15a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field-row span {
    font-size: 18px;
    font-weight: 800;
}

input[type="range"] {
    display: block;
    width: 100%;
    margin: 0 0 15px;
}

.fire-button {
    display: block;
    width: 100%;
    min-height: 112px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #25120c;
    background: #e5663d;
    font: inherit;
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Verdana, sans-serif;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fire-button.active {
    background: #f1b24c;
}

button:disabled,
input:disabled {
    opacity: 0.46;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
}

.pulse-banner {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
    color: #e5c15a;
    font-weight: 800;
    text-align: right;
    transition: transform 160ms ease;
}

.pulse-banner.flash {
    transform: scale(1.04);
}

@media (max-width: 420px) {
    .shell {
        padding: 10px;
    }

    h1 {
        font-size: 31px;
    }

    .small-button {
        min-width: 50px;
        min-height: 34px;
        padding: 8px;
        font-size: 12px;
    }

    .name-button {
        min-height: 34px;
        padding: 8px;
        font-size: 11px;
    }

    .move-button {
        min-height: 82px;
        font-size: 21px;
    }

    .fire-button {
        min-height: 96px;
        font-size: 32px;
    }
}
