@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Unbounded:wght@500;700&display=swap');

:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-muted: #f8fafc;
    --ink: #101828;
    --muted: #667085;
    --accent: #ffb020;
    --accent-strong: #ff7a18;
    --stroke: #e4e7ec;
    --shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
    --radius: 18px;
    --row-alt: #fbfcfd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(1100px 600px at 80% -120px, #ffe9c2 0%, transparent 60%),
        radial-gradient(900px 500px at -10% 10%, #c8f3ef 0%, transparent 55%),
        var(--bg);
    min-height: 100vh;
}

body.theme-dark {
    --bg: #0b1221;
    --panel: #111827;
    --panel-muted: #0f172a;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --accent: #ffb020;
    --accent-strong: #ff7a18;
    --stroke: #1f2937;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    --row-alt: #0b1221;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('../img/hytale-bg.gif') center/cover no-repeat;
    opacity: 0.16;
    filter: blur(2px) saturate(0.8);
    z-index: -2;
}

body.theme-dark::before {
    opacity: 0.22;
    filter: blur(3px) saturate(0.65);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.8), rgba(244, 247, 251, 0.95));
    z-index: -1;
}

body.theme-dark::after {
    background: linear-gradient(120deg, rgba(6, 8, 14, 0.92), rgba(10, 18, 33, 0.98));
}

.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: var(--panel);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(16, 24, 40, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(16, 24, 40, 0.18);
}

.container {
    max-width: 1100px;
    margin: 32px auto;
    padding: 24px;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease;
}

.container.narrow {
    max-width: 760px;
}

header.hero {
    text-align: center;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6ab7ff, #ffd07a);
    color: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.18);
    margin-bottom: 24px;
}

header.hero h1 {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-size: 2rem;
    margin: 0 0 8px;
}

header.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.server-card {
    background: var(--panel-muted);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px rgba(16, 24, 40, 0.12);
}

.server-card h2 {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.meta {
    color: var(--muted);
    margin: 10px 0 14px;
}

.server-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #1f2937;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(255, 176, 32, 0.3);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.server-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.package {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 18px;
    align-items: center;
    background: var(--panel-muted);
    border: 1px solid var(--stroke);
    margin: 18px 0;
    padding: 18px;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.package:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(16, 24, 40, 0.12);
}

.icon img {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(16, 24, 40, 0.18);
}

.content h2 {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.content p {
    margin: 0 0 12px;
    color: var(--muted);
}

.prices button {
    margin: 6px 6px 0 0;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.12);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.prices button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.prices button[disabled] {
    background: var(--stroke);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}

.prices button[disabled]:hover {
    transform: none;
    filter: none;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.nav-link,
.footer-link,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--stroke);
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.footer-link:hover,
.link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(16, 24, 40, 0.12);
}

footer {
    text-align: center;
    margin-top: 20px;
}

.message {
    background: var(--panel-muted);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 18px;
    margin: 18px auto;
}

.message.warning {
    border-color: var(--accent);
    background: rgba(255, 176, 32, 0.12);
    color: var(--ink);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    overflow: hidden;
    background: var(--panel);
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--stroke);
}

th {
    background: var(--panel-muted);
    font-weight: 700;
    color: #1f2937;
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) td {
    background: var(--row-alt);
}

.rank {
    text-align: center;
    font-weight: 700;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.45);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--panel);
    margin: 12% auto;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

.close {
    color: var(--muted);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 12px;
}

.close:hover {
    color: #111827;
}

.modal h3 {
    text-align: center;
    margin-bottom: 14px;
}

#playerNameInput {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--panel-muted);
    color: var(--ink);
    font-size: 1em;
    margin-bottom: 16px;
}

#playerNameInput:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.modal-buttons button:first-child {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #0b1221;
    box-shadow: 0 10px 20px rgba(255, 176, 32, 0.35);
}

.modal-buttons button:last-child {
    background: var(--panel-muted);
    color: var(--ink);
    border: 1px solid var(--stroke);
}

.modal-buttons button:hover {
    transform: translateY(-1px);
}

.muted {
    color: var(--muted);
}

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

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

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 840px) {
    .container {
        margin: 20px;
        padding: 18px;
    }
    .package {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .icon img {
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    header.hero h1 {
        font-size: 1.6rem;
    }
    .server-list {
        grid-template-columns: 1fr;
    }
}
