/* =====================
   Grundlegende Styles
===================== */
body {
    font-family: Arial, sans-serif;
    background: url(bg.jpg) no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    color: #fff;
    margin: 0 auto;
}

body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* =====================
   Überschrift (h1)
===================== */
header {
    text-align: center;
    background: #333;
    border-radius: 10px;
    padding: 0px 15px;
    box-shadow: #67ddbc 0px 0px 20px;
	width: 100%;
}

/* =====================
   Haupt-Content Bereich
===================== */
#content {
    width: 90vw;
    margin: auto;
    padding: 60px 0;
    box-sizing: border-box;
}

/* =====================
   Wochengewinner Bereich
===================== */
.week-winners {
    border-radius: 10px;
    padding: 20px;
    background: #333;
    box-shadow: #67ddbc 0px 0px 20px;
}

.week-winners table {
    width: 100%;
    border-collapse: collapse;
	font-size: x-small;
}

.week-winners th, .week-winners td {
    padding: 0.5em;
    border: 1px solid #ccc;
    text-align: left;
    color: #fff;
}

/* =====================
   Grid-Layout für Karten
===================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* =====================
   Einzelne Karte (Card)
===================== */
.card {
    background: #333;
    border-radius: 10px;
    padding: 15px;
    box-shadow: #67ddbc 0px 0px 20px;
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    height: 400px;
}

.card:hover {
    transform: translateY(-3px);
}

/* =====================
   Aktive Karte: fullscreen + Footer sichtbar
===================== */
.card.active {
    position: fixed;
    inset: 0;
    z-index: 10;

    background: #333;
    border-radius: 0;
    box-shadow: 0 0 20px #67ddbc;
    display: flex;
    flex-direction: column;

    margin: 0;
    padding: 0;
	height: auto;
}

/* Verstecke Highscores im aktiven Zustand */
.card.active .highscores {
    display: none;
}

/* Link-Styling innerhalb der Karte */
.card a {
    text-decoration: none;
    color: #00adee;
    font-size: 1.5em;
    font-weight: bold;
    margin: auto 0;
}

/* =====================
   Kartenkopf (Header)
===================== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* =====================
   Schließen-Button (Close Button)
===================== */
.close-btn {
    display: none;
}

/* Schließen-Button sichtbar */
.card.active .close-btn {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 11;
    padding: 5px;
    background: red;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 36px;
    color: #fff;
}

/* Mobilfreundlicher kleiner Close-Button bei kleinen Screens */
@media (max-width: 600px) {
    .close-btn {
        font-size: 12px;
    }
}

.close-btn:hover {
    color: #f00;
}

/* =====================
   Highscores-Liste
===================== */
.highscores {
    margin-top: 10px;
    font-size: 0.9em;
    flex-grow: 0;
	height: 240px;
    overflow-y: auto;
    background: #222;
    padding: 10px;
    border-radius: 8px;
}

.highscores ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.highscores li {
    padding: 4px 0;
    border-bottom: 1px solid #444;
}

.score {
    color: #0f0;
    font-weight: bold;
}

.date {
    color: #aaa;
    font-size: 0.8em;
}

.card.active .highscores {
    display: none;
}

/* =====================
   Bewertung (Rating)
===================== */
.rating {
    margin-top: auto;
    text-align: center;
    padding-top: 10px;
    user-select: none;
}

.rating .stars {
    cursor: pointer;
    color: #ccc;
}

.rating .stars .star {
    font-size: 1.8em;
    transition: color 0.2s;
}

.rating .stars .star:hover,
.rating .stars .star.hovered {
    color: gold;
}

.rating .avg {
    font-size: 0.9em;
    color: #aaa;
    margin-top: 0.2em;
}

/* =====================
   iFrame Styles
===================== */
.card iframe {
    border: none;
    flex-grow: 1;
    width: 100%;
    height: auto;
    display: none;
    position: relative;
    margin-top: 10px;
}

.card.active iframe {
    display: block;
    position: absolute;
    bottom: 40px; /* Höhe des Footers */
    width: 100%;
    height: calc(100% - 40px);
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* =====================
   Footer
===================== */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    padding: 0;
    background: #333;
    box-shadow: #67ddbc 0px 0px 20px;
    z-index: 999;
    text-align: center;
}

/* =====================
   Layout: Grid + Wochengewinner
===================== */
#content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
	width: 100%;
}

/* linke Spalte (grid) */
.main-content .grid {
    flex: 2;
}

/* rechte Spalte (week-winners) */
.main-content .week-winners {
    flex: 1;
    max-width: 400px; /* optional: feste Max-Breite */
	height: 75vh;
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column;
    }

    .main-content .grid,
    .main-content .week-winners {
        flex: none;
		width: -moz-available;
		width: -webkit-fill-available;
    }
	
	table {
		font-size: 2vw;
	}
}