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

/* Make base font slightly smaller for compact layout */
html, body {
    font-size: 13px;
}

body {
    font-family: 'PressStartLocal', 'Courier New', 'Lucida Console', Monaco, monospace;
    margin: 0;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 800px at 50% 0%, #12122b 0%, #0b0b1a 40%, #06060f 100%);
}

/* Scene wrapper centering game; pseudo-element holds arcade art */
.scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
}

.gameWrap {
    position: relative;
    z-index: 1; /* above arcade art */
}

.scene::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    background-image: url("assets/arkada-small.gif");
    background-repeat: no-repeat;
    background-size: 1240px auto; /* tune artwork size */
    background-position: center center;
}
/* Global snow overlay covering viewport, not blocking interactions */
#snowOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 11000; /* above artwork but below promo badge */
}

/* Floating promo badge on the left */
#promoBadge {
    position: fixed;
    left: 16px;
    top: 50%;
    width: 300px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(18,18,18,0.85));
    color: #ffcc00;
    border: 2px solid #ffcc00;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 0 18px rgba(255, 204, 0, 0.45);
    z-index: 12000;
    animation: promoFloat 6s ease-in-out infinite;
    font-size: 0.9em;
    line-height: 1.4;
}

#promoBadge strong { color: #ffffff; text-shadow: 0 0 6px rgba(255,255,255,0.5); }

@keyframes promoFloat {
    0% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(calc(-50% - 6px)) translateX(8px); }
    100% { transform: translateY(-50%) translateX(0); }
}
:root {
    /* Scale whole game UI together: adjust this value to shrink/enlarge everything */
    --game-scale: 0.90; /* 1 = 100% (no scale), 0.8 = 80% */
    --game-base-width: 820px; /* base width used by .game-container */
}
.game-arcade {
    margin-top: 0px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
}

.game-container {
    /* Width-based scaling: visual width = base-width * scale. This avoids
       non-uniform shrinking caused by transform on the entire container. */
    width: calc(var(--game-base-width) * var(--game-scale));
    max-width: calc(var(--game-base-width) * var(--game-scale));

    background: #000;
    border: 6px solid #ffcc00;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.45), inset 0 0 12px rgba(255, 204, 0, 0.18);
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 1.4em;
    color: #ffcc00;
    text-shadow: 
        3px 3px 0 #ff0000,
        -1px -1px 0 #00ff00,
        2px 2px 10px rgba(255, 204, 0, 0.8);
    letter-spacing: 3px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 3px 3px 0 #ff0000, -1px -1px 0 #00ff00, 2px 2px 10px rgba(255, 204, 0, 0.8); }
    to { text-shadow: 3px 3px 0 #00ff00, -1px -1px 0 #ff0000, 2px 2px 20px rgba(255, 204, 0, 1); }
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    padding: 6px 10px;
    border: 3px solid #ffcc00;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.info-row {
    display: flex;
    width: 100%;
    gap: 5px;
}

.info-row-top {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    padding: 4px 5px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 3px;
}

/* Druhý řádek: flex s různou šířkou */
.info-row-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

#powerupsInfo { flex: 1.25; }
#nickInfo { flex: 2.5; }
#countdownInfo { flex: 1; }
#logoutBtn { flex: 0 0 auto; align-self: stretch; }

.info-row-bottom .info-item {
    padding: 3px 5px;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}

/* Menší písmo na druhém řádku a jistota jednoho řádku */
.info-row-bottom .label {
    font-size: 0.48em;
    margin-right: 2px;
    white-space: nowrap;
}

.info-row-bottom .value {
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Logout button na druhém řádku napravo */
#logoutBtn {
    grid-row: 2;
    grid-column: 5 / 6;
    justify-self: center;
    padding: 4px 10px;
    background: #cc0000;
    border: 2px solid #ff6666;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.6em;
}

#logoutBtn:hover {
    background: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.label {
    color: #00ff00;
    font-weight: bold;
    font-size: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value {
    color: #ffcc00;
    font-weight: bold;
    font-size: 0.95em;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.9);
}

/* Delší nick v jednom řádku s oříznutím */
#playerNick {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Styl pro odpočet do konce hry */
#countdownInfo .value {
    color: #aaff66;
}

#gameCanvas {
    display: block;
    background: #1a1a2e;
    border: 3px solid #333;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.75);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: none; /* hide native cursor so only graphical crosshair is visible */
    max-width: 100%;
    width: 100%;
}

.controls {
    /* Place controls in normal flow below canvas */
    position: relative;
    text-align: center;
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(17,17,17,0.95);
    border: 2px solid #ffcc00;
    border-radius: 4px;
    z-index: 120; /* Nad puškou (9999) */
}

.controls p {
    color: #00ff00;
    font-size: 0.95em;
    font-weight: bold;
}

.targets-info {
    margin-top: 6px;
    font-size: 0.85em !important;
    color: #ffcc00 !important;
}

