/* ============================================================
   KÖLSCH-KANONENSCHLACHT — style.css
   Comicartiges, fröhliches Design
   Scoped unter #game-container für Integration
   ============================================================ */

/* ---- Game Overlay Container ---- */
#game-container.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: #1a2a0a url('assets/hinter1.png') center center / cover no-repeat;
    font-family: 'Georgia', 'Comic Sans MS', cursive, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0;
    margin: 0;
    color: #fff8d0;
}

#game-container.game-overlay.hidden {
    display: none;
}

/* Schließen-Button */
#game-close-btn {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 10010;
    font-size: 36px;
    color: #ff4444;
    background: rgba(0,0,0,0.6);
    border: 2px solid #ff4444;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

#game-close-btn:hover {
    background: #ff4444;
    color: #fff;
    transform: scale(1.1);
}

/* ---- App-Wrapper ---- */
#game-container #app {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
}

/* ==============================
   HUD
   ============================== */
#hud {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2d4a10, #1a2e08);
    border: 2px solid #72aa20;
    border-radius: 6px;
    padding: 4px 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.65);
}

.hud-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.hud-side.right {
    flex-direction: row-reverse;
}

.hud-name {
    font-size: 13px;
    font-weight: bold;
    color: #d4ff40;
    text-shadow: 1px 1px 3px #000;
    letter-spacing: 1px;
    white-space: nowrap;
}

.hud-player-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 70px;
}

.hud-side.right .hud-player-info {
    align-items: flex-end;
}

/* Glasreihe als Icons */
.glasses-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
}

.glass-icon {
    font-size: 28px;
    line-height: 1;
    transition: transform 0.25s ease, opacity 0.25s ease;
    cursor: default;
}

.glass-icon.broken {
    opacity: 0.2;
    transform: rotate(90deg) scale(0.8);
    filter: grayscale(1);
}

.hud-count {
    font-size: 11px;
    color: #a8e030;
}

/* Fire-Button (verwendet im Eingabe-Panel) */
.fire-btn {
    background: linear-gradient(to bottom, #cc3300, #881500);
    color: #fff8d0;
    border: 2px solid #ff6620;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 3px #000;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.fire-btn:hover:not(:disabled) {
    background: linear-gradient(to bottom, #ff4400, #aa2000);
    transform: scale(1.05);
}

.fire-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mitte */
#hud-center {
    text-align: center;
    flex: 0 0 auto;
    padding: 0 8px;
}

#hud-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 3px;
}

#hud-buttons button {
    padding: 3px 10px;
    font-size: 11px;
    font-family: 'Georgia', serif;
    cursor: pointer;
    border-radius: 6px;
    text-shadow: 1px 1px 2px #000;
    transition: all 0.15s ease;
}

#hud-buttons #reset-btn {
    background: linear-gradient(to bottom, #3a6010, #1e3808);
    color: #d4ff40;
    border: 2px solid #72aa20;
}

#hud-buttons #settings-btn {
    background: linear-gradient(to bottom, #4a6818, #2a3e0a);
    color: #d4ff40;
    border: 2px solid #72aa20;
}

#hud-buttons button:hover {
    transform: scale(1.05);
}

#turn-text {
    font-size: 16px;
    font-weight: bold;
    color: #fff060;
    text-shadow: 0 0 14px #ffcc00, 1px 1px 4px #000;
}

#phase-text {
    font-size: 10px;
    color: #90bb50;
    margin-top: 2px;
}

/* ==============================
   Canvas
   ============================== */
#gameCanvas {
    border: none;
    border-radius: 0;
    display: block;
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    cursor: crosshair;
}

/* ==============================
   Steuerleiste
   ============================== */
#controls {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: linear-gradient(135deg, #2d4a10, #1a2e08);
    border: 2px solid #72aa20;
    border-radius: 6px;
    padding: 8px 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.65);
}

.ctrl-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ctrl-group label {
    font-size: 13px;
    color: #c8f060;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.ctrl-group input[type="range"] {
    width: 180px;
    accent-color: #aadd30;
    cursor: pointer;
    height: 6px;
    border-radius: 3px;
}

#fire-btn {
    background: linear-gradient(to bottom, #cc3300, #881500);
    color: #fff8d0;
    border: 3px solid #ff6620;
    border-radius: 8px;
    padding: 12px 36px;
    font-size: 17px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    transition: all 0.15s ease;
}

#fire-btn:hover:not(:disabled) {
    background: linear-gradient(to bottom, #ff4400, #aa2000);
    box-shadow: 0 0 16px rgba(255, 130, 0, 0.55);
    transform: scale(1.06);
}

#fire-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#reset-btn {
    background: linear-gradient(to bottom, #3a6010, #1e3808);
    color: #d4ff40;
    border: 3px solid #72aa20;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-family: 'Georgia', serif;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 4px 12px rgba(0,0,0,.5);
    transition: all 0.15s ease;
}

#reset-btn:hover {
    background: linear-gradient(to bottom, #4e7c18, #2a4e0e);
    transform: scale(1.04);
}

/* ==============================
   Gewinner-Overlay
   ============================== */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: 10px;
}

#overlay.hidden {
    display: none;
}

