/* ============================================
   Shooter Game — Comic Book Style UI
   ============================================ */

#shooter-screen {
    background: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Bangers', 'Comic Sans MS', cursive;
}

/* Room UI */
#shooter-room-ui {
    width: 100%;
    max-width: 360px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shooter-title {
    font-size: 2rem;
    color: #FFD700;
    text-shadow: 3px 3px 0px #FF4500, -1px -1px 0px #000;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.shooter-subtitle {
    color: #aaa;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 24px;
    font-family: 'Nunito', sans-serif;
}

.shooter-room-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-bottom: 20px;
}

.shooter-room-btn {
    background: linear-gradient(135deg, #2d1f3d, #1a1a2e);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 4px 4px 0px #FF4500;
    transition: transform 0.1s;
    color: #FFD700;
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.shooter-room-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #FF4500;
}

.shooter-room-btn small {
    display: block;
    color: #aaa;
    font-size: 0.7rem;
    font-family: 'Nunito', sans-serif;
    margin-top: 4px;
    letter-spacing: 0;
}

/* Room code display */
.shooter-room-code-display {
    background: #16213e;
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 100%;
    margin-bottom: 16px;
    box-shadow: 4px 4px 0px #000;
}

.shooter-room-code-display .code-label {
    color: #aaa;
    font-size: 0.8rem;
    font-family: 'Nunito', sans-serif;
    margin-bottom: 6px;
}

.shooter-room-code-display .code-value {
    font-size: 3rem;
    color: #FFD700;
    letter-spacing: 8px;
    text-shadow: 2px 2px 0px #FF4500;
}

.shooter-waiting-msg {
    color: #aaa;
    font-size: 0.85rem;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    margin-bottom: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Join room input */
.shooter-join-form {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.shooter-code-input {
    flex: 1;
    background: #16213e;
    border: 2px solid #555;
    border-radius: 8px;
    color: #eee;
    font-size: 1.2rem;
    padding: 10px 12px;
    font-family: 'Bangers', cursive;
    letter-spacing: 4px;
    text-transform: uppercase;
    outline: none;
    text-align: center;
}

.shooter-code-input:focus {
    border-color: #FFD700;
}

.shooter-join-btn {
    background: #FF4500;
    color: white;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 10px 16px;
    font-family: 'Bangers', cursive;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
    white-space: nowrap;
}

/* Solo play button */
.shooter-solo-btn {
    background: #4CAF50;
    color: white;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 12px 28px;
    font-family: 'Bangers', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 3px 3px 0px #000;
    letter-spacing: 1px;
    margin-bottom: 8px;
    transition: transform 0.1s;
    width: 100%;
}

.shooter-solo-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000;
}

/* Game container */
#game-container {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
}

#game-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Back button */
.shooter-back-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 0;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    width: 100%;
    margin-top: 8px;
}

/* Error message */
.shooter-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

/* ── Fixed HTML control bar — landscape thumb zones ─────────────────── */
#shooter-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    z-index: 999;
    pointer-events: none;
    background: transparent;
}

/* Left thumb zone: 30% width, joystick */
.thumb-zone-left {
    pointer-events: all;
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    touch-action: none;
}

/* Right thumb zone: 30% width, action buttons */
.thumb-zone-right {
    pointer-events: all;
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-container {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.joystick-track {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    touch-action: none;
    box-shadow: 0 0 16px rgba(0,0,0,0.4);
    opacity: 0.5;
}

.joystick-knob {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255,255,255,0.6);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: none;
    pointer-events: none;
    opacity: 0.7;
}

/* ── Action buttons ── */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.action-row-top, .action-row-bottom {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
    border: 3px solid rgba(255,255,255,0.25);
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    line-height: 1.1;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.85;
}

.btn-bomb {
    background: radial-gradient(circle at 35% 35%, #ff9800, #e65100);
    box-shadow: 0 5px 0 #bf360c, 0 0 18px rgba(255,152,0,0.4);
    color: white;
    font-size: 1.2rem;
}

.btn-bomb.cooldown {
    background: radial-gradient(circle at 35% 35%, #555, #333);
    box-shadow: 0 5px 0 #111;
    color: #888;
}

#bomb-cooldown-label {
    font-size: 0.7rem;
    font-family: 'Bangers', cursive;
    display: block;
    margin-top: 2px;
}

.btn-fire {
    background: radial-gradient(circle at 35% 35%, #ef5350, #b71c1c);
    box-shadow: 0 5px 0 #7f0000, 0 0 18px rgba(239,83,80,0.35);
    color: white;
    font-size: 1rem;
}

.action-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.5);
    opacity: 1;
}

/* ── Portrait orientation overlay ── */
#portrait-overlay {
    position: fixed;
    inset: 0;
    background: #1a1a2e;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.portrait-overlay-inner {
    text-align: center;
    animation: rotateHint 2s ease-in-out infinite;
}

.portrait-rotate-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.portrait-rotate-text {
    color: #FFD700;
    font-family: 'Bangers', cursive;
    font-size: 1.6rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #FF4500;
    line-height: 1.4;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-15deg); }
    70% { transform: rotate(15deg); }
}

.portrait-back-btn {
    margin-top: 32px;
    background: transparent;
    border: 2px solid #888;
    color: #aaa;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: border-color 0.2s, color 0.2s;
}
.portrait-back-btn:active {
    border-color: #FFD700;
    color: #FFD700;
}

/* Landscape: game container fills screen */
@media (orientation: landscape) {
    #game-container {
        position: fixed;
        inset: 0;
        z-index: 1;
    }
    #shooter-controls {
        height: 130px;
    }
}