.targets-info .points {
    color: #00ff00;
    font-weight: bold;
}

.targets-info .penalty {
    color: #ff0000;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

/* Screen wrapper that contains canvas and pistol */
.screen-inner {
    position: relative;
    width: 100%;
    overflow: visible;
    z-index: 1;
}

/* Kontejner pro sprite obrázky - absolutně pozicovaný nad canvasem */
#spritesContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5; /* Pod puškou (100) a zaměřovačem (50) */
    overflow: hidden;
}

/* Ensure canvas and overlays are above the artwork */
.screen-inner > #gameCanvas {
    position: relative;
    z-index: 10;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    z-index: 9000; /* overlays always on top */
}

.overlay[style*="display: none"] {
    display: none !important;
}

.overlay:not([style*="display: none"]) {
    display: flex !important;
}

.overlay.active {
    display: flex !important;
}

.overlay-content {
    background: #000;
    border: 4px solid #ffcc00;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.7);
    min-width: 320px;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
}

.overlay-content h2 {
    color: #ffcc00;
    font-size: 1.6em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #ff0000;
}

.overlay-content p {
    color: #00ff00;
    font-size: 0.75em;
    margin: 10px 0;
}

.game-description {
    line-height: 1.6;
    margin: 20px 0 30px 0 !important;
}

.btn {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #fff;
    border: 3px solid #ffcc00;
    padding: 8px 18px;
    font-size: 0.95em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    margin: 6px;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #990000, 0 0 12px rgba(255, 204, 0, 0.45);
    transition: all 0.1s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #990000, 0 0 30px rgba(255, 204, 0, 0.8);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #990000, 0 0 10px rgba(255, 204, 0, 0.5);
}

.btn-large {
    font-size: 1.1em;
    padding: 12px 36px;
    animation: pulse 2s ease-in-out infinite;
}

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

#leaderboard-list {
    background: #111;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 12px;
    margin: 12px 0;
    max-height: 240px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin: 4px 0;
    background: #1a1a2e;
    border: 2px solid #ffcc00;
    border-radius: 3px;
}

.leaderboard-entry.top-3 {
    border-color: #ff0000;
    background: #2a0000;
}

.leaderboard-entry span:first-child {
    color: #00ff00;
}

/* Ammo empty flash */
.ammo-empty {
    color: #ff6666 !important;
    animation: ammoFlash 0.8s ease-in-out;
    transform: scale(1.06);
}

@keyframes ammoFlash {
    0% { text-shadow: 0 0 0 rgba(255,0,0,0); }
    30% { text-shadow: 0 0 12px rgba(255,80,80,0.9); }
    100% { text-shadow: 0 0 0 rgba(255,0,0,0); }
}

.leaderboard-entry span:last-child {
    color: #ffcc00;
    font-weight: bold;
    font-size: 0.95em;
}

/* Scrollbar styling */
#leaderboard-list::-webkit-scrollbar {
    width: 10px;
}

#leaderboard-list::-webkit-scrollbar-track {
    background: #000;
}

#leaderboard-list::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 5px;
}

#leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: #ff0000;
}

/* Nové styly */
.highlight {
    color: #ffcc00;
    font-weight: bold;
    font-size: 1.3em;
    text-shadow: 0 0 10px #ffcc00;
}

.btn-logout {
    background: linear-gradient(135deg, #666, #444);
    color: #fff;
    border: 2px solid #888;
    padding: 8px 15px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 3px;
    margin-left: 20px;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #888, #666);
}

.leaderboard-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid #00ff00;
    border-radius: 5px;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin: 4px 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    color: #00ff00;
    font-size: 1.0em;
}

.leaderboard-list .rank {
    color: #ffcc00;
    font-weight: bold;
    min-width: 40px;
}

.leaderboard-list .nick {
    flex: 1;
    margin: 0 15px;
}

.leaderboard-list .score {
    font-weight: bold;
}

/* Pixel / 8-bit style for UI text */
.game-container, .header, .game-info, .controls, .overlay-content, .btn, .value, .label {
    font-family: 'Courier New', 'Lucida Console', Monaco, monospace;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.85);
}

/* Slight pixelated look for large title */
.header h1 {
    image-rendering: pixelated;
}

/* Local pixel font (load from assets/fonts). Place a .woff2 or .ttf in assets/fonts */
@font-face {
    font-family: 'PressStartLocal';
    /* Using the uploaded font file name (case-sensitive in some hosts).
       If you rename the file to press-start-2p.woff2, you can add the .woff2 source here. */
    src: url('assets/fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Apply the pixel font where appropriate */
.use-pixel-font, .game-container, .header, .game-info, .controls, .overlay-content, .btn, .value, .label {
    font-family: 'PressStartLocal', 'Courier New', 'Lucida Console', Monaco, monospace;
}
