/*
    Hinweis: Die CSS Date wurde mit ChatGPT überarbeitet, damit
    - die Klassen nach den jeweiligen Abschnitten sortiert sind,
    - die Klassen zusammengefasst wurden und
    - unbenutzte Elemente entfernt wurden.
*/


/*
    Farben und Grundwerte
*/

:root {
    --bg-dark: #0d2c54;
    --bg-mid: #1d3757;

    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-hover: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-border-strong: rgba(255, 255, 255, 0.65);

    --panel-dark: rgba(0, 0, 0, 0.35);
    --panel-soft: rgba(255, 255, 255, 0.1);

    --text-main: white;
    --text-soft: rgba(255, 255, 255, 0.8);
    --text-dark: #0a1f33;

    --accent-blue: #39d9ff;
    --accent-red: #ff3b3b;
    --accent-green: #2ecc71;
    --accent-yellow: #ffdc00;

    --radius-small: 10px;
    --radius-medium: 12px;
    --radius-panel: 18px;
    --radius-pill: 60px;

    --transition-fast: 0.3s;
}

* {
    box-sizing: border-box;
}


/* =========================================================
   Tastatur-Fokus / Barrierefreiheit
   Verwendet: alle Seiten
========================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent-yellow);
    outline-offset: 4px;
}

label {
    display: block;
    margin-bottom: 8px;

    font-weight: bold;
}


/* =========================================================
   body
   Verwendet:
   body_all: index.php, join.php, options.php, wiki.php,
             impressum.php, datenschutz.php, restore_player.php,
             archivements_statistik.php, bedienungshilfe.php
   body_lobby: lobby.php
========================================================= */

.body_all,
.body_lobby {
    margin: 0;

    font-family: Arial, sans-serif;
}

.body_all {
    overflow: hidden;
}

.body_lobby {
    min-height: 100vh;

    color: var(--text-main);

    background:
            radial-gradient(circle at 50% 20%, rgba(57, 217, 255, 0.14), transparent 30%),
            linear-gradient(180deg, var(--bg-mid), var(--bg-dark));

    overflow: hidden;
}


/* =========================================================
   canvas
   Verwendet: alle Seiten mit wellen
========================================================= */

canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
}


/* =========================================================
   Overlay
   Verwendet:
   overlay: index.php, archivements_statistik.php
   overlay_scrollen: join.php, options.php, wiki.php,
                     impressum.php, datenschutz.php,
                     restore_player.php, bedienungshilfe.php
========================================================= */

.overlay,
.overlay_scrollen {
    position: fixed;
    inset: 0;
    z-index: 10;

    overflow-y: auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding-top: 20px;
    padding-bottom: 40px;

    color: var(--text-main);

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.overlay::-webkit-scrollbar,
.overlay_scrollen::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   Logo und Titel
   Verwendet: partials/logo_header.php
========================================================= */

.logo_mit_title {
    position: relative;
    z-index: 20;

    width: min(900px, 95vw);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    margin-top: 20px;
    margin-bottom: 40px;

    text-align: center;
}

.logo_link {
    display: block;

    text-decoration: none;
}

.logo {
    width: 300px;
    height: 300px;

    object-fit: contain;

    transition: var(--transition-fast);
}

.logo_link:hover .logo {
    transform: scale(1.04);
}

.title_gesamt {
    display: flex;
    flex-direction: column;

    line-height: 1;
}

.title_01 {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 2px;
}

.title_02 {
    color: var(--accent-red);
    font-size: 35px;
    font-weight: bold;
    letter-spacing: 3px;
}


/* =========================================================
   Glas-Panel
   Verwendet: options.php, restore_player.php, join.php,
              wiki.php, impressum.php, datenschutz.php,
              bedienungshilfe.php, lobby.php
========================================================= */

.glass_panel {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-panel);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(5px);
}


/* =========================================================
   Text-Panel
   Verwendet: impressum.php, datenschutz.php,
              bedienungshilfe.php, archivements_statistik.php
========================================================= */

.text_panel {
    width: min(700px, 90vw);

    margin-top: 20px;
    padding: 34px 42px 38px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;

    text-align: center;
    z-index: 20;
}

