/* ==================================================
   NETWORK PORT SHOOTOUT - Retro Arcade CSS Stylesheet
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Teko:wght@700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: #0F141C;
    color: #FFFFFF;
    font-family: 'Impact', 'Teko', 'Trebuchet MS', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

/* App Container */
#gameContainer {
    position: relative;
    width: 1200px;
    height: 750px;
    background: #000;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 204, 0, 0.2);
    border: 4px solid #4A321A;
    border-radius: 8px;
    overflow: hidden;
}

canvas {
    display: block;
    width: 1200px;
    height: 750px;
    cursor: none; /* Crosshair rendered on canvas */
}

/* Sound Toggle Button Top Bar */
.top-bar-controls {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 100;
}

.arcade-sm-btn {
    background: linear-gradient(180deg, #4A321A 0%, #2A1B0E 100%);
    border: 2px solid #D4A359;
    color: #FFD700;
    font-family: 'Impact', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.1s, filter 0.1s;
}

.arcade-sm-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.04);
}

/* HUD Overlay Elements */
.hud-panel {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

/* Top Left Box */
#hudTopLeft {
    top: 15px;
    left: 20px;
    background: rgba(18, 14, 8, 0.85);
    border: 3px solid #D4A359;
    border-radius: 6px;
    padding: 10px 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    min-width: 180px;
}

.hud-stat-title {
    font-size: 20px;
    color: #D4A359;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
}

.hud-stat-val {
    font-size: 24px;
    color: #39FF14;
    text-shadow: 2px 2px 0 #000;
    font-family: 'Press Start 2P', monospace;
}

/* Top Center Header Sign */
#hudTopCenter {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.wooden-header-sign {
    background: linear-gradient(180deg, #7A532C 0%, #4A3018 100%);
    border: 4px solid #2A1B0E;
    border-radius: 8px;
    padding: 10px 40px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.7), inset 0 0 10px rgba(0,0,0,0.4);
    position: relative;
}

.wooden-header-sign h1 {
    font-size: 38px;
    color: #FFF4D0;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 2px;
}

.wooden-header-sign .sub-banner {
    background: #1A120B;
    border: 2px solid #D4A359;
    color: #FFD700;
    font-size: 18px;
    padding: 4px 16px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
    text-shadow: 1px 1px 0 #000;
}

/* Top Right Box */
#hudTopRight {
    top: 15px;
    right: 20px;
    background: rgba(18, 14, 8, 0.85);
    border: 3px solid #D4A359;
    border-radius: 6px;
    padding: 10px 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    min-width: 190px;
    text-align: right;
}

.duck-icon-row {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    gap: 3px;
}

.duck-icon {
    font-size: 16px;
    filter: grayscale(100%) opacity(0.3);
}

.duck-icon.hit {
    filter: grayscale(0%) opacity(1.0);
}

/* Bottom Controls Legend */
#hudBottomLeft {
    bottom: 25px;
    left: 20px;
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid #666;
    border-radius: 6px;
    padding: 8px 16px;
    color: #DDD;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-keys {
    font-family: monospace;
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #888;
    color: #FFF;
    font-weight: bold;
}

/* Bottom Right Wooden Sign */
#hudBottomRight {
    bottom: 25px;
    right: 20px;
    background: #4A3018;
    border: 2px solid #2A1B0E;
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
    color: #D4A359;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 1.3;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* Full Screen Overlays (Start, Countdown, Results, Game Over) */
.full-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 8, 4, 0.92);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

/* Title Screen Styling */
.title-box {
    background: linear-gradient(180deg, #59391D 0%, #301E0F 100%);
    border: 6px solid #D4A359;
    border-radius: 12px;
    padding: 35px 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    max-width: 750px;
}

.game-title {
    font-size: 54px;
    color: #FFD700;
    text-shadow: 4px 4px 0 #000, -2px -2px 0 #3E240C;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 22px;
    color: #FFF;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0 #000;
}

.instructions-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8B6535;
    border-radius: 8px;
    padding: 18px 25px;
    margin-bottom: 30px;
    font-size: 18px;
    line-height: 1.6;
    color: #E2D0B5;
    text-align: left;
}

.instructions-box highlight {
    color: #39FF14;
    font-weight: bold;
}

/* Primary Arcade Button */
.arcade-btn {
    background: linear-gradient(180deg, #39FF14 0%, #159900 100%);
    border: 4px solid #FFFFFF;
    color: #000;
    font-family: 'Impact', sans-serif;
    font-size: 30px;
    letter-spacing: 2px;
    padding: 14px 45px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(57, 255, 20, 0.4), 0 4px 0 #0B4F00;
    transition: transform 0.1s, filter 0.1s;
    margin: 8px;
}

.arcade-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.arcade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0B4F00;
}

.arcade-btn.secondary {
    background: linear-gradient(180deg, #FF9900 0%, #CC5500 100%);
    box-shadow: 0 6px 15px rgba(255, 153, 0, 0.4), 0 4px 0 #662A00;
}

/* Countdown Overlay */
#countdownScreen {
    background: rgba(10, 8, 4, 0.85);
}

.study-box {
    background: linear-gradient(180deg, #59391D 0%, #2A1A0D 100%);
    border: 5px solid #FFD700;
    border-radius: 12px;
    padding: 30px 60px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8);
    margin-bottom: 25px;
}

.study-service-title {
    font-size: 42px;
    color: #FFF;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 10px;
}

.study-port-number {
    font-size: 72px;
    color: #39FF14;
    text-shadow: 4px 4px 0 #000, 0 0 20px rgba(57, 255, 20, 0.5);
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 4px;
}

.countdown-number {
    font-size: 110px;
    color: #FFD700;
    text-shadow: 6px 6px 0 #000;
    font-family: 'Press Start 2P', monospace;
    margin-top: 15px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Results & End Screen Boxes */
.results-box {
    background: linear-gradient(180deg, #4A3018 0%, #22140A 100%);
    border: 5px solid #D4A359;
    border-radius: 12px;
    padding: 30px 50px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8);
    max-width: 650px;
    width: 90%;
}

.results-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
    text-align: left;
    background: rgba(0,0,0,0.4);
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #7A532C;
}

.stat-item {
    font-size: 20px;
    color: #DDD;
}

.stat-item span {
    color: #39FF14;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
}

.perfect-banner {
    font-size: 28px;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
    background: rgba(255, 215, 0, 0.15);
    border: 2px dashed #FFD700;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.missed-ports-box {
    background: rgba(20, 0, 0, 0.6);
    border: 2px solid #FF3131;
    border-radius: 6px;
    padding: 12px 20px;
    margin: 15px 0;
    text-align: left;
}

.missed-ports-box h3 {
    color: #FF3131;
    font-size: 18px;
    margin-bottom: 8px;
}

.missed-ports-box ul {
    list-style-type: square;
    margin-left: 20px;
    color: #FFCCCC;
    font-size: 16px;
    line-height: 1.4;
}
