/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    font-family: 'Press Start 2P', 'VT323', 'Consolas', 'Courier New', monospace, Arial, sans-serif;
    background: linear-gradient(135deg, #0d1021 0%, #403151 100%);
    color: #e2d5b8;
    min-height: 100vh;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Nav */
header {
    background: #22203a;
    box-shadow: 0 4px 14px #0006;
    padding: 0;
    width: 100%;
}
.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0 0.5rem 0;
    background: #292046;
}
.nav-btn {
    background: #7f5af0;
    color: #fff;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 1.1rem;
    font-family: inherit;
    padding: 0.75rem 1.5rem;
    margin: 0 0.3rem;
    cursor: pointer;
    transition: background 0.18s;
    letter-spacing: 1px;
}
.nav-btn:hover, .nav-btn:focus {
    background: #2cb67d;
    color: #16161a;
    outline: none;
}

/* Banner/Overview */
.header-banner {
    display: flex;
    overflow-x: auto;
    width: 100%;
    max-height: 320px;
    gap: 0.5rem;
    background: #18101a;
    padding: 1rem 0;
    border-bottom: 3px solid #7f5af0;
}
.header-banner img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 6px;
    margin-right: 1rem;
    box-shadow: 0 4px 24px #0008;
}

/* Sections */
main {
    flex: 1 1 auto;
    padding: 2.5rem 3vw;
    max-width: 1200px;
    margin: 0 auto;
}
section {
    margin-bottom: 2.5rem;
    background: rgba(34, 32, 58, 0.95);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 18px #0003;
    border: 1px solid #7f5af06a;
}
h1, h2 {
    color: #7f5af0;
    margin-bottom: 1.1rem;
    text-shadow: 0 2px 10px #0007;
    font-family: inherit;
}
h1 {
    font-size: 2rem;
}
h2 {
    font-size: 1.4rem;
}
ul, li {
    font-size: 1.07rem;
    line-height: 1.65;
}

/* Commands */
.commands-section ul {
    list-style: none;
    padding: 0;
}
.commands-section li {
    margin-bottom: 1.1em;
    background: #24204599;
    border-left: 4px solid #2cb67d;
    border-radius: 4px;
    padding: 0.7em 1em;
    box-shadow: 0 2px 6px #0002;
}

/* Tools/Buttons */
.buttonXX, .button {
    display: inline-block;
    background: #2cb67d;
    color: #18101a;
    text-decoration: none;
    padding: 0.8em 2em;
    border-radius: 6px;
    margin: 0.6em 0.8em 0.6em 0;
    font-weight: bold;
    font-size: 1.02rem;
    border: none;
    box-shadow: 0 2px 12px #2cb67d55;
    transition: background 0.2s, color 0.2s, box-shadow 0.25s;
    cursor: pointer;
}
.buttonXX:hover, .button:hover {
    background: #7f5af0;
    color: #fff;
    box-shadow: 0 2px 20px #7f5af099;
}

/* General iframe styling: Let container/section set the height */
iframe {
    border-radius: 8px;
    border: none;
    background: #18101a;
    box-shadow: 0 3px 20px #0004;
    margin-bottom: 1rem;
    width: 100%;
    /* Remove any min-height or min-width here */
}

/* Leaderboard and Map Leaderboard sections */
.leaderboard-section,
.map-leaderboard-section {
    margin-bottom: 2rem;
    background: rgba(34,32,58,0.98);
    border-radius: 12px;
    padding: 2.1rem 1rem;
    box-shadow: 0 6px 24px #0005;
}

/* Make leaderboard iframes BIG and readable */
.leaderboard-section iframe,
.map-leaderboard-section iframe {
    width: 100%;
    height: 620px;   /* Large and readable on desktop */
    min-height: 370px;
    max-height: 80vh;
    display: block;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 6px 30px #0007;
    background: #120c18;
    border-radius: 12px;
}

/* Responsive: shrink height on tablet/mobile */
@media (max-width: 1000px) {
    .leaderboard-section iframe,
    .map-leaderboard-section iframe {
        height: 400px;
        min-height: 220px;
    }
}
@media (max-width: 600px) {
    .leaderboard-section iframe,
    .map-leaderboard-section iframe {
        height: 220px;
        min-height: 100px;
    }
}

/* Twitch/Live */
.twitch-stream-section select,
.twitch-stream-section button {
    font-size: 1rem;
    margin: 0.7em 0.5em 0.7em 0;
    padding: 0.5em 1em;
    border-radius: 5px;
    border: 1px solid #7f5af0;
    background: #18101a;
    color: #fff;
}
.twitch-stream-section button {
    background: #2cb67d;
    color: #18101a;
    font-weight: bold;
}
.twitch-stream-section button:hover {
    background: #7f5af0;
    color: #fff;
}
#pc-twitch-embed-container, #mobile-twitch-embed-container {
    margin: 1.5rem 0 0 0;
    width: 100%;
}

