body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #050811;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

canvas {
    border: 2px solid #00f0ff;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
    border-radius: 4px;
}

/* Classic mode canvas border override */
body.mode-classic canvas {
    border: 2px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

/* Top Bar Controls */
.top-bar {
    position: fixed;
    top: 14px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.icon-btn {
    padding: 6px 12px;
    background: rgba(10, 20, 35, 0.85);
    border: 1px solid #00f0ff;
    color: #00f0ff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* UI Overlay */
#ui-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.panel {
    pointer-events: auto;
    min-width: 340px;
    max-width: 580px;
    padding: 24px 28px;
    border: 2px solid #00f0ff;
    background: rgba(8, 14, 25, 0.92);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.05);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    backdrop-filter: blur(8px);
}

/* Classic Theme Panel */
.panel.classic-theme {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    background: rgba(0, 0, 0, 0.88);
}

.panel.classic-theme button.ui-btn {
    border-color: #00ff00;
    color: #00ff00;
}

.panel.classic-theme button.ui-btn:hover {
    background: rgba(0, 255, 0, 0.15);
}

/* Title & Badges */
.glitch-title-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

.main-title {
    margin: 0;
    font-size: 34px;
    letter-spacing: 2px;
    text-shadow: 0 0 12px #00f0ff;
    font-weight: 900;
}

.mode-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    background: rgba(255, 0, 234, 0.25);
    border: 1px solid #ff00ea;
    color: #ff80f6;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(255, 0, 234, 0.3);
}

.panel .sub {
    margin: 0 0 18px 0;
    font-size: 13px;
    color: #a0c0d8;
    line-height: 1.5;
}

/* Mode Switch Selector */
.mode-select-box {
    margin: 16px 0;
    padding: 12px;
    background: rgba(15, 25, 45, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
}

.mode-label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #00f0ff;
    margin-bottom: 8px;
}

.mode-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.mode-btn {
    flex: 1;
    padding: 10px 8px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8899aa;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #00f0ff;
    color: #fff;
}

.mode-btn.active {
    background: rgba(0, 240, 255, 0.2);
    border-color: #00f0ff;
    color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

#btn-mode-classic.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.4);
}

/* Mech Selection Grid */
.mech-select-box {
    margin: 14px 0 20px 0;
    padding: 12px;
    background: rgba(15, 25, 45, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
}

.mech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mech-card {
    padding: 8px 4px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.mech-card:hover {
    border-color: #00f0ff;
    transform: translateY(-2px);
}

.mech-card.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.mech-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.mech-spec {
    font-size: 10px;
    color: #88aacc;
}

/* Button Row */
.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

button.ui-btn {
    min-width: 140px;
    padding: 12px 16px;
    border: 2px solid #00f0ff;
    background: rgba(10, 20, 35, 0.85);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

button.ui-btn:hover {
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

button.ui-btn.primary-btn {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(0, 100, 255, 0.4));
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

button.ui-btn.primary-btn:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.6), rgba(0, 100, 255, 0.6));
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
}

/* In-game HUD Layer */
.hud-modern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

/* Weapon Selector Bar */
.weapon-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(10, 18, 30, 0.88);
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    pointer-events: auto;
    backdrop-filter: blur(6px);
}

.weapon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(15, 25, 40, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #ccddee;
    cursor: pointer;
    min-width: 72px;
    transition: all 0.15s;
}

.weapon-btn:hover {
    border-color: #00f0ff;
    background: rgba(0, 240, 255, 0.15);
}

.weapon-btn.active {
    border-color: #00f0ff;
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    color: #fff;
}

.weapon-btn.wp-orbital.active {
    border-color: #ff00ea;
    background: rgba(255, 0, 234, 0.25);
    box-shadow: 0 0 15px rgba(255, 0, 234, 0.5);
}

.wp-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.wp-name {
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
}

.wp-ammo {
    font-size: 11px;
    font-weight: 900;
    color: #00f0ff;
    margin-top: 2px;
}

.wp-key {
    font-size: 9px;
    color: #667788;
    margin-top: 1px;
}

/* Tactical Radio Box */
.radio-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 250px;
    padding: 8px 12px;
    background: rgba(8, 14, 25, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-left: 3px solid #00f0ff;
    border-radius: 4px;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.radio-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #00f0ff;
    margin-bottom: 4px;
}

.radio-dot {
    width: 6px;
    height: 6px;
    background: #39ff14;
    border-radius: 50%;
    box-shadow: 0 0 6px #39ff14;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.radio-msg {
    font-size: 11px;
    color: #e0f0ff;
    line-height: 1.4;
    font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Ranking & Name Entry */
.rank-list {
    text-align: left;
    margin: 14px auto 0 auto;
    padding: 12px 16px;
    border: 1px solid rgba(0, 240, 255, 0.5);
    max-height: 260px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.name-input {
    width: 92%;
    max-width: 420px;
    padding: 12px 14px;
    border: 2px solid #00f0ff;
    background: rgba(10, 20, 35, 0.8);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.name-input:focus {
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.victory-title {
    color: #ffe600;
    text-shadow: 0 0 15px rgba(255, 230, 0, 0.6);
}

.name-entry-input-wrap {
    margin-top: 14px;
}

.shots-label {
    margin-top: 14px;
    font-size: 16px;
    color: #00f0ff;
    font-weight: bold;
}

.hide {
    display: none !important;
}