.text_panel h1,
.text_panel h2,
.text_panel p {
    margin: 0;
}

.text_panel h2 {
    margin-top: 14px;

    color: var(--accent-blue);
}

.text_panel section {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.text_panel section:not(:last-of-type) {
    margin-bottom: 12px;
}


/* =========================================================
   alter Textblock
   Verwendet: falls alte Platzhalterseiten ihn noch nutzen
========================================================= */

.text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    font-size: 32px;
    font-weight: bold;
    letter-spacing: 2px;
}


/* =========================================================
   Buttons-Grid
   Verwendet: index.php und einfache Button-Gruppen
========================================================= */

.buttons_grid {
    display: grid;
    row-gap: 40px;
    column-gap: 20px;

    margin-top: 40px;
    margin-bottom: 40px;

    justify-items: center;
}

.buttons_grid_eins {
    grid-template-columns: 1fr;
    width: min(800px, 90vw);
}

.buttons_grid_zwei {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    width: min(500px, 90vw);
}

.buttons_grid_drei {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    width: min(800px, 90vw);
}


/* =========================================================
   Standart-Button und Formulare
   Verwendet: fast alle Seiten
========================================================= */

.button_standart,
.input_standart,
.select_standart {
    width: 100%;
    max-width: 220px;
    min-width: 150px;
    height: 55px;

    color: var(--text-main);
    font-size: clamp(14px, 2vw, 18px);
    text-align: center;

    background: var(--glass-bg);
    border: 2px solid white;
    border-radius: var(--radius-pill);

    transition: var(--transition-fast);
}

.button_standart {
    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0 16px;

    text-decoration: none;
}

.button_abstand_oben {
    margin-top: 20px;
}

.input_standart,
.select_standart {
    padding: 0 16px;

    outline: none;
    backdrop-filter: blur(5px);
}

.select_standart {
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.button_standart:hover {
    color: var(--text-dark);
    background: white;
    transform: scale(1.05);
}

.input_standart:hover,
.input_standart:focus,
.select_standart:hover,
.select_standart:focus {
    background: var(--glass-bg-hover);
    border-color: white;
}

.input_standart::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.select_standart option {
    color: white;
    background: #1d4f91;
}


/* =========================================================
   Wetterbox
   Verwendet: options.php, lobby.php
========================================================= */

.weather_box {
    position: relative;
    z-index: 20;

    max-width: min(260px, 90vw);
    margin-bottom: 20px;
    padding: 8px 12px;

    color: var(--text-main);
    font-size: clamp(20px, 1.4vw, 24px);
    line-height: 1.2;
    text-align: center;
    white-space: normal;

    background: var(--glass-bg);
    border: 2px solid white;
    border-radius: 50px;

    backdrop-filter: blur(5px);
}

.body_lobby .weather_box {
    position: fixed;
    top: 34px;
    left: 30px;
    right: auto;
    z-index: 100;

    margin: 0;
}


/* =========================================================
   Optionen und Spieler Wiederherstellen
   Verwendet: options.php, restore_player.php
========================================================= */

.option_overlay {
    width: min(420px, 90vw);

    margin-top: 20px;
    padding: 30px;

    text-align: center;
}

.option_overlay form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.option_overlay hr {
    width: 100%;
    margin: 24px 0;

    border: none;
    border-top: 1px solid var(--glass-border);
}

.option_buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    margin-top: 20px;
}

code {
    display: block;

    margin-top: 10px;
    padding: 10px;

    background: var(--panel-dark);
    border-radius: var(--radius-small);

    word-break: break-all;
}


/* =========================================================
   join
   Verwendet: join.php
========================================================= */

.join_menu {
    width: min(480px, 90vw);

    margin-top: 20px;
    padding: 34px 42px 38px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;

    text-align: center;
    z-index: 20;
}

.join_menu h1,
.join_menu h2 {
    margin: 0;

    font-size: 32px;
}