.overlay-box {
    background: linear-gradient(160deg, #2d4a10, #0f1e06);
    border: 4px solid #aadd30;
    border-radius: 18px;
    padding: 50px 70px;
    text-align: center;
    box-shadow: 0 0 80px rgba(180, 255, 50, 0.30),
                inset 0 0 30px rgba(0,0,0,.5);
}

#overlay-title {
    font-size: 54px;
    text-shadow: 0 0 30px #ffcc00;
    margin-bottom: 14px;
}

#overlay-msg {
    font-size: 22px;
    color: #f0ff80;
    margin-bottom: 34px;
    line-height: 1.5;
}

#overlay-restart {
    background: linear-gradient(to bottom, #5a8818, #2e4e0a);
    color: #d4ff40;
    border: 3px solid #aadd30;
    border-radius: 10px;
    padding: 14px 46px;
    font-size: 18px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px #000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    transition: all 0.2s ease;
}

#overlay-restart:hover {
    box-shadow: 0 0 22px rgba(180,255,50,.5);
    transform: scale(1.07);
}

/* ==============================
   Einstellungen-Button
   ============================== */
#settings-btn {
    background: linear-gradient(to bottom, #4a6818, #2a3e0a);
    color: #d4ff40;
    border: 2px solid #72aa20;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    font-family: 'Georgia', serif;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    transition: all 0.15s ease;
}

#settings-btn:hover {
    background: linear-gradient(to bottom, #5a8020, #3a5010);
    transform: scale(1.04);
}

/* ==============================
   Einstellungen-Overlay
   ============================== */
#settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
}

#settings-overlay.hidden {
    display: none;
}

.settings-box {
    min-width: 360px;
}

.settings-title {
    font-size: 28px;
    font-weight: bold;
    color: #d4ff40;
    text-shadow: 0 0 20px #ffcc00;
    margin-bottom: 24px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.setting-row label {
    font-size: 15px;
    color: #c8f060;
    font-weight: bold;
    min-width: 170px;
    text-shadow: 1px 1px 2px #000;
}

.setting-row input[type="range"] {
    width: 140px;
    accent-color: #aadd30;
    cursor: pointer;
}

.setting-row select {
    width: 140px;
    padding: 6px 8px;
    font-size: 14px;
    font-family: 'Georgia', serif;
    color: #fff060;
    background: #1a2e08;
    border: 2px solid #72aa20;
    border-radius: 6px;
    cursor: pointer;
}

.setting-row select:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(170, 221, 48, 0.45);
}

.setting-row span {
    font-size: 16px;
    color: #fff060;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.setting-hint {
    font-size: 12px;
    color: #88aa44;
    margin-bottom: 24px;
    text-align: center;
}

#settings-save {
    background: linear-gradient(to bottom, #5a8818, #2e4e0a);
    color: #d4ff40;
    border: 3px solid #aadd30;
    border-radius: 10px;
    padding: 12px 40px;
    font-size: 17px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 3px #000;
    transition: all 0.15s ease;
}

#settings-save:hover {
    box-shadow: 0 0 18px rgba(180,255,50,.5);
    transform: scale(1.05);
}

/* ==============================
   Eingabe-Panel
   ============================== */
#input-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    background: transparent;
    z-index: 50;
    justify-content: center;
    pointer-events: none;
}

.input-panel-box {
    pointer-events: auto;
}

#input-panel.align-left {
    justify-content: flex-start;
    padding-left: 40px;
}

#input-panel.align-right {
    justify-content: flex-end;
    padding-right: 40px;
}

#input-panel.hidden {
    display: none;
}

.input-panel-box {
    background: linear-gradient(160deg, #2d4a10, #0f1e06);
    border: 3px solid #72aa20;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.input-panel-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff060;
    text-shadow: 0 0 14px #ffcc00, 1px 1px 4px #000;
    margin-bottom: 4px;
}

/* Anzeige-Felder */
.input-display-row {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.input-field-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.input-field-group label {
    font-size: 13px;
    color: #c8f060;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.input-display {
    width: 90px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    font-size: 24px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    color: #fff060;
    background: #1a2e08;
    border: 2px solid #72aa20;
    border-radius: 8px;
}

.input-display.active {
    border-color: #aadd30;
    box-shadow: 0 0 12px rgba(170, 221, 48, 0.6);
}

.input-display.dimmed {
    opacity: 0.4;
}

.input-display.done {
    opacity: 1;
    border-color: #558820;
}

/* Nummernblock */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}

.numpad-btn {
    padding: 12px 0;
    font-size: 20px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    color: #fff8d0;
    background: linear-gradient(to bottom, #3a5c14, #1e3808);
    border: 2px solid #5a8820;
    border-radius: 8px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    transition: all 0.1s ease;
}

.numpad-btn:hover {
    background: linear-gradient(to bottom, #4a7020, #2a4e0e);
    transform: scale(1.05);
}

.numpad-btn:active {
    transform: scale(0.95);
}

.numpad-del {
    color: #ff8844;
    border-color: #aa5520;
}

.numpad-ok {
    color: #80ff40;
    border-color: #44aa20;
    background: linear-gradient(to bottom, #2a6010, #143008);
}

/* Feuer-Button volle Breite */
.numpad-fire {
    width: 100%;
    padding: 12px 0;
    font-size: 20px;
    margin-top: 4px;
}

/* ==============================
   Ziel-Timer-Anzeige
   ============================== */
#aim-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.7), 2px 2px 4px #000;
    z-index: 30;
    pointer-events: none;
}

#aim-timer.hidden {
    display: none;
}
