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

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    position: relative;
    background-image: url('SchiffeVersenken.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #0a1f2e;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: rgba(30, 20, 15, 0.88);
    backdrop-filter: blur(4px);
    border-radius: 60px;
    padding: 25px;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(201, 168, 123, 0.5);
    max-width: 1400px;
    width: 100%;
    position: relative;
    z-index: 1;
}

h1 {
    font-family: 'Pirata One', cursive;
    font-size: 2.8rem;
    text-align: center;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #f3c26b, #d4a373);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

footer {
    text-align: center;
    color: #c9a87b;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* ==================== RESET-INFO ==================== */
.reset-info {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 30px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid rgba(201, 168, 123, 0.5);
}

.reset-date {
    color: #ffecb3;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-badge {
    background: linear-gradient(135deg, #c9a87b, #b87c4a);
    color: #2c1d12;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
}

.reset-countdown {
    color: #ffb347;
    font-weight: bold;
    font-size: 1.2rem;
    font-family: monospace;
}

/* ==================== LOGIN CONTAINER ==================== */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.login-box {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 40px;
    padding: 25px;
    border: 1px solid rgba(201, 168, 123, 0.5);
    backdrop-filter: blur(2px);
}

.login-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #c9a87b;
}

.login-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #c9a87b, #b87c4a);
    padding: 8px;
    border-radius: 20px;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffecb3;
    font-family: 'Pirata One', cursive;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    color: #c9a87b;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.input-field {
    width: 100%;
    padding: 12px 18px;
    background: rgba(44, 36, 26, 0.95);
    border: 1px solid #c9a87b;
    border-radius: 30px;
    color: #ffecb3;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #ffb347;
    box-shadow: 0 0 0 3px rgba(255, 180, 70, 0.3);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #c9a87b, #b87c4a);
    border: none;
    border-radius: 30px;
    color: #2c1d12;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.register-btn {
    background: linear-gradient(135deg, #4a9e6b, #2a6e4a);
    color: white;
}

/* ==================== HIGHSCORE BOX ==================== */
.highscore-box {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 40px;
    padding: 25px;
    border: 1px solid rgba(201, 168, 123, 0.5);
    backdrop-filter: blur(2px);
    overflow-x: auto;
}

.highscore-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #c9a87b;
}

.highscore-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #f59e0b, #f472b6);
    padding: 8px;
    border-radius: 20px;
}

.highscore-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffb347;
    font-family: 'Pirata One', cursive;
}

/* ==================== HIGHSCORE TABELLE ==================== */
.highscore-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffecb3;
    font-size: 0.9rem;
    border: 1px solid #c9a87b;
    border-radius: 12px;
    overflow: hidden;
}

.highscore-table th {
    text-align: center;
    padding: 10px 8px;
    background: rgba(201, 168, 123, 0.2);
    font-weight: 600;
    color: #ffb347;
    border: 1px solid #c9a87b;
    font-size: 0.9rem;
}

.highscore-table td {
    padding: 8px 8px;
    border: 1px solid rgba(201, 168, 123, 0.3);
    font-size: 0.9rem;
}

.highscore-table tr:hover {
    background: rgba(255, 180, 70, 0.2);
}

.rank-1-row td:first-child {
    color: gold;
    font-weight: bold;
}

.rank-2-row td:first-child {
    color: silver;
    font-weight: bold;
}

.rank-3-row td:first-child {
    color: #cd7f32;
    font-weight: bold;
}

.timestamp-col {
    color: #c9a87b;
    white-space: nowrap;
    font-size: 0.8rem;
}

.no-highscore {
    text-align: center;
    color: #c9a87b;
    padding: 30px;
    font-size: 0.9rem;
}

/* ==================== SPIELBEREICH ==================== */
.game-section {
    display: none;
}

.game-section.active {
    display: block;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 40px;
    padding: 12px 20px;
    border: 1px solid rgba(201, 168, 123, 0.5);
}

.welcome-text {
    color: #ffecb3;
    font-size: 1rem;
}