.join_menu form {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.join_menu .input_standart,
.join_menu .button_standart {
    max-width: 330px;
}


/* =========================================================
   wiki
   Verwendet: wiki.php
========================================================= */

.wiki_panel {
    width: min(950px, 90vw);

    margin-top: 20px;
    padding: 40px 45px;

    position: relative;
    z-index: 20;
}

.wiki_intro {
    width: 100%;

    margin-top: 0;
    margin-bottom: 40px;

    text-align: center;
}

.wiki_intro h1 {
    margin-bottom: 12px;
}

.wiki_arrow {
    margin: 30px 0 60px;

    font-size: 80px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

.wiki_content {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 70px;
}

.wiki_section {
    min-height: 180px;

    text-align: center;
}

.wiki_section h2 {
    margin-bottom: 14px;

    color: var(--accent-blue);
}

.wiki_section h3 {
    margin-top: 24px;
    margin-bottom: 8px;
}

.wiki_section p {
    max-width: 760px;

    margin: 10px auto;

    line-height: 1.5;
}

.wiki_back_button {
    width: 100%;

    display: flex;
    justify-content: center;

    margin-top: 70px;
}


/* =========================================================
   footer
   Verwendet:
   partials/footer_fixed.php
   partials/footer_scroll.php
========================================================= */

.footer {
    width: 100%;

    color: var(--text-main);
    text-align: center;
    z-index: 20;
}

.footer_fest {
    position: fixed;
    bottom: 10px;
}

.footer_scroll {
    position: relative;

    margin-top: 40px;
    margin-bottom: 40px;
}

.footer a {
    color: var(--text-main);
    font-size: 14px;
    text-decoration: none;
    opacity: 0.8;
}

.footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer_trenner {
    margin: 0 8px;

    opacity: 0.6;
}


/* =========================================================
   Lobby-Grundlayout
   Verwendet: lobby.php
========================================================= */

.game-layout {
    width: 100vw;
    height: 100vh;

    display: grid;
    grid-template-columns: 270px 1fr 330px;
    gap: 18px;

    padding: 120px 20px 145px;
}

.players-panel {
    align-self: start;

    padding: 18px;
    margin-top: 55px;
}

.control-panel {
    max-height: calc(100vh - 115px);

    padding: 18px;

    overflow-y: auto;
}

.players-panel h2,
.control-panel h2 {
    margin-top: 0;

    color: var(--accent-blue);
    text-align: center;
}


/* =========================================================
   Lobby- Status und Popups
   Verwendet: lobby.php
========================================================= */

.event-popup {
    position: fixed;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;

    padding: 18px 28px;

    color: var(--accent-yellow);
    font-size: 22px;
    font-weight: bold;
    text-align: center;

    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 220, 0, 0.8);
    border-radius: var(--radius-panel);

    box-shadow: 0 0 30px rgba(255, 220, 0, 0.35);
    animation: popupFade 3s ease forwards;
}

@keyframes popupFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.top-status {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;

    min-width: 360px;
    padding: 14px 24px;

    text-align: center;
}

.status-title {
    color: var(--accent-blue);
    font-size: 20px;
    font-weight: bold;
}

.status-text {
    margin-top: 5px;

    color: var(--text-main);
    font-size: 15px;
}

.status-subtext {
    margin-top: 4px;

    color: var(--accent-yellow);
    font-size: 13px;
}


/* =========================================================
   Lobby-Spielerliste
   Verwendet: lobby.php
========================================================= */

.player-slot,
.panel_lobby_code,
.ship-card,
.selected-info,
.status-box {
    border-radius: var(--radius-medium);
}

.player-slot,
.panel_lobby_code {
    background: var(--panel-soft);
}

.player-slot {
    margin: 10px 0;
    padding: 12px;

    font-size: 15px;
}

.ready,
.not-ready {
    float: right;

    font-weight: bold;
}

.ready {
    color: var(--accent-green);
}

.not-ready {
    color: var(--accent-yellow);
}

.empty {
    opacity: 0.5;
}

.remaining-ships {
    margin-top: 6px;

    color: var(--accent-blue);
    font-size: 12px;
    opacity: 0.95;
}

.panel_lobby_code {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 14px 16px;

    color: var(--text-main);

    border: 1px solid var(--glass-border);
}

.panel_lobby_code span {
    display: block;

    margin-bottom: 6px;

    color: var(--text-soft);
    font-size: 13px;
}

.panel_lobby_code strong {
    display: block;

    color: #e8fbff;
    font-size: 30px;
    letter-spacing: 4px;
}

.message {
    margin-top: 12px;

    color: var(--accent-yellow);
    font-weight: bold;
}


/* =========================================================
   Lobby-Spielfeld
   Verwendet: lobby.php
========================================================= */

.center-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

.board-wrapper {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 26px 1fr;

    width: min(64vh, 660px);
    height: min(64vh, 660px);
}

.col-labels {
    grid-column: 2;
    grid-row: 1;

    display: grid;
    grid-template-columns: repeat(30, 1fr);
}

.row-labels {
    grid-column: 1;
    grid-row: 2;

    display: grid;
    grid-template-rows: repeat(30, 1fr);
    align-items: center;
}

.col-labels,
.row-labels {
    color: #d8f7ff;
    font-size: 11px;
    text-align: center;
}

.battlefield {
    grid-column: 2;
    grid-row: 2;

    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-template-rows: repeat(30, 1fr);

    background: rgba(13, 44, 84, 0.82);
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.55);
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-main);
    font-size: 10px;
    text-decoration: none;

    background: rgba(255, 255, 255, 0.025);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.cell:hover {
    background: var(--glass-bg-hover);
}

.cell:nth-child(30n) {
    border-right: none;
}

.quad-right {
    border-right: 4px solid var(--glass-border-strong);
}

.quad-bottom {
    border-bottom: 4px solid var(--glass-border-strong);
}

.my-ship-cell {
    background: rgba(46, 204, 113, 0.45);
    box-shadow: inset 0 0 8px rgba(46, 204, 113, 0.9);
}

.shot-hit {
    background: rgba(255, 65, 54, 0.6);
    box-shadow: inset 0 0 10px rgba(255, 65, 54, 0.9);
}

.shot-miss {
    background: rgba(255, 255, 255, 0.14);
}

.blocked-own-area {
    opacity: 0.45;
}

.ship-marker,
.shot-marker {
    font-size: 10px;
    pointer-events: none;
}


/* =========================================================
   Lobby: Buttons und Aktionen
   Verwendet: lobby.php
========================================================= */

.ready-button,
.control-button,
.action-button,
.turn-button,
.leave_lobby_button {
    width: 100%;
    min-height: 48px;

    font-weight: bold;
    text-align: center;

    border-radius: var(--radius-pill);

    transition: var(--transition-fast);
}

.ready-button,
.turn-button {
    border: 2px solid white;
    cursor: pointer;
}

.control-button,
.action-button,
.leave_lobby_button {
    color: var(--text-main);

    background: var(--glass-bg);
    border: 2px solid var(--glass-border-strong);
    text-decoration: none;
}

.action-button,
.leave_lobby_button {
    cursor: pointer;
}

.ready-button {
    padding: 16px;
    margin-bottom: 12px;

    color: var(--text-main);
    font-size: 23px;

    background: rgba(46, 204, 113, 0.65);
}

.ready-button.is-ready {
    background: rgba(255, 59, 59, 0.75);
}

.ready-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;

    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.control-button,
.action-button {
    display: block;

    margin: 6px 0;
    padding: 11px;

    font-size: 14px;
}

.control-button {
    opacity: 0.55;
}

.action-button:hover,
.leave_lobby_button:hover {
    color: var(--text-dark);
    background: white;
    transform: scale(1.03);
}

.action-button.active {
    color: white;

    background: rgba(255, 59, 59, 0.85);
    border-color: white;
}

.turn-button {
    margin: 6px 0;
    padding: 13px;

    color: var(--text-dark);
    font-size: 15px;

    background: rgba(255, 220, 0, 0.85);
}

.turn-button:hover,
.ready-button:hover {
    transform: scale(1.03);
}

.leave_lobby_button {
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 18px;
    padding: 10px 14px;

    font-size: 15px;
}


/* =========================================================
   Lobby: Infos und Schiffe
   Verwendet: lobby.php
========================================================= */

.status-box,
.selected-info,
.ship-card {
    background: var(--panel-dark);
}

.status-box {
    margin-top: 10px;
    padding: 10px;

    color: var(--accent-green);
    font-weight: bold;
    text-align: center;
}

