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

:root {
    --er-category-gap: 0.75rem;
    --bg-color: #f0f2f5;
    --text-color: #212529;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --primary-color: #0d6efd;
    --primary-text-color: #ffffff;
    --border-color: #dee2e6;
    --icon-filter: invert(0);
}

[data-bs-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --primary-color: #2684ff;
    --primary-text-color: #ffffff;
    --border-color: #444;
    --icon-filter: invert(1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

.navbar-brand {
    font-family: 'Baloo 2', 'Poppins', sans-serif;
    font-weight: 700;
    color: #0b2541;
    font-size: 1.6rem;
}

[data-bs-theme="dark"] .navbar-brand {
    color: var(--text-color);
}

.navbar-brand img {
    /* The filter is removed to prevent the logo from being inverted in dark mode. */
}

.game-card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.game-card:not(.disabled):hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .game-card:not(.disabled):hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.game-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(80%);
}

/* @tweakable The styles for the "New" badge on game cards. */
.new-badge {
    position: absolute;
    top: 10px;
    right: -30px;
    background-color: #dc3545;
    color: white;
    padding: 4px 30px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 2;
}

.game-card-content {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.game-icon {
    width: 60px;
    height: 60px;
    margin-right: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
    /* The filter is removed to prevent game icons from being inverted in dark mode. */
    color: #a0a0a0;
}

.game-text .card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.game-text .card-text {
    color: #6c757d;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .game-text .card-text {
    color: #a0a0a0;
}

/* Game Instructions Section */
/* @tweakable The background color for the game instructions card. */
.game-instructions .card {
    background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
}

/* @tweakable The color of the button to toggle game instructions. */
.game-instructions .instruction-toggle-btn {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: block;
    padding: 0.75rem 1.25rem;
}

.game-instructions .instruction-toggle-btn:hover {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.game-instructions .instruction-toggle-btn .instruction-arrow {
    transition: transform 0.2s ease-in-out;
}

/* @tweakable The transform style for the arrow when the instructions are open. */
.game-instructions .instruction-toggle-btn[aria-expanded="true"] .instruction-arrow {
    transform: rotate(90deg);
}

/* @tweakable The color of the text within the game instructions area. */
.game-instructions .card-body {
    color: var(--text-color);
}

/* @tweakable The color of headings within the game instructions. */
.game-instructions .card-body h5 {
    color: var(--primary-color);
}

.sr-only-if-js {
    /* This class can be used on elements that should be visually hidden by JS, but available without it. */
}

/* Städteraten Styles */
#sr-found-list {
    /* @tweakable Maximum height of the found cities list. Use 'vh' or 'px'. */
    max-height: 50vh;
    overflow-y: auto;
}

#sr-found-list .list-group-item {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* @tweakable Style for the most recently found cities to make them stand out. */
#sr-found-list .list-group-item.sr-recent {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

/* License Plate Styling */
.license-plate {
    /* @tweakable The background color of the license plate. */
    background-color: #fff;
    /* @tweakable The border of the license plate. */
    border: 2px solid #000;
    /* @tweakable The border radius of the license plate. */
    border-radius: 8px;
    display: flex;
    font-family: 'Fira Sans', sans-serif; /* A font similar to FE-Schrift */
    font-weight: bold;
    color: #000;
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    overflow: hidden;
}

.plate-blue {
    /* @tweakable The background color of the EU part of the license plate. */
    background-color: #003399;
    color: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.plate-eu-stars {
    /* This can be enhanced with an actual SVG for stars later */
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3ccircle cx='12' cy='12' r='10' fill='%23FFCC00'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.plate-country {
    font-size: 1.5rem;
    font-weight: bold;
}

.plate-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    font-size: 2.5rem;
    padding: 10px;
    letter-spacing: 0.1em;
}

[data-bs-theme="dark"] .license-plate {
    border-color: #555;
    background-color: #f0f0f0;
}

/* Game Screen */
.game-screen .card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.category-badge {
    display: inline-block;
    padding: 0.5em 1em;
    border-radius: 50px; 
    background-color: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0; /* Hide by default, show with transition */
    transition: opacity 0.3s, background-color 0.3s, color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-badge.visible {
    opacity: 1;
}

/* Emoji Ratespiel Category Selection */
.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--er-category-gap);
}

.category-selector .btn {
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.category-selector .btn-check:checked+.btn::before,
.toggle-check-group .btn-check:checked+.btn::before {
    font-family: "Font Awesome 6 Free";
    content: "\f00c\00a0"; /* fa-check icon and a non-breaking space */
    font-weight: 900;
}

/* @tweakable Styling for the emoji suggestion form rows */
.suggestion-row {
    position: relative;
    border: 1px solid var(--border-color) !important;
}

/* @tweakable The maximum height of the suggestion modal's dialog, which helps ensure it fits on various screen sizes. Use vh units, e.g., '90vh'. */
#suggestion-modal .modal-dialog {
    max-height: 90vh;
}

.emoji-picker-container {
    position: relative;
    z-index: 10;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

[data-bs-theme="dark"] .category-badge {
    background-color: color-mix(in srgb, var(--primary-color) 30%, transparent);
    color: var(--primary-color);
}

/* Such & Finde new styles */
.player-list .player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: color-mix(in srgb, var(--card-bg) 50%, var(--bg-color) 50%);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

#suf-round-presets .btn {
    flex-grow: 1;
}

#suf-player-scorers .btn {
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.scoreboard .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 0.25rem;
}
.scoreboard .list-group-item:first-child {
    font-weight: bold;
    font-size: 1.3rem;
    color: #b8860b; /* Gold */
}
[data-bs-theme="dark"] .scoreboard .list-group-item:first-child {
    color: #ffd700; /* Brighter Gold */
}

/* @tweakable Styles for the score display on the final scoreboard. */
.scoreboard .scoreboard-score {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-text-color);
    background-color: var(--primary-color);
    padding: 0.4em 0.9em;
    border-radius: 50px;
    min-width: 45px;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
}

/* @tweakable Styles for the winner's score on the final scoreboard. */
.scoreboard .list-group-item:first-child .scoreboard-score {
    background-color: #b8860b; /* Gold for light mode */
    color: white;
}

[data-bs-theme="dark"] .scoreboard .list-group-item:first-child .scoreboard-score {
    background-color: #ffd700; /* Brighter gold for dark mode */
    color: #212529; /* Dark text for contrast */
}

.game-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

#fj-color-box {
    width: 100%;
}

#task-text, #fj-task-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--primary-text-color);
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 90%, black);
}

footer {
    font-size: 0.9rem;
}

footer .footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

footer .footer-nav a {
    text-decoration: none;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.2s;
}

footer .footer-nav a:hover {
    opacity: 1;
}

.footer-nav .admin-link {
    display: none; /* Hide by default, JS will show if logged in */
    color: #c82333; /* Ein Rot mit gutem Kontrast im hellen Modus */
    font-weight: 600;
}

[data-bs-theme="dark"] .footer-nav .admin-link {
    color: #ff5c5c; /* Ein hellereres Rot für den dunklen Modus */
}

.legal-text p, .legal-text h3, .legal-text h4 {
    margin-bottom: 1rem;
}
.legal-text a {
    color: var(--primary-color);
    text-decoration: none;
}
.legal-text a:hover {
    text-decoration: underline;
}