/**
 * Critical Layout Fixes for Klick-Game
 * Addresses: page title width, background, footer, sidebar layout
 */

/* ===== BACKGROUND FIX - ALWAYS VISIBLE, STRETCHED ===== */
html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('/images/body-bg.jpg') !important;
    background-attachment: fixed !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-color: #2a2a2a !important;
}

/* ===== PAGE TITLE WIDTH FIX ===== */
.site-header {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Ensure main title matches content width */
.main-title-container {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* ===== FOOTER FIX ===== */
.site-footer {
    background: linear-gradient(135deg, #021B40 0%, #021530 50%, #021B40 100%) !important; /* Override other footer styles */
    border: 1px solid #ff6600;
    border-radius: 12px 12px 0 0;
    opacity: 0.95;
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 70rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.site-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer-content .fleft {
    color: #BAB3B4;
    font-size: 0.875rem;
}

.site-footer-url {
    color: #BAB3B4;
    font-size: 0.875rem;
}

.site-footer-url a {
    color: #ff6600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer-url a:hover {
    color: #ff9900;
}

/* ===== SIDEBAR LAYOUT FIX ===== */
.site-content {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
    grid-template-areas: "left main right";
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
    max-width: 70rem;
    padding: 0 1rem;
    min-height: calc(100vh - 20rem);
    align-items: start;
    box-sizing: border-box;
}

.site-content-left {
    grid-area: left;
    min-width: 0;
}

.site-content-main {
    grid-area: main;
    min-width: 0;
    max-width: 100%;
}

.site-content-right {
    grid-area: right;
    min-width: 0;
}

/* Ensure sidebars stay in position on desktop */
@media (min-width: 1201px) {
    .site-content-left,
    .site-content-right {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
        align-self: start;
    }
    
    /* Scrollbar styling */
    .site-content-left::-webkit-scrollbar,
    .site-content-right::-webkit-scrollbar {
        width: 0.375rem;
    }
    
    .site-content-left::-webkit-scrollbar-track,
    .site-content-right::-webkit-scrollbar-track {
        background: #2a2a2a;
    }
    
    .site-content-left::-webkit-scrollbar-thumb,
    .site-content-right::-webkit-scrollbar-thumb {
        background: #595959;
        border-radius: 0.1875rem;
    }
    
    .site-content-left::-webkit-scrollbar-thumb:hover,
    .site-content-right::-webkit-scrollbar-thumb:hover {
        background: #726B6C;
    }
}

/* ===== RESPONSIVE: TABLET AND MOBILE ===== */
@media (max-width: 1200px) {
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "left"
            "main"
            "right";
        gap: 1rem;
    }
    
    .site-content-left,
    .site-content-right {
        position: relative;
        width: 100%;
        max-width: 100%;
        max-height: none;
    }
    
    .site-content-main {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== HOME PAGE LOGIN SPACING FIX ===== */
.home-login-container {
    margin: 0 auto;
    max-width: 600px;
    padding: 0;
}

.home-login-container h3 {
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.home-login-container form {
    margin: 0;
}

/* Remove unnecessary spacing on home page - !important needed for inline style override */
.row[style*="margin-bottom: 1rem"] {
    margin-bottom: 0.5rem !important;
}

/* ===== NEWS BORDERS ON HOME PAGE ===== */
.news-item,
.news-container,
.home-news {
    border: 1px solid #ff6600;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(114, 107, 108, 0.1);
}

/* ===== STATUSBAR TEXT OVERFLOW FIX ===== */
.statusbar,
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.statusbar > div,
.status-bar > div {
    min-width: 0;
    flex: 0 0 auto;
}

.statusbar img,
.status-bar img {
    vertical-align: middle;
    margin-right: 0.25rem;
}

.statusbar span,
.status-bar span {
    display: inline-block;
    margin-right: 0.5rem;
}

/* Prevent "Bugs" text from overflowing */
.status-bugs,
.statusbar .bugs-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== CONTAINER CONSISTENCY ===== */
.container {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

@media (min-width: 1201px) {
    .container {
        max-width: 90%;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 92%;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 95%;
    }
}

/* ===== SIDEBAR LINE BREAKS FIX ===== */
.sidebar-items-left a,
.sidebar-items-right a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.sidebar-items-left img,
.sidebar-items-right img {
    flex-shrink: 0;
    vertical-align: middle;
}

.sidebar-num {
    display: inline;
    margin-left: auto;
}

/* Ensure icons and numbers stay on same line */
.sidebar-items-left div,
.sidebar-items-right div {
    display: flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
}

.sidebar-items-left div a,
.sidebar-items-right div a {
    flex: 1;
    min-width: 0;
}

/* ===== MOBILE FOOTER FIX ===== */
@media (max-width: 768px) {
    .site-footer {
        border-radius: 8px 8px 0 0;
        padding: 1rem;
    }
    
    .site-footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .site-footer-url {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* ===== WRAPPER FOR ENTIRE SITE ===== */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-wrapper .site-content {
    flex: 1;
}

.site-wrapper .site-footer {
    margin-top: auto;
}

/* ===== Z-INDEX MANAGEMENT ===== */
.site-header {
    z-index: 100;
}

.site-content {
    z-index: 10;
}

.site-footer {
    z-index: 50;
}
/**
 * Responsive Fixes für Klick-Game
 * Behebt Layout-Probleme und macht das Design vollständig responsive
 */

/* ===== GLOBAL RESPONSIVE FIXES ===== */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background-image: url('/images/body-bg.jpg');
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-color: #2a2a2a;
    color: #BAB3B4;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.site-content-main table {
    max-width: 100%;
}

/* Container - Relative sizes */
.container, 
.site-container {
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container,
    .site-container {
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .container,
    .site-container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .container,
    .site-container {
        max-width: 1170px;
    }
}

@media (min-width: 1400px) {
    .container,
    .site-container {
        max-width: 1320px;
    }
}

@media (max-width: 767px) {
    body {
        background-attachment: scroll;
    }

    .site-content-main table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== LAYOUT GRID SYSTEM ===== */

.site-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
        "main"
        "left"
        "right";
    gap: 1rem;
    width: 100%;
    min-height: calc(100vh - 20rem);
}

.site-content-left {
    grid-area: left;
}

.site-content-main {
    grid-area: main;
    min-width: 0;
}

.site-content-right {
    grid-area: right;
}

/* Desktop Layout - 3 Columns with sticky sidebars */
@media (min-width: 992px) {
    .site-content {
        grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
        grid-template-areas: "left main right";
        gap: 1.5rem;
    }
    
    /* Sticky sidebars on desktop */
    .site-content-left,
    .site-content-right {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        align-self: start;
    }
    
    /* Custom scrollbar for sidebars */
    .site-content-left::-webkit-scrollbar,
    .site-content-right::-webkit-scrollbar {
        width: 0.5rem;
    }
    
    .site-content-left::-webkit-scrollbar-track,
    .site-content-right::-webkit-scrollbar-track {
        background: #444;
    }
    
    .site-content-left::-webkit-scrollbar-thumb,
    .site-content-right::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 0.25rem;
    }
    
    .site-content-left::-webkit-scrollbar-thumb:hover,
    .site-content-right::-webkit-scrollbar-thumb:hover {
        background: #aaa;
    }
}

@media (min-width: 1200px) {
    .site-content {
        grid-template-columns: minmax(13rem, 16rem) 1fr minmax(13rem, 16rem);
    }
}

@media (min-width: 1400px) {
    .site-content {
        grid-template-columns: minmax(14rem, 18rem) 1fr minmax(14rem, 18rem);
    }
}

/* ===== FOOTER FIXES ===== */

.site-footer {
    width: 100%;
    max-width: 70rem;
    margin: 1.25rem auto 0;
    padding: 1rem;
    background: rgba(114, 107, 108, 0.8);
    border-top: 2px solid #ff6600;
}

/* ===== HIGHSCORE RESPONSIVE FIXES ===== */

.highscore-container {
    background: #726B6C;
    border: 2px solid #ff6600;
    border-radius: 0.5rem;
    margin: 1rem 0;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.highscore-header {
    background: linear-gradient(135deg, #726B6C 0%, #595959 100%);
    padding: 1rem;
    border-bottom: 2px dashed #328727;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 0.5rem;
    align-items: center;
    font-weight: bold;
    color: #FFFFFF;
    text-align: center;
}

.highscore-row {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #595959;
    transition: background-color 0.2s ease;
}

/* Mobile Highscore */
@media (max-width: 992px) {
    .highscore-header {
        display: none;
    }
    
    .highscore-row {
        grid-template-columns: 1fr;
        padding: 1rem;
        margin-bottom: 0.5rem;
        border: 2px solid #595959;
        border-radius: 0.5rem;
    }
    
    .highscore-col {
        text-align: left;
        padding: 0.25rem 0;
    }
    
    .highscore-col:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #E7E7E7;
        display: inline-block;
        min-width: 120px;
    }
    
    .highscore-col:first-child:before {
        content: "";
        display: none;
    }
}

/* ===== GEWINNSPIEL (RAFFLE) RESPONSIVE FIXES ===== */

.gewinn-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.gewinn-section {
    background: linear-gradient(135deg, #726B6C 0%, #595959 100%);
    border: 2px solid #ff6600;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.gewinn-title {
    color: #fff;
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #328727;
    font-weight: bold;
}

/* Mobile Gewinnspiel */
@media (max-width: 768px) {
    .gewinn-container {
        padding: 0.5rem;
    }
    
    .gewinn-section {
        padding: 1rem;
    }
    
    .gewinn-title {
        font-size: 1.125rem;
    }
    
    .gewinn-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== PINNWAND RESPONSIVE FIXES ===== */

.pinnwand-container {
    background: #726B6C;
    border: 2px solid #ff6600;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.pinnwand-header {
    background: linear-gradient(135deg, #726B6C 0%, #595959 100%);
    color: #FFFFFF;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px dashed #328727;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Mobile Pinnwand */
@media (max-width: 768px) {
    .pinnwand-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem;
    }
    
    .pinnwand-content {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .pinnwand-avatar {
        max-width: 60px;
        float: none;
        margin: 0 auto 0.5rem;
        display: block;
    }
}

/* ===== TYPOGRAPHY RESPONSIVE ===== */

h1, .kg-h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
}

h2, .kg-h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
}

h3, .kg-h3 {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
}

/* ===== BUTTONS RESPONSIVE ===== */

.btn,
.kg-btn,
button,
input[type="submit"],
input[type="button"] {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

@media (max-width: 767px) {
    .btn,
    .kg-btn,
    button,
    input[type="submit"],
    input[type="button"] {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ===== TABLES RESPONSIVE ===== */

.kg-table,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 767px) {
    .kg-table thead {
        display: none;
    }
    
    .kg-table,
    .kg-table tbody,
    .kg-table tr,
    .kg-table td {
        display: block;
        width: 100%;
    }
    
    .kg-table tr {
        margin-bottom: 1rem;
        border: 1px solid #595959;
        border-radius: 0.25rem;
    }
    
    .kg-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #595959;
    }
    
    .kg-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 0.75rem;
        font-weight: bold;
        text-align: left;
    }
}

/* ===== SIDEBAR FIXES ===== */

.sidebar {
    background-color: #021B40;
    border-radius: 0.3125rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

@media (min-width: 992px) {
    .sidebar {
        margin-bottom: 1rem;
    }
}

/* ===== AD CONTAINER FIXES ===== */

.ad-container {
    margin: 1rem auto;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 767px) {
    .ad-container {
        margin: 0.5rem auto;
    }
}

/* ===== IMAGES RESPONSIVE ===== */

img {
    max-width: 100%;
    height: auto;
}

/* ===== UTILITY CLASSES ===== */

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.d-block {
    display: block !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-flex {
    display: flex !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

/* Spacing utilities */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }

/* ===== PRINT STYLES ===== */

@media print {
    .sidebar,
    .ad-container,
    button,
    .btn,
    input[type="submit"],
    input[type="button"] {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
    }
}

/* ===== ACCESSIBILITY ===== */

/* Focus styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-main:focus {
    left: 0;
    top: 0;
    background: #ff6600;
    color: white;
    padding: 1rem;
    text-decoration: none;
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can add overrides here */
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/**
 * Comprehensive Design Fixes for Klick-Game
 * Version: 2.0
 * Author: Klick-Game Team
 * 
 * Diese CSS-Datei behebt alle kritischen Design-Probleme:
 * - Hintergrundbild korrekt anzeigen
 * - Spacing unter Login entfernen
 * - Footer weniger transparent, abgerundete Ecken
 * - Highscore Farbgebung anpassen
 * - Layout-Fixes (Sidebars bleiben oben, brechen nicht um)
 * - Alle festen Größen → relativ
 */

/* ============================================
   HINTERGRUNDBILD FIX - ALWAYS VISIBLE, STRETCHED
   ============================================ */
html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a !important;
    background-image: url('/images/body-bg.jpg') !important;
    background-attachment: fixed !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
}

/* Fallback wenn Bild nicht lädt */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    z-index: -2;
    pointer-events: none;
}

/* ============================================
   LOGIN SPACING FIX - Großes unnötiges Spacing entfernen
   ============================================ */
.login-container,
#login-section,
.home-login-section {
    margin-bottom: 0;
    padding-bottom: 0.25rem;
}

/* Unnötiges Spacing unter Login entfernen */
.login-container + div,
.login-container + br,
#login-section + div,
#login-section + br,
home.php .row:first-of-type {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0.5rem;
}

/* Home.php spezifische Login-Fixes */
.container > .row:first-child {
    margin-bottom: 0.5rem;
}

.container > .row h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Form row spacing fixes */
.form-row {
    margin-bottom: 0;
}

/* ============================================
   FOOTER FIXES - Weniger transparent + Leicht abgerundete Ecken
   ============================================ */
.site-footer,
footer,
.footer,
div[style*="background-color: #726B6C"]:last-child {
    background: linear-gradient(135deg, #021B40 0%, #031d45 50%, #021B40 100%) !important; /* Wie Sidebar - overrides other CSS files */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
    border-top: 2px solid #cc520d; /* Orange Border wie im Styleguide */
    border: 2px solid #cc520d;
    border-bottom: none;
}

.site-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: #fff;
    padding: 1rem;
}

.site-footer-url,
.site-footer-content .site-footer-url {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.site-footer a {
    color: #ff9900;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #ffb347;
    text-decoration: underline;
}

/* ============================================
   LAYOUT FIX - Grid System für Sidebars (Fix Umbruch)
   ============================================ */
.site-content {
    display: grid !important;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(12rem, 15rem) !important;
    grid-template-areas: "left main right" !important;
    gap: 1rem;
    max-width: 95rem;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 20rem);
    align-items: start; /* Wichtig: Verhindert Umbruch */
    width: 100%;
}

.site-content-left {
    grid-area: left;
    min-width: 0;
    width: 100%;
    overflow: visible;
}

.site-content-main {
    grid-area: main;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

.site-content-right {
    grid-area: right;
    min-width: 0;
    width: 100%;
    overflow: visible;
}

/* Sticky Sidebars nur auf Desktop */
@media (min-width: 1200px) {
    .site-content-left,
    .site-content-right {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
        align-self: start;
    }
    
    /* Custom scrollbar */
    .site-content-left::-webkit-scrollbar,
    .site-content-right::-webkit-scrollbar {
        width: 6px;
    }
    
    .site-content-left::-webkit-scrollbar-track,
    .site-content-right::-webkit-scrollbar-track {
        background: rgba(42, 42, 42, 0.5);
    }
    
    .site-content-left::-webkit-scrollbar-thumb,
    .site-content-right::-webkit-scrollbar-thumb {
        background: rgba(255, 102, 0, 0.5);
        border-radius: 3px;
    }
    
    .site-content-left::-webkit-scrollbar-thumb:hover,
    .site-content-right::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 102, 0, 0.7);
    }
}

/* ============================================
   HIGHSCORE FARBGEBUNG FIX - Anpassung an Styleguide
   ============================================ */
.highscore-container,
#highscore-table,
.highscore-wrapper,
.highscore-modern {
    background: linear-gradient(135deg, #726B6C 0%, #595959 100%);
    border: 2px solid #ff6600; /* Orange Border */
    border-radius: 8px;
    padding: 1.5rem;
    color: #BAB3B4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.highscore-container h1,
.highscore-container h2,
.highscore-wrapper h1,
.highscore-wrapper h2 {
    font-weight: bold;
    background: linear-gradient(135deg, #ff6600 0%, #ff9900 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 2px dashed #328727; /* Gestricheltes Grün */
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.highscore-table,
.highscore-table table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.highscore-table th {
    background: linear-gradient(90deg, #8B7D7D 0%, #726B6C 100%);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #ff6600;
}

.highscore-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #595959;
    color: #BAB3B4;
}

.highscore-table tr:hover {
    background: rgba(255, 102, 0, 0.1);
}

.highscore-table tr.highlight,
.highscore-table tr.current-user {
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.2) 0%, rgba(255, 153, 0, 0.1) 100%);
    border-left: 4px solid #ff6600;
    font-weight: bold;
}

/* Rank badges */
.highscore-rank,
.rank-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6600 0%, #ff9900 100%);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    min-width: 2rem;
    text-align: center;
}

/* Top 3 special styling */
.highscore-table tr:nth-child(1) .highscore-rank,
.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.highscore-table tr:nth-child(2) .highscore-rank,
.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #000;
}

.highscore-table tr:nth-child(3) .highscore-rank,
.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: #fff;
}

.highscore-table thead {
    background: linear-gradient(135deg, #726B6C 0%, #595959 100%);
}

.highscore-table thead th {
    color: #fff;
    padding: 0.75rem;
    border-bottom: 2px solid #ff6600;
    text-align: left;
}

.highscore-table tbody tr {
    background: rgba(114, 107, 108, 0.5);
    transition: background 0.3s ease;
}

.highscore-table tbody tr:hover {
    background: rgba(139, 125, 125, 0.7);
}

.highscore-table tbody tr.kg-highlight,
.highscore-table tbody tr.own-user {
    border-left: 4px solid #ff6600;
    background: rgba(255, 102, 0, 0.2);
}

.highscore-table tbody td {
    padding: 0.5rem 0.75rem;
    color: #BAB3B4;
    border-bottom: 1px solid #595959;
}

/* ============================================
   RELATIVE SIZES - Keine festen Pixel-Werte
   ============================================ */
/* Container */
.container,
.kg-container {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
}

/* Tabellen - !important needed to override inline width attributes */
table {
    width: 100% !important;
    max-width: 100% !important;
}

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"] {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    min-height: 2.5rem;
}

/* Inputs - !important needed to override inline width attributes */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.5rem;
    font-size: 1rem;
}

/* ============================================
   "BUGS" TEXT-ÜBERLAUF FIX
   ============================================ */
.sidebar-items-left div,
.sidebar-items-right div,
.menu-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-items-left div img,
.sidebar-items-right div img {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    margin: 0;
}

.sidebar-items-left a,
.sidebar-items-right a {
    display: inline;
    max-width: 100%;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-notification {
    display: inline;
    margin-left: auto;
}

/* Spezifischer Fix für "Bugs" Link */
a[href*="bugs"],
a[href*="Bugs"] {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: Sidebars unter Content */
@media (max-width: 992px) {
    .site-content {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "main"
            "left"
            "right" !important;
    }

    .site-content-left,
    .site-content-right {
        position: static;
        max-height: none;
    }
}

/* Mobile: Alles einspaltiger, größere Touch-Targets */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    .site-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .site-footer {
        padding: 0.75rem 1rem;
        border-radius: 6px 6px 0 0;
    }

    .site-footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Buttons Touch-optimiert */
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px; /* iOS/Android Empfehlung */
        font-size: 1.1rem;
    }
}

/* Sehr kleine Mobilgeräte */
@media (max-width: 480px) {
    body {
        font-size: 0.85rem;
    }

    .highscore-container h2,
    .highscore-wrapper h2 {
        font-size: 1.25rem;
    }

    .highscore-table thead th,
    .highscore-table tbody td {
        padding: 0.35rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white !important;
        background-image: none !important;
    }
    
    .site-content-left,
    .site-content-right,
    .site-footer {
        display: none !important;
    }
    
    .site-content {
        display: block !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
/* Focus States */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #ff6600;
    color: white;
    padding: 0.5rem 1rem;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: #000 !important;
    }

    .highscore-container,
    .kg-container {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   BUGS TEXT OVERFLOW FIX (Eingeloggt)
   ============================================ */
/* Fix für "Bugs" Text der in andere Felder überläuft */
.sidebar .bluebg,
.sidebar-items-left div,
.sidebar-items-right div,
.menu-div,
.sidebar-content {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Spezifischer Fix für Sidebar Links */
.sidebar-items-left a,
.sidebar-items-right a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Bug-Meldung Container */
.sidebar .bugs-container,
.sidebar [class*="bug"] {
    padding: 0.5rem;
    margin: 0.25rem 0;
    overflow: hidden;
}

/* Sidebar Text Wrapping */
.sidebar * {
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar table {
    table-layout: fixed;
    width: 100%;
}

.sidebar td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   GOOGLE ADS OPTIMIZATION
   ============================================ */
/* Ads Container mit besserer Platzierung */
.ad-container,
.google-ads,
[id*="google_ads"],
[class*="adsbygoogle"] {
    margin: 1.5rem auto;
    max-width: 100%;
    overflow: hidden;
    clear: both;
    display: block;
}

/* Ads nicht zwischen wichtigen Inhalten */
.ad-container + .ad-container {
    margin-top: 3rem;
}

/* Responsive Ads */
@media (max-width: 768px) {
    .ad-container,
    .google-ads {
        margin: 1rem auto;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-footer,
    .ad-container,
    .google-ads,
    .sidebar-items-left,
    .sidebar-items-right {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .site-content {
        grid-template-columns: 1fr !important;
        grid-template-areas: "main" !important;
    }
}
/**
 * Statusbar Design Fix
 * Fixes "Bugs" text overlap and improves layout
 */

.site-content-statusbar {
    margin: 0 0.5rem 1rem 0.5rem;
}

.site-content-statusbar-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    grid-template-rows: auto auto;
    color: #24BC06;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    border: 2px solid #328727;
    background: linear-gradient(135deg, #161616 0%, #1a1a1a 100%);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-content-statusbar-table > div {
    border: 1px solid #328727;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: rgba(22, 22, 22, 0.8);
    transition: background 0.2s ease;
}

.site-content-statusbar-table > div:hover {
    background: rgba(50, 135, 39, 0.1);
}

.site-content-statusbar-table-lvl {
    grid-column: 1;
}

.site-content-statusbar-table-money {
    grid-column: 2;
}

.site-content-statusbar-table-ges {
    grid-column: 3;
}

.site-content-statusbar-table-int {
    grid-column: 4;
}

.site-content-statusbar-table-ep {
    grid-column: 5;
}

.site-content-statusbar-table-work {
    grid-column: 6;
}

.site-content-statusbar-table-hp {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 2px solid #328727;
    background: linear-gradient(90deg, rgba(36, 188, 6, 0.1) 0%, rgba(50, 135, 39, 0.1) 100%);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .site-content-statusbar-table {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .site-content-statusbar-table-work {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .site-content-statusbar-table {
        grid-template-columns: repeat(2, 1fr);
        font-size: 0.7rem;
    }
    
    .site-content-statusbar-table > div {
        padding: 0.4rem;
    }
}

@media (max-width: 480px) {
    .site-content-statusbar-table {
        grid-template-columns: 1fr;
        font-size: 0.7rem;
    }
    
    .site-content-statusbar-table-work {
        grid-column: 1;
    }
}

/* Image Sizing */
.site-content-statusbar-table img {
    vertical-align: middle;
    max-width: 1rem;
    height: auto;
}

/* Link styling in statusbar */
.site-content-statusbar-table a {
    color: #24BC06;
    text-decoration: none;
    font-weight: bold;
}

.site-content-statusbar-table a:hover {
    color: #32A808;
    text-decoration: underline;
}
/**
 * Final Design Fixes for Klick-Game
 * Addresses all remaining design issues
 */

/* ============================================
   1. SIDEBAR LINEBREAKS FIX
   Icons and numbers on same line as links
   ============================================ */

.sidebar-items-left div,
.sidebar-items-right div {
    display: flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    white-space: nowrap;
}

.sidebar-items-left img,
.sidebar-items-right img {
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 0.3125rem;
}

.sidebar-items-left a,
.sidebar-items-right a {
    flex-grow: 1;
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
}

.sidebar-notification {
    margin-left: auto;
    padding-left: 0.3125rem;
    color: #FF7400;
    font-weight: bold;
    white-space: nowrap;
}

.event-badge {
    background-color: #FF7400;
    color: #000;
    border-radius: 0.625rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    margin-left: 0.3125rem;
}

/* ============================================
   2. BACKGROUND IMAGE FIXES
   Fixed background that stays visible and stretched
   ============================================ */

html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('/images/body-bg.jpg');
    background-attachment: fixed !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-color: #2a2a2a !important;
}

/* Ensure body background is always visible */
html {
    background-color: #2a2a2a;
}

/* ============================================
   3. TITLE WIDTH FIX
   Titles should match sidebar + content width
   ============================================ */

.page-title,
.site-header h1,
.main-title {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0.625rem 1rem;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* ============================================
   4. FOOTER STYLING
   Less transparent, rounded top corners
   ============================================ */

.site-footer {
    background: linear-gradient(135deg, #021B40 0%, #022554 100%) !important; /* Override other footer styles */
    border-top-left-radius: 0.625rem;
    border-top-right-radius: 0.625rem;
    border: 0.125rem solid #FF7400;
    border-bottom: none;
    opacity: 0.95;
    box-shadow: 0 -0.25rem 0.625rem rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 70rem;
    margin: 1.25rem auto 0;
    padding: 1rem;
    color: #fff;
}

.site-footer a {
    color: #FF7400;
    text-decoration: none;
}

.site-footer a:hover {
    color: #FFA040;
    text-decoration: underline;
}

/* ============================================
   5. NEWS BORDER ON HOMEPAGE
   ============================================ */

.news-item,
.news-container,
.homepage-news {
    border: 0.125rem solid #FF7400;
    border-radius: 0.3125rem;
    padding: 0.9375rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #021B40 0%, #022554 100%);
}

.news-title {
    color: #fff;
    background: linear-gradient(90deg, #fff 0%, #FF7400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    margin-bottom: 0.625rem;
}

/* ============================================
   6. BUGS TEXT FIX IN RIGHT SIDEBAR
   ============================================ */

.sidebar .menu-div:first-child {
    margin-top: 0;
}

.site-content-right .menu-div:first-child {
    margin-top: 0;
}

/* Ensure Bugs section doesn't overflow */
.sidebar-items-right.text-align-center div {
    text-align: center;
    padding: 0.625rem;
    overflow: hidden;
}

/* ============================================
   7. RESPONSIVE GRID LAYOUT FIX
   Ensure proper layout on all screen sizes
   ============================================ */

.site-content {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
    grid-template-areas: "left main right";
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
    max-width: 70rem;
    min-height: calc(100vh - 20rem);
    align-items: start;
    padding: 0;
    box-sizing: border-box;
}

/* Left sidebar */
.site-content-left {
    grid-area: left;
    min-width: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

/* Main content */
.site-content-main {
    grid-area: main;
    min-width: 0;
    max-width: 100%;
}

/* Right sidebar */
.site-content-right {
    grid-area: right;
    min-width: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

/* ============================================
   8. RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1200px) {
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "main"
            "left"
            "right";
        gap: 1rem;
    }
    
    .site-content-left,
    .site-content-right {
        position: relative;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .container,
    .site-content,
    .site-footer,
    .page-title {
        padding: 0 0.625rem;
    }
}

/* ============================================
   9. HOMEPAGE LOGIN SPACING FIX
   Remove unnecessary spacing below login
   ============================================ */

.login-container {
    margin-bottom: 0;
}

.login-form {
    margin-bottom: 1rem;
}

.homepage-spacing-fix {
    margin-top: 0;
    padding-top: 0;
}

/* ============================================
   10. ENSURE ALL CONTAINERS USE SAME WIDTH
   ============================================ */

.site-header,
.site-content,
.site-footer,
.container {
    max-width: 70rem;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   11. SCROLLBAR STYLING FOR SIDEBARS
   ============================================ */

.site-content-left::-webkit-scrollbar,
.site-content-right::-webkit-scrollbar {
    width: 0.375rem;
}

.site-content-left::-webkit-scrollbar-track,
.site-content-right::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.site-content-left::-webkit-scrollbar-thumb,
.site-content-right::-webkit-scrollbar-thumb {
    background: #FF7400;
    border-radius: 0.1875rem;
}

.site-content-left::-webkit-scrollbar-thumb:hover,
.site-content-right::-webkit-scrollbar-thumb:hover {
    background: #FFA040;
}

/* ============================================
   12. IMPRESSUM PAGE STYLING
   ============================================ */

.impressum-container {
    background: linear-gradient(135deg, #021B40 0%, #022554 100%);
    border: 0.125rem solid #FF7400;
    border-radius: 0.3125rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.impressum-container h1,
.impressum-container h2 {
    color: #fff;
    background: linear-gradient(90deg, #fff 0%, #FF7400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 0.125rem dashed #00FF00;
    padding-bottom: 0.625rem;
    margin-bottom: 1rem;
}

.impressum-container p {
    color: #fff;
    line-height: 1.6;
    margin-bottom: 0.9375rem;
}

/* ============================================
   13. ENSURE CONTENT VISIBILITY
   ============================================ */

.site-content-main > * {
    position: relative;
    z-index: 1;
}

/* Make sure content is visible over background */
.content-wrapper {
    background-color: rgba(2, 27, 64, 0.85);
    border-radius: 0.3125rem;
    padding: 1rem;
}

/* ============================================
   14. SIDEBAR POLISH
   ============================================ */

.sidebar {
    border: 1px solid #444;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sidebar .menu-div {
    letter-spacing: 0.04em;
}

.sidebar .menu-div:not(:first-child) {
    margin-top: 0.4rem;
}

.sidebar-items-left div,
.sidebar-items-right div {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-items-left div:last-child,
.sidebar-items-right div:last-child {
    border-bottom: none;
}

.sidebar-items-left div:hover,
.sidebar-items-right div:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-items-left a,
.sidebar-items-right a {
    color: #BAB3B4;
}

.sidebar-items-left a:hover,
.sidebar-items-right a:hover {
    color: #ff9900;
    text-decoration: none;
}

.sidebar-items-left img,
.sidebar-items-right img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.sidebar-username {
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid #444;
    text-align: center;
}

.sidebar-num {
    color: #ff9900;
    font-weight: 700;
    min-width: 1.4rem;
    text-align: right;
}

.menu-div.menu-placeholder {
    background: transparent;
    border-bottom: none;
    padding: 0;
    min-height: 0.5rem;
}

/* ============================================
   15. DISCLAIMER LAYOUT
   ============================================ */

.disclaimer-card .kg-card-body {
    padding: 1.25rem;
}

.disclaimer-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.disclaimer-section h3 {
    color: #ff6600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.disclaimer-section p {
    color: #BAB3B4;
    margin-bottom: 0.5rem;
}

/* ============================================
   16. LEGACY HTML TAG NORMALIZATION
   ============================================ */

font,
center,
big,
tt,
strike,
s,
u,
marquee,
blink,
basefont,
dir {
    font-family: inherit;
    line-height: inherit;
}

center {
    display: block;
    text-align: center;
}

font[size="1"] { font-size: 0.75rem; }
font[size="2"] { font-size: 0.875rem; }
font[size="3"] { font-size: 1rem; }
font[size="4"] { font-size: 1.125rem; }
font[size="5"] { font-size: 1.25rem; }
font[size="6"] { font-size: 1.5rem; }
font[size="7"] { font-size: 1.75rem; }

tt {
    font-family: "Roboto Mono", "Courier New", monospace;
}

strike,
s {
    text-decoration: line-through;
}

u {
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}

[align="center"] { text-align: center; }
[align="right"] { text-align: right; }
[align="left"] { text-align: left; }
/**
 * Responsive Audit Fixes for Klick-Game
 * Resolves conflicting breakpoints, adds missing tablet layout,
 * fixes hardcoded table widths, and improves mobile usability.
 *
 * Load AFTER comprehensive-fixes.css and BEFORE background-fix.css
 */

/* ============================================
   1. HARDCODED TABLE WIDTH OVERRIDE
   Many PHP files use <table width="650px"> etc.
   CSS width:100%!important already exists in
   comprehensive-fixes.css but only targets bare
   <table>.  We also need max-width so tables
   inside .site-content-main never overflow.
   ============================================ */
.site-content-main table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
}

/* Inline-style width overrides - !important needed for [width] attr */
.site-content-main table[width] {
    width: 100% !important;
    max-width: 100% !important;
}

/* ============================================
   2. UNIFIED BREAKPOINT: TABLET 2-COLUMN LAYOUT
   layout.css collapses at 1200px to 1-col.
   comprehensive-fixes.css collapses at 992px.
   We unify: 992px+ = 3 columns, 768-991 = 2 columns
   (sidebar left + main), <768 = 1 column.
   ============================================ */

/* Tablet: 2-column layout (left sidebar + main, right sidebar below) */
@media (min-width: 768px) and (max-width: 991px) {
    .site-content {
        grid-template-columns: minmax(10rem, 13rem) 1fr !important;
        grid-template-areas:
            "left main"
            "right right" !important;
        gap: 0.75rem;
    }

    .site-content-left,
    .site-content-right {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .site-content-right {
        /* Display right sidebar as a horizontal strip on tablet */
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
        gap: 0.75rem;
    }
}

/* Mobile: single column, main first */
@media (max-width: 767px) {
    .site-content {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "main"
            "left"
            "right" !important;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .site-content-left,
    .site-content-right {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

/* Desktop: restore proper 3-column at 992px+ */
@media (min-width: 992px) {
    .site-content {
        grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem) !important;
        grid-template-areas: "left main right" !important;
        gap: 1rem;
    }
}

/* ============================================
   3. FOOTER RESPONSIVE IMPROVEMENTS
   ============================================ */
@media (max-width: 767px) {
    .site-footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .site-footer-url {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem 0.5rem;
    }

    /* Hide pipe separators on mobile for cleaner wrapping */
    .site-footer-url > span:not(:has(a)) {
        display: none !important;
    }
}

/* ============================================
   4. MOBILE TABLE HORIZONTAL SCROLL
   Instead of card-stacking (which breaks legacy
   PHP tables that lack data-label attrs), prefer
   horizontal scrolling in a contained box.
   ============================================ */
@media (max-width: 767px) {
    .site-content-main table:not(.table-force-layout):not(.kg-table) {
        display: table !important;  /* Override responsive.css block display */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Wrap legacy tables in a scrollable context */
    .site-content-main {
        overflow-x: auto;
    }
}

/* ============================================
   5. INLINE-STYLE WIDTH FIXES
   Some PHP files use style="width:Xpx" inline.
   We can't override inline styles without
   !important on the element. These selectors
   target common patterns.
   ============================================ */
.site-content-main select[style*="width"],
.site-content-main div[style*="width:"] {
    max-width: 100% !important;
}

/* Login page fixed-width box */
div[style*="width: 300px"],
div[style*="width:300px"] {
    width: 100% !important;
    max-width: 300px !important;
}

/* Pinnwand alert */
.alert[style*="max-width: 660px"] {
    max-width: 100% !important;
}

/* ============================================
   6. YOUTUBE EMBEDS RESPONSIVE
   profil.php embeds with fixed width="350"
   ============================================ */
.site-content-main iframe[src*="youtube"],
.site-content-main object,
.site-content-main embed {
    max-width: 100% !important;  /* Override inline width attributes */
    height: auto !important;     /* Override inline height attributes */
    aspect-ratio: 16 / 9;
}

/* ============================================
   7. PREVENT HORIZONTAL OVERFLOW ON BODY
   Critical for mobile: no content should cause
   a horizontal scrollbar on the page.
   ============================================ */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

/* ============================================
   8. TOUCH-FRIENDLY SIDEBAR LINKS ON MOBILE
   Ensure sidebar menu items are large enough
   for finger taps (44px minimum).
   ============================================ */
@media (max-width: 767px) {
    .sidebar-items-left a,
    .sidebar-items-right a {
        min-height: 2.75rem; /* 44px */
        display: flex;
        align-items: center;
        padding: 0.5rem 0.625rem;
    }

    .sidebar-items-left div,
    .sidebar-items-right div {
        padding: 0.25rem 0.625rem;
    }
}

/* ============================================
   9. FIX CONSENT BANNER ON MOBILE
   ============================================ */
@media (max-width: 767px) {
    .kg-consent-banner .kg-consent-card {
        max-width: 100%;
        margin: 0 0.5rem;
    }

    .kg-consent-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .kg-consent-actions .btn {
        width: 100%;
    }
}

/* ============================================
   10. STATUSBAR OVERFLOW ON NARROW SCREENS
   ============================================ */
@media (max-width: 480px) {
    .site-content-statusbar {
        margin: 0 0 0.75rem 0;
    }

    .site-content-statusbar-table {
        font-size: 0.75rem;
    }
}

/* ============================================
   11. STATUSBAR - ENHANCED MOBILE HANDLING
   The statusbar uses a CSS grid with 6 columns
   on desktop. On narrow screens it must either
   wrap into rows or scroll horizontally.
   ============================================ */

/* Horizontal scroll fallback for very narrow screens */
@media (max-width: 767px) {
    .site-content-statusbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 0 0.75rem 0;
        /* Subtle scroll hint shadow on right edge */
        background:
            linear-gradient(to right, transparent 90%, rgba(50,135,39,0.15) 100%);
    }

    .site-content-statusbar-table {
        /* 2-column grid at mobile; work + HP span full width */
        grid-template-columns: repeat(2, 1fr) !important;
        font-size: 0.7rem;
        min-width: 0;
    }

    .site-content-statusbar-table-lvl,
    .site-content-statusbar-table-money,
    .site-content-statusbar-table-ges,
    .site-content-statusbar-table-int,
    .site-content-statusbar-table-ep {
        grid-column: auto !important;
    }

    .site-content-statusbar-table-work {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .site-content-statusbar-table-hp {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    /* Prevent text/numbers from overflowing cells */
    .site-content-statusbar-table > div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    /* Ensure icons stay compact */
    .site-content-statusbar-table img {
        flex-shrink: 0;
        max-width: 0.875rem;
    }
}

@media (max-width: 360px) {
    .site-content-statusbar-table {
        grid-template-columns: 1fr !important;
        font-size: 0.65rem;
    }

    .site-content-statusbar-table-work,
    .site-content-statusbar-table-hp {
        grid-column: 1 !important;
    }
}

/* ============================================
   12. TABLE SCROLL WRAPPERS
   Legacy PHP tables often have inline widths.
   Instead of card-stacking (which requires
   data-label attributes most tables lack), wrap
   them in a scrollable container via CSS.
   ============================================ */

/* Generic scroll wrapper class for PHP templates */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* All direct-child tables inside main content scroll */
@media (max-width: 767px) {
    .site-content-main {
        overflow-x: hidden;
    }

    /* Create scroll context for every table */
    .site-content-main table:not(.table-force-layout):not(.kg-table):not(.site-content-statusbar-table) {
        display: table !important;  /* Override responsive.css block display */
        min-width: 28rem;           /* Force scroll when container is narrow */
        width: 100% !important;     /* Override inline width attributes */
    }

    /* Undo the card-stacking from responsive.css for legacy tables
       that lack data-label attributes (most game tables) */
    .site-content-main table:not(.table-force-layout):not(.kg-table) thead {
        display: table-header-group !important;
    }

    .site-content-main table:not(.table-force-layout):not(.kg-table) tr {
        display: table-row !important;
        margin-bottom: 0;
        border: none;
    }

    .site-content-main table:not(.table-force-layout):not(.kg-table) td,
    .site-content-main table:not(.table-force-layout):not(.kg-table) th {
        display: table-cell !important;
        text-align: inherit;
    }

    .site-content-main table:not(.table-force-layout):not(.kg-table) td:before {
        content: none !important;    /* Remove pseudo-label from responsive.css */
    }

    /* Ensure the main content area scrolls for wide tables */
    .site-content-main > table,
    .site-content-main > div:not(.site-content-statusbar) {
        max-width: 100%;
    }
}

/* Highscore-specific table improvements */
@media (max-width: 767px) {
    .highscore-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-dark {
        min-width: 30rem;
    }

    /* Highscore tabs: horizontal scroll on mobile */
    .nav-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 0.125rem;
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   13. FORMS - FULL-WIDTH & TOUCH-FRIENDLY
   Login, registration, and message forms have
   hardcoded inline widths. Override them and
   make buttons touch-friendly (min 44px).
   ============================================ */

/* Override inline width styles on form inputs */
@media (max-width: 767px) {
    .site-content-main input[type="text"],
    .site-content-main input[type="password"],
    .site-content-main input[type="email"],
    .site-content-main input[type="number"],
    .site-content-main input[type="search"],
    .site-content-main input[name="bname"],
    .site-content-main input[name="pw"],
    .site-content-main select,
    .site-content-main textarea {
        width: 100% !important;     /* Override inline width attributes */
        max-width: 100% !important; /* Override inline width attributes */
        min-height: 2.75rem;  /* 44px touch target */
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        box-sizing: border-box;
    }

    /* Inline-styled inputs from legacy PHP (width:103px, width:270px etc.) */
    .site-content-main input[style*="width:103px"],
    .site-content-main input[style*="width: 103px"],
    .site-content-main input[style*="width:270px"],
    .site-content-main input[style*="width: 270px"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Touch-friendly buttons */
    .site-content-main input[type="submit"],
    .site-content-main input[type="reset"],
    .site-content-main input[type="button"],
    .site-content-main button:not(.chat-emoji-btn):not(.chat-send-btn) {
        min-height: 2.75rem;  /* 44px */
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
        cursor: pointer;
        touch-action: manipulation;
    }

    /* Stack form table cells vertically */
    .site-content-main form table,
    .site-content-main form table tbody,
    .site-content-main form table tr,
    .site-content-main form table td {
        display: block !important;  /* Override table display */
        width: 100%;
    }

    .site-content-main form table tr {
        margin-bottom: 0.5rem;
    }

    .site-content-main form table td {
        padding: 0.25rem 0;
    }

    /* Labels (often in .procolumn) */
    .procolumn {
        display: block;
        width: 100%;
        padding: 0.25rem 0;
        font-size: 0.875rem;
    }

    /* Login page wrapper - !important needed for inline style overrides */
    div[style*="margin: 0 auto;width: 300px"],
    div[style*="margin: 0 auto; width: 300px"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 0.5rem;
    }

    /* Registration table - !important needed for inline style override */
    .site-content-main table[style*="border:  solid 0.0mm black"] {
        border: none !important;
    }

    /* Checkbox + label rows: keep inline */
    .site-content-main form input[type="checkbox"] {
        width: auto !important;  /* Override the 100% width rule above */
        min-height: 1.25rem;
        min-width: 1.25rem;
        margin-right: 0.5rem;
        vertical-align: middle;
    }
}

/* ============================================
   14. NAVIGATION / SIDEBAR - MOBILE TOUCH
   Ensure hamburger-driven mobile menu works
   and dropdown/submenus support touch events.
   ============================================ */

/* Mobile menu overlay improvements */
@media (max-width: 767px) {
    .mobile-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .mobile-menu a {
        min-height: 2.75rem;  /* 44px touch target */
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        color: #fff;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-menu a:active {
        background: rgba(255,102,0,0.3);
    }

    /* Sidebar collapse: items become accordion-like */
    .sidebar {
        border-radius: 0.375rem;
        overflow: hidden;
    }

    /* Menu dividers act as section headers */
    .menu-div {
        position: relative;
        cursor: pointer;
        padding-right: 2rem;
    }

    /* Dropdown submenus: ensure they work with touch */
    .sidebar-items-left .submenu,
    .sidebar-items-right .submenu,
    .sidebar-items-left .dropdown-menu,
    .sidebar-items-right .dropdown-menu {
        position: static !important;  /* Override Bootstrap absolute positioning */
        width: 100%;
        background: rgba(0, 27, 64, 0.9);
        box-shadow: none !important;  /* Override Bootstrap */
        border: none !important;      /* Override Bootstrap */
    }

    .sidebar-items-left .dropdown-menu a,
    .sidebar-items-right .dropdown-menu a {
        padding: 0.625rem 1.25rem;
        min-height: 2.75rem;
    }
}

/* ============================================
   15. CHAT / MESSAGES - MOBILE READABILITY
   Fix the chat's fixed height, hidden sidebar,
   and ensure input areas are properly sized.
   ============================================ */

@media (max-width: 767px) {
    /* Chat container: use viewport height instead of fixed 600px */
    .chat-container {
        height: calc(100vh - 8rem);
        height: calc(100dvh - 8rem);  /* Dynamic viewport for mobile browsers */
        margin: 0.5rem;
        border-radius: 0.375rem;
    }

    /* Chat body: stack vertically (sidebar hidden by default) */
    .chat-body {
        position: relative;
        flex: 1;
        overflow: hidden;
    }

    /* Chat sidebar: slide-in overlay with better toggle */
    .chat-sidebar {
        position: absolute;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 70vw;
        max-width: 16rem;
        z-index: 10;
        transition: left 0.3s ease;
        background: rgba(0, 0, 0, 0.95);
        border-right: 1px solid #595959;
    }

    .chat-sidebar.open {
        left: 0;
    }

    /* Chat header: compact */
    .chat-header {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .chat-title {
        font-size: 1.125rem;
    }

    .chat-online-count {
        font-size: 0.75rem;
    }

    /* Messages area: full width */
    .chat-messages {
        padding: 0.5rem;
    }

    .chat-message {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .chat-message-text {
        font-size: 0.875rem;
        line-height: 1.5;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .chat-message-header {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .chat-message-user {
        font-size: 0.8125rem;
    }

    /* Input area: properly sized */
    .chat-input-area {
        padding: 0.5rem;
    }

    .chat-input-form {
        gap: 0.25rem;
    }

    .chat-input {
        min-height: 2.75rem;  /* 44px touch target */
        padding: 0.5rem;
        /* Prevent iOS zoom on input focus */
        font-size: 16px !important;  /* Must override to prevent iOS zoom */
    }

    .chat-send-btn {
        min-height: 2.75rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
        /* Override the generic button full-width rule for chat */
        width: auto !important;
    }

    .chat-emoji-btn {
        min-height: 2.75rem;
        min-width: 2.75rem;
        padding: 0.5rem;
        /* Override generic button full-width */
        width: auto !important;
    }

    /* Chat message actions: always visible on mobile (no hover) */
    .chat-message .chat-message-actions {
        display: flex;
    }

    /* Story/narrative messages */
    .story-message {
        padding: 0.75rem;
    }

    .message-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .messages-container {
        padding: 0;
    }

    /* Chat info section below chat */
    .chat-container + .kg-container {
        margin: 1rem 0.5rem;
        padding: 0.75rem;
    }
}

/* ============================================
   16. PROFILE PAGE - MOBILE REFINEMENTS
   ============================================ */

@media (max-width: 767px) {
    .kg-page {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .profile-window {
        margin: 0;
    }

    #profile-content {
        padding: 0.75rem;
    }

    .profile-title {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.75rem 0.5rem;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }
}

/* ============================================
   17. GENERAL MOBILE POLISH
   ============================================ */

/* Prevent iOS input zoom (inputs < 16px cause zoom) - !important needed to override all other font-size rules */
@media (max-width: 767px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Ensure all clickable elements have adequate touch targets */
@media (max-width: 767px) {
    a.link7,
    a.link13,
    a.link18,
    a.link3,
    a.link15,
    a.help {
        display: inline-flex;
        align-items: center;
        min-height: 2.75rem;
        padding: 0.25rem 0;
    }
}

/* Alert boxes: full-width on mobile - !important needed for inline style overrides */
@media (max-width: 767px) {
    .alert,
    table[cellpadding="5"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    table[cellpadding="5"] td {
        width: 100% !important;
    }
}

/* Story progress bar mobile */
@media (max-width: 767px) {
    .story-progress-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .progress-line {
        width: 2rem;
    }

    .progress-step {
        min-width: 3rem;
    }

    .step-label {
        font-size: 0.75rem;
    }
}

/* Pagination mobile improvements */
@media (max-width: 767px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .pagination .page-link {
        min-height: 2.75rem;
        min-width: 2.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Gewinnspiel / raffle mobile */
@media (max-width: 767px) {
    .gewinn-section {
        padding: 0.75rem;
    }

    .gewinn-section table {
        min-width: 20rem;
    }
}

/* ============================================
   18. TABLET REFINEMENTS (768px - 991px)
   ============================================ */

@media (min-width: 768px) and (max-width: 991px) {
    /* Chat: show sidebar as a narrow column */
    .chat-container {
        height: calc(100vh - 10rem);
    }

    .chat-sidebar {
        width: 10rem;
    }

    /* Statusbar: 3-column grid on tablet - !important to override base grid columns */
    .site-content-statusbar-table {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .site-content-statusbar-table-lvl,
    .site-content-statusbar-table-money,
    .site-content-statusbar-table-ges,
    .site-content-statusbar-table-int,
    .site-content-statusbar-table-ep {
        grid-column: auto !important;
    }

    .site-content-statusbar-table-work {
        grid-column: 1 / -1 !important;
    }

    .site-content-statusbar-table-hp {
        grid-column: 1 / -1 !important;
    }

    /* Form tables: keep side-by-side at tablet */
    .site-content-main form table td {
        display: table-cell !important;
    }
}

/* ============================================
   19. CHAT SIDEBAR TOGGLE BUTTON
   Visible only on mobile where the sidebar
   is hidden off-screen by default.
   ============================================ */

.chat-sidebar-toggle {
    display: none;
    background: rgba(255, 102, 0, 0.2);
    border: 1px solid #ff6600;
    color: #ff9900;
    font-size: 1.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    cursor: pointer;
    min-height: 2.75rem;
    min-width: 2.75rem;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chat-sidebar-toggle:hover,
.chat-sidebar-toggle:active {
    background: rgba(255, 102, 0, 0.4);
}

@media (max-width: 767px) {
    .chat-sidebar-toggle {
        display: inline-flex;
        /* Override generic button full-width rule */
        width: auto !important;
        margin-bottom: 0;
    }
}

/* ============================================
   20. SIDEBAR/FOTTER POLISH
   Remove awkward line breaks in sidebar rows,
   keep logged-in badges contained, and render
   the footer as a sidebar-style service panel.
   ============================================ */

.sidebar-items-left,
.sidebar-items-right {
    min-width: 0;
}

.sidebar-items-left > div,
.sidebar-items-right > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
}

.sidebar-items-left > div > img,
.sidebar-items-right > div > img {
    flex: 0 0 auto;
}

.sidebar-items-left > div > a,
.sidebar-items-right > div > a,
.sidebar-items-left > div > span,
.sidebar-items-right > div > span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-items-left > div > a,
.sidebar-items-right > div > a {
    flex: 1 1 auto;
    display: block;
}

.sidebar-num,
.sidebar-notification {
    flex: 0 0 auto;
}

.sidebar-notification {
    margin-left: auto;
    max-width: 55%;
}

.sidebar-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-quick-actions {
    display: grid;
    gap: 0.35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.5rem 0.625rem 0.65rem !important;
}

.sidebar-quick-actions a {
    background: rgba(255, 102, 0, 0.12);
    border: 1px solid rgba(255, 157, 69, 0.42);
    border-radius: 0.25rem;
    color: #ffb066 !important;
    display: block;
    font-size: 0.72rem !important;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    padding: 0.35rem 0.25rem;
    text-align: center;
    text-decoration: none;
}

.sidebar-quick-actions a:hover,
.sidebar-quick-actions a:focus-visible {
    background: rgba(255, 102, 0, 0.22);
    border-color: rgba(255, 192, 124, 0.85);
    color: #ffffff !important;
    text-decoration: none;
}

.site-content-right .sidebar-items-right > div,
.site-content-left .sidebar-items-left > div {
    max-width: 100%;
}

.site-content-right .sidebar-items-right > div > * {
    min-width: 0;
}

.site-footer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.site-footer-panel {
    border: 0.125rem solid rgba(255, 116, 0, 0.72);
    border-radius: 0.625rem 0.625rem 0 0;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(4, 29, 67, 0.96) 0%, rgba(2, 18, 43, 0.96) 100%);
    box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.25);
}

.site-footer-panel > .menu-div {
    margin: 0;
    border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.35);
}

.site-footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem 0.75rem;
}

.site-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    color: #c7d2e2;
    font-size: 0.875rem;
}

.site-footer-brand {
    color: #ffffff;
    font-weight: 700;
}

.site-footer-version {
    color: #ffb066;
}

.site-footer-url {
    flex: 1 1 24rem;
    min-width: 0;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.15rem 0.85rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-links li {
    display: inline;
    min-width: 0;
}

.site-footer .site-footer-links a {
    display: inline !important;
    max-width: 100%;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ff9d45;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.site-footer .site-footer-links a:hover,
.site-footer .site-footer-links a:focus-visible {
    color: #ffc07c;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .site-footer-panel {
        border-radius: 0.5rem 0.5rem 0 0;
    }

    .site-footer-content {
        padding: 0.625rem 0.75rem 0.75rem;
    }

    .site-footer-meta {
        justify-content: center;
        text-align: center;
    }

    .site-footer-links {
        justify-content: center;
    }

    .site-footer-links li {
        max-width: 100%;
    }

    .site-footer .site-footer-links a {
        white-space: nowrap;
        text-align: center;
    }
}

/* ============================================
   19. WIDESCREEN RESPONSIVE SCALING OVERRIDES (2k & 4k Screens)
   Allow elegant page expansion up to a maximum width of 90% (capped at 90rem/95rem),
   increasing sidebar widths and grid gaps to prevent stretched content.
   ============================================ */
@media (min-width: 1201px) {
    .container,
    .site-header,
    .site-content,
    .site-footer,
    .page-title,
    .site-header h1,
    .main-title {
        width: 90% !important;
        max-width: 85rem !important; /* 1360px absolute cap on standard widescreen */
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Widen sidebars to keep central content compact, readable, and balanced */
    .site-content {
        grid-template-columns: minmax(14rem, 16rem) 1fr minmax(14rem, 16rem) !important;
        gap: 1.5rem !important; /* Premium wide screen spacing */
    }
}

@media (min-width: 1400px) {
    .container,
    .site-header,
    .site-content,
    .site-footer,
    .page-title,
    .site-header h1,
    .main-title {
        width: 90% !important;
        max-width: 90rem !important; /* 1440px absolute cap on large widescreen */
    }

    .site-content {
        grid-template-columns: minmax(16rem, 18rem) 1fr minmax(16rem, 18rem) !important;
        gap: 1.75rem !important;
    }
}

@media (min-width: 1600px) {
    .container,
    .site-header,
    .site-content,
    .site-footer,
    .page-title,
    .site-header h1,
    .main-title {
        width: 90% !important;
        max-width: 95rem !important; /* 1520px absolute cap on 2k/4k screens - centered beautifully */
    }

    .site-content {
        grid-template-columns: minmax(18rem, 20rem) 1fr minmax(18rem, 20rem) !important;
        gap: 2.25rem !important; /* Elegant widescreen margins */
    }
}

/**
 * Background Fix for Klick-Game
 * Ensures background image is always visible, stretched, and fixed while scrolling
 * Version: 1.0
 * Priority: HIGH - Load this file last
 */

/* ============================================
   CRITICAL BACKGROUND FIX
   Background bleibt beim Scrollen sichtbar und ist gestretched
   ============================================ */

html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* Background Image - immer sichtbar - !important to override Bootstrap/other files */
    background-color: #2a2a2a !important;
    background-image: url('/images/body-bg.jpg') !important;

    /* Fixed = bleibt beim Scrollen */
    background-attachment: fixed !important;

    /* Zentriert */
    background-position: center center !important;

    /* Kein Wiederholen */
    background-repeat: no-repeat !important;

    /* Cover = Stretched auf gesamten Bildschirm */
    background-size: cover !important;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
}

/* Zusätzlicher Fix für iOS Safari - !important to override the fixed rules above */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        background-attachment: scroll !important;
        background-size: 100% 100% !important;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #2a2a2a;
        background-image: url('/images/body-bg.jpg');
        background-attachment: fixed;
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
        z-index: -1;
    }
}

/* Fallback für ältere Browser - !important to override the cover rule above */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    body {
        background-size: 100% 100% !important;
    }
}

/* Footer override lives here because this stylesheet is loaded last. */
.site-footer {
    padding: 0 !important;
}

.site-footer-content {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.35rem 1rem !important;
    padding: 0.625rem 0.875rem 0.75rem !important;
}

.site-footer-links {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.15rem 0.85rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-footer-links li {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-footer .site-footer-links a {
    display: inline !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ff9d45 !important;
    white-space: nowrap !important;
}

.site-footer .site-footer-links a:hover,
.site-footer .site-footer-links a:focus-visible {
    color: #ffc07c !important;
    text-decoration: underline !important;
}

/* === action-table: replaces inline width= on legacy tables === */
table.action-table { width: 100%; max-width: 670px; }