.selected-info {
    margin-bottom: 10px;
    padding: 8px;

    color: var(--accent-yellow);
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}

.ships-box {
    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.ships-box h3 {
    margin: 0 0 8px;

    color: var(--accent-blue);
    text-align: center;
}

.ship-card {
    margin: 7px 0;
    padding: 8px;

    border: 1px solid rgba(255, 255, 255, 0.28);

    font-size: 13px;
}

.ship-card strong {
    display: block;

    font-size: 14px;
}

.ship-card a {
    color: var(--accent-blue);
    font-size: 12px;
    text-decoration: none;
}

.ship-card a:hover {
    text-decoration: underline;
}

.placed,
.not-placed {
    font-weight: bold;
}

.placed {
    color: var(--accent-green);
}

.not-placed {
    color: var(--accent-yellow);
}


/* =========================================================
   Lobby: untere Schiffsleiste
   Verwendet: lobby.php
========================================================= */

.bottom-ships-bar {
    position: fixed;
    left: 310px;
    right: 370px;
    bottom: 18px;
    z-index: 45;

    display: flex;
    justify-content: center;
    gap: 10px;

    padding: 10px;

    overflow-x: auto;
}

.bottom-ship-card {
    min-width: 95px;
    padding: 8px 10px;

    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-medium);

    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

.bottom-ship-card strong {
    display: block;

    color: var(--text-main);
    font-size: 13px;
}

.bottom-ship-card span {
    color: var(--accent-green);
    font-weight: bold;
}

.bottom-ship-card.sunk {
    opacity: 0.45;

    border-color: rgba(255, 65, 54, 0.55);
}

.bottom-ship-card.sunk span {
    color: #ff4136;
}


/* =========================================================
   Media
   Verwendet: alle Seiten
========================================================= */

@media (max-height: 800px) and (min-width: 1101px) {
    .game-layout {
        padding-top: 95px;
        padding-bottom: 110px;
    }

    .players-panel {
        margin-top: 25px;
    }

    .board-wrapper {
        width: min(60vh, 620px);
        height: min(60vh, 620px);
    }

    .control-panel {
        max-height: calc(100vh - 95px);
    }

    .bottom-ships-bar {
        bottom: 10px;
    }
}

@media (max-width: 1100px), (max-height: 680px) {
    body {
        overflow: auto;
    }

    .body_lobby {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .game-layout {
        width: 100%;
        height: auto;
        min-height: 100vh;

        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 28px;

        padding: 110px 20px 40px;
    }

    .body_lobby .weather_box {
        position: relative;
        top: auto;
        left: auto;

        margin: 20px auto 0;
    }

    .top-status {
        position: relative;
        top: auto;
        left: auto;
        transform: none;

        width: min(520px, 90vw);
        min-width: 0;

        margin: 15px auto 0;
    }

    .players-panel,
    .control-panel {
        width: min(520px, 90vw);
        max-height: none;

        margin-top: 0;
    }

    .players-panel {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
    }

    .center-area {
        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;
    }

    .board-wrapper {
        width: min(90vw, 620px);
        height: auto;

        aspect-ratio: 1 / 1;
    }

    .bottom-ships-bar {
        position: static;

        width: min(700px, 90vw);

        flex-wrap: wrap;

        margin: 0 auto 20px;
    }
}

@media (max-width: 700px) {
    .buttons_grid_drei,
    .buttons_grid_zwei {
        grid-template-columns: 1fr;
    }

    .logo_mit_title {
        flex-direction: column;
        gap: 8px;

        margin-bottom: 28px;
    }

    .join_menu {
        padding: 28px 26px 32px;
    }

    .wiki_panel,
    .text_panel {
        padding: 32px 24px;
    }

    .wiki_arrow {
        font-size: 55px;
    }
}

@media (max-width: 450px) {
    .logo {
        width: 80px;
        height: 80px;
    }

    .title_01 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .title_02 {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .logo_mit_title {
        gap: 5px;

        margin-bottom: 28px;
    }

    .footer_fest {
        bottom: 8px;
    }

    .footer a,
    .footer_trenner {
        font-size: 10px;
    }
}