/* News */
.news-section iframe {
    height: 300px;
    background: #18101a;
}

/* Support/Store */
.support-section img {
    max-width: 300px;
    margin: 1.2em 0;
    display: block;
}
footer {
    width: 100%;
    background: #16161a;
    color: #7f5af0;
    text-align: center;
    padding: 2rem 0 1.5rem 0;
    border-top: 3px solid #7f5af0;
}
footer .button {
    margin-bottom: 1.1rem;
}

/* TCG */
.tcg-section iframe {
    min-height: 800px;
    border: 3px solid #2cb67d;
}

/* Responsive Design */
@media (max-width: 950px) {
    main {
        padding: 1.5rem 2vw;
    }
    section {
        padding: 1.1rem;
    }
    .header-banner {
        flex-direction: column;
        align-items: center;
        max-height: none;
    }
    .header-banner img {
        max-width: 95vw;
        margin: 0.5em 0;
    }
}
@media (max-width: 700px) {
    .main-nav {
        gap: 0.5rem;
    }
    .nav-btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.95rem;
        margin: 0 0.15rem;
    }
    main {
        padding: 0.8rem 1vw;
    }
    section {
        padding: 0.7rem;
    }
    .tcg-section iframe {
        min-height: 500px;
    }
}
@media (max-width: 480px) {
    h1 { font-size: 1.1rem; }
    h2 { font-size: 1rem; }
    ul, li { font-size: 0.96rem; }
    .buttonXX, .button { font-size: 0.89rem; padding: 0.6em 1.1em; }
}

/* Optional: Retro CRT Scanlines Effect */
body:after {
    pointer-events: none;
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        #0002 2.5px,
        #0002 4px
    );
    opacity: 0.13;
    z-index: 9999;
}
#news-modal {
    position: fixed;
    z-index: 10010;
    top: 16vh;
    left: 50vw;
    transform: translate(-50%, 0);
    width: 400px;
    min-width: 260px;
    max-width: 90vw;
    background: #242045;
    color: #e2d5b8;
    border: 2px solid #7f5af0;
    border-radius: 10px;
    box-shadow: 0 8px 44px #000e;
    display: block;
    user-select: none;
}
#news-modal-header {
    padding: 0.6em 1em;
    background: #2cb67d;
    color: #16161a;
    font-weight: bold;
    cursor: move;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#news-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #18101a;
    cursor: pointer;
    margin-left: 1em;
}
#news-modal iframe {
    display: block;
    width: 100%;
    border-radius: 0 0 8px 8px;
    background: #18101a;
    margin: 0;
}
@media (max-width: 500px) {
    #news-modal { width: 96vw; left: 2vw; transform: none; }
}
.footer-supporter-link {
    display: block;
    margin: 1rem auto 0.6rem auto;
    text-align: center;
}
.footer-supporter-banner {
    max-width: 350px;
    width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 3px 24px #0008;
    border: 2px solid #2cb67d77;
    background: #18101a;
    transition: transform 0.14s;
}
.footer-supporter-link:hover .footer-supporter-banner {
    transform: scale(1.03) rotate(-1deg);
}
.gold   { background: #ffd70033; font-weight: bold; }
.silver { background: #c0c0c033; font-weight: bold; }
.bronze { background: #cd7f3233; font-weight: bold; }

.table-container {
    width: 100%;
    overflow-x: auto;
}
#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}
#leaderboard-table th,
#leaderboard-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #7f5af044;
}
#leaderboard-table th {
    cursor: pointer;
    background: #221d39cc;
    color: #7f5af0;
    font-size: 1.04em;
}
.username {
    color: #2cb67d;
    text-decoration: underline;
    cursor: pointer;
}
.username:hover {
    color: #7f5af0;
}
.tab-button {
    display: inline-block;
    margin: 0 6px 10px 0;
    padding: 0.6em 1.3em;
    background: #292046;
    border: 1.5px solid #7f5af0;
    color: #7f5af0;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.18s, color 0.18s;
}
.tab-button.active,
.tab-button:hover {
    background: #2cb67d;
    color: #18101a;
    border-bottom: 2px solid #2cb67d;
}
.map-leaderboard-tables table {
    width: 100%;
    margin-bottom: 1.5em;
    background: #18101a;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #7f5af033;
}
.map-leaderboard-tables th,
.map-leaderboard-tables td {
    padding: 0.5em 0.9em;
    border-bottom: 1px solid #7f5af033;
    text-align: center;
}
.map-leaderboard-tables th {
    background: #221d39cc;
    color: #7f5af0;
}
.map-leaderboard-tables tr:last-child td {
    border-bottom: none;
}
#createGuildSection {
  background: #18101a;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #7f5af033;
}
.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  gap: 10px;
}
.member-row button {
  margin-left: 6px;
}