.welcome-name {
    color: #ffb347;
    font-weight: bold;
    font-size: 1.2rem;
}

.logout-btn {
    background: linear-gradient(135deg, #c94f2c, #a03a1a);
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ==================== PLATZIERUNGSBEREICH ==================== */
.placement-section {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 40px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(201, 168, 123, 0.5);
}

.placement-section h3 {
    color: #ffb347;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-family: 'Pirata One', cursive;
}

.ships-to-place {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ship-card {
    background: linear-gradient(145deg, #2c241a, #1e1812);
    padding: 8px 16px;
    border-radius: 30px;
    border: 2px solid #c9a87b;
    transition: 0.2s;
}

.ship-card.selected {
    border-color: #ffb347;
    background: #3e2a1f;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 180, 70, 0.5);
}

.ship-card.placed {
    opacity: 0.5;
    text-decoration: line-through;
    border-color: #6b5a42;
}

.ship-name {
    font-weight: bold;
    color: #ffecb3;
    font-size: 0.9rem;
}

.ship-length {
    font-size: 0.7rem;
    color: #c9a87b;
}

.placement-controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.orientation-btn {
    background: #2c241a;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid #c9a87b;
    transition: 0.2s;
    color: #ffecb3;
    font-weight: bold;
}

.orientation-btn.active {
    background: #ffb347;
    color: #1e1812;
    border-color: #ffb347;
}

.placement-board-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.placement-hint {
    font-size: 11px;
    margin-top: 12px;
    color: #c9a87b;
}

/* ==================== SPIELBRETTER ==================== */
.board-card {
    background: linear-gradient(145deg, #2c241a, #1e1812);
    border-radius: 28px;
    padding: 15px;
    box-shadow: 15px 15px 25px rgba(0, 0, 0, 0.5);
}

.board-title {
    text-align: center;
    margin-bottom: 12px;
    font-family: 'Pirata One', cursive;
    font-size: 1.1rem;
    color: #ffecb3;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, 42px);
    grid-template-rows: repeat(10, 42px);
    gap: 2px;
    background: #8b5a2b;
    padding: 8px;
    border-radius: 16px;
    background-image: repeating-linear-gradient(45deg, #a06e3a 0px, #a06e3a 2px, #8b5a2b 2px, #8b5a2b 8px);
}

.cell {
    background: linear-gradient(145deg, #2c6e8f, #1e4a62);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.1s;
    font-size: 18px;
    position: relative;
}

.cell.placement-hover {
    background: #ffb347;
    box-shadow: 0 0 10px rgba(255, 180, 70, 0.8);
    transform: scale(1.02);
}

.own-board .cell.ship {
    background: linear-gradient(135deg, #c9a87b, #a06e3a);
}

.own-board .cell.ship::before {
    content: '⛵';
    font-size: 16px;
    opacity: 0.7;
}

.cell.hit, .enemy-board .cell.ship-hit {
    background: radial-gradient(circle at 30% 30%, #ff6a3a, #c73d1a);
    animation: explosion 0.3s ease-out;
}

.cell.hit::after, .enemy-board .cell.ship-hit::after {
    content: '💥';
    position: absolute;
    font-size: 22px;
}

.cell.miss {
    background: linear-gradient(135deg, #2f7a8a, #1e5e6e);
    animation: missSplash 0.3s ease-out;
}

.cell.miss::before {
    content: '💧';
    position: absolute;
    font-size: 16px;
}

@keyframes explosion {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes missSplash {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: #3f8a9a; }
    100% { transform: scale(1); }
}

.hit-animation {
    animation: hitPulse 0.3s ease-out;
}

@keyframes hitPulse {
    0% {
        transform: scale(1);
        background: radial-gradient(circle at 30% 30%, #ff6a3a, #c73d1a);
    }
    50% {
        transform: scale(1.15);
        background: radial-gradient(circle at 30% 30%, #ff8a5a, #e75d2a);
        box-shadow: 0 0 20px rgba(255, 100, 50, 0.9);
    }
    100% {
        transform: scale(1);
        background: radial-gradient(circle at 30% 30%, #ff6a3a, #c73d1a);
    }
}

/* ==================== INFO PANEL ==================== */
.info-panel {
    background: linear-gradient(135deg, #2c241a, #1e1812);
    border-radius: 60px;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.status {
    background: #010d14;
    padding: 8px 20px;
    border-radius: 40px;
    color: #ffecb3;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    min-width: 250px;
    transition: all 0.3s ease;
    animation: statusPulse 1s ease;
}

@keyframes statusPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); background: #1a2a35; }
    100% { transform: scale(1); }
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px;
    border-radius: 40px;
    color: #ffecb3;
}

.turn-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 1s infinite;
}

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

.stats {
    display: flex;
    gap: 15px;
    color: #ffecb3;
    font-size: 0.9rem;
}

.stats span {
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 20px;
}

.info-panel button {
    background: linear-gradient(135deg, #c9a87b, #b87c4a);
    border: none;
    font-weight: bold;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    color: #2c1d12;
}

.info-panel button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ready-btn {
    background: linear-gradient(135deg, #4a9e6b, #2a6e4a);
    color: white;
    font-size: 1rem;
    padding: 10px 25px;
    margin-top: 20px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
}

.ready-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

.boards-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

/* ==================== SCHWIERIGKEITSGRAD-MODAL ==================== */
.difficulty-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.difficulty-modal {
    background: linear-gradient(135deg, #2c241a, #1e1812);
    border-radius: 40px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    border: 2px solid #c9a87b;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.difficulty-modal h2 {
    text-align: center;
    color: #ffb347;
    font-family: 'Pirata One', cursive;
    font-size: 2rem;
    margin-bottom: 30px;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.difficulty-option {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.difficulty-option.selected {
    background: rgba(255, 180, 70, 0.2);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 180, 70, 0.5);
}

.difficulty-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Pirata One', cursive;
}

.difficulty-multiplier {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffecb3;
}

.difficulty-desc {
    font-size: 0.85rem;
    color: #c9a87b;
    margin-bottom: 10px;
}

.difficulty-stats {
    font-size: 0.8rem;
    color: #ffb347;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 10px;
}

.difficulty-confirm {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #c9a87b, #b87c4a);
    border: none;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c1d12;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== HINT-SYSTEM ==================== */
.hint-system {
    margin-top: 15px;
    animation: slideDown 0.5s ease;
}

.hint-box {
    background: linear-gradient(135deg, #2c6e8f, #1e4a62);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #ffb347;
}

.hint-icon {
    font-size: 1.2rem;
}

.hint-text {
    color: #ffecb3;
    font-size: 0.9rem;
    flex: 1;
}

.hint-counter {
    background: #ffb347;
    color: #2c1d12;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .board {
        grid-template-columns: repeat(10, 35px);
        grid-template-rows: repeat(10, 35px);
    }
    .cell { font-size: 16px; }
    h1 { font-size: 2rem; }
    .login-container {
        grid-template-columns: 1fr;
    }
    .highscore-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 600px) {
    .board {
        grid-template-columns: repeat(10, 28px);
        grid-template-rows: repeat(10, 28px);
    }
    .cell { font-size: 14px; }
    .container {
        padding: 15px;
    }
    .reset-info {
        flex-direction: column;
        text-align: center;
    }
    .highscore-table th, .highscore-table td {
        padding: 5px;
        font-size: 0.7rem;
    }
}

/* Schnellboot-Spezial */
.ship-length {
    font-size: 0.7rem;
    color: #c9a87b;
}

.ship-card .ship-length {
    font-size: 0.9rem;
    font-weight: bold;
}

/* Animation für Schnellboote */
.ship-card:has(.ship-length:contains('⚡')) {
    border-color: #ffb347;
    animation: quickBoat 1s ease infinite;
}

@keyframes quickBoat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 5px rgba(255, 180, 70, 0.5); }
}

@import url('https://fonts.googleapis.com/css2?family=Pirata+One&family=Roboto:wght@400;700&display=swap');