/* ==========================================================
   KingdomCore — Shared Theme
   Mittelalterlich · Minecraft · Modern
========================================================== */

:root {
    /* === BASE === */
    --bg: #0a0a0c;
    --bg-deep: #050507;
    --bg-card: #15151a;
    --bg-card-hover: #1c1c22;
    --bg-elev: #1f1f26;
    --bg-overlay: rgba(8, 8, 12, 0.88);
    --border: #2a2a32;
    --border-strong: #353540;
    --border-gold: #4a3a1a;
    --border-gold-bright: #6a5a30;
    --text: #ebebef;
    --text-muted: #b4b4c2;
    --text-dim: #7a7a86;

    /* === GOLD / KINGDOM === */
    --gold: #d4af37;
    --gold-bright: #f2d16b;
    --gold-dim: #8a7a30;
    --gold-deep: #6b5318;
    --gold-grad: linear-gradient(135deg, #f2d16b 0%, #d4af37 50%, #8a7a30 100%);
    --gold-grad-text: linear-gradient(180deg, #f7e08f 0%, #d4af37 60%, #a8861a 100%);

    /* === BORDEAUX / ROT === */
    --bordeaux: #7a1f2c;
    --bordeaux-bright: #b03040;
    --bordeaux-deep: #4a0f1c;
    --red: #c0392b;
    --green: #27ae60;
    --emerald: #2ecc71;
    --emerald-dim: #1e7a44;

    /* === RÄNGE === */
    --r-buerger:  #9a9a9a;
    --r-ritter:   #f1c40f;
    --r-baron:    #e67e22;
    --r-herzog:   #16a085;
    --r-koenig:   #8e44ad;
    --r-kaiser:   #c0392b;
    --r-monarch:  #d4af37;

    /* === SHADOWS === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.85);
    --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.45);
    --shadow-glow-soft: 0 0 36px rgba(212, 175, 55, 0.18);
    --shadow-inset-pixel: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.6);

    /* === TIMING === */
    --t-fast: .15s;
    --t-med: .35s;
    --t-slow: .65s;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-bouncy: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* === Animated Background Layers ============================= */
body::before {
    /* Subtle radial gold glow + dark vignette */
    content: '';
    position: fixed;
    inset: -10vmax;
    background:
        radial-gradient(ellipse at 20% -10%, rgba(212, 175, 55, 0.08), transparent 50%),
        radial-gradient(ellipse at 90% 110%, rgba(122, 31, 44, 0.10), transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(10, 10, 12, 0) 0%, rgba(5, 5, 7, 0.95) 100%);
    z-index: -3;
    pointer-events: none;
}
body::after {
    /* Pixel-grid overlay — Minecraft Texture-Feel */
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: -2;
    pointer-events: none;
    animation: gridDrift 80s linear infinite;
}
@keyframes gridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(32px, 32px); }
}

/* === Floating Pixel Particles ============================== */
#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.pixel-particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    opacity: 0;
    animation: floatUp 14s linear infinite;
}
@keyframes floatUp {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: .7; }
    90%  { opacity: .5; }
    100% { transform: translateY(-110vh) translateX(40px); opacity: 0; }
}

a { color: var(--gold); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold-bright); }

h1, h2, h3, h4 { font-family: 'Cinzel', 'Trajan Pro', serif; font-weight: 700; letter-spacing: 0.5px; }
.font-pixel { font-family: 'Pixelify Sans', 'Press Start 2P', monospace; }

::selection { background: var(--gold); color: var(--bg-deep); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dim), var(--gold-deep));
    border: 2px solid var(--bg-deep);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===========================================================
   NAVBAR
=========================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px) saturate(140%);
    background: rgba(8, 8, 12, 0.82);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(212, 175, 55, 0.08);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.nav-logo {
    display: flex; align-items: center; gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 22px; font-weight: 700;
    color: var(--gold-bright);
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.2);
}
.nav-logo img { height: 36px; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5)); }
.kc-mark {
    width: 32px; height: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}
.kc-mark-xl {
    width: 96px; height: 96px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    animation: heroFloat 5s ease-in-out infinite;
    margin-bottom: 18px;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gold-bright);
    width: 40px; height: 40px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}
.nav-toggle:hover { background: rgba(212, 175, 55, 0.08); }
.nav-link {
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    transition: all var(--t-fast);
    position: relative;
}
.nav-link::after {
    content: ''; position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-med) var(--ease-out);
}
.nav-link:hover { color: var(--gold-bright); background: rgba(212, 175, 55, 0.05); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--gold-bright); background: rgba(212, 175, 55, 0.08); }
.nav-link.active::after { transform: scaleX(1); }

/* ===========================================================
   LAYOUT
=========================================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; position: relative; }
.section-title {
    font-size: 36px;
    text-align: center;
    margin-bottom: 12px;
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
    font-size: 16px;
}
.section-divider {
    height: 8px;
    background:
      repeating-linear-gradient(90deg, var(--gold-dim) 0 8px, transparent 8px 16px);
    opacity: .35;
    margin: 40px auto;
    max-width: 200px;
}

/* ===========================================================
   HERO
=========================================================== */
.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 60px 24px 100px;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('/img/banner.png');
    background-size: cover;
    background-position: center;
    opacity: .35;
    z-index: -1;
    filter: saturate(.7) brightness(.7);
    transform: translateZ(0);
    will-change: transform;
}
.hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background:
      linear-gradient(180deg, rgba(5,5,7,0.4) 0%, rgba(5,5,7,0.85) 70%, var(--bg-deep) 100%),
      radial-gradient(circle at center, transparent 30%, rgba(5,5,7,0.6) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 900px; animation: fadeInUp 1s var(--ease-out); }
.hero-logo {
    height: 120px; image-rendering: pixelated;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    animation: heroFloat 5s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-12px) rotate(1deg); }
}
.hero-title {
    font-size: clamp(48px, 8vw, 88px);
    line-height: 1;
    margin-bottom: 16px;
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
    letter-spacing: 2px;
}
.hero-subtitle {
    font-size: clamp(16px, 2.2vw, 20px);
    color: var(--text-muted);
    margin-bottom: 36px;
    max-width: 640px; margin-left: auto; margin-right: auto;
    min-height: 1.8em;
}
.hero-typewriter {
    font-family: 'Pixelify Sans', monospace;
    color: var(--gold-bright);
    border-right: 2px solid var(--gold);
    padding-right: 4px;
    animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink {
    50% { border-color: transparent; }
}

/* Server-IP Box */
.ip-box {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02));
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--t-med) var(--ease-out);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-inset-pixel);
}
.ip-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.18), transparent);
    transform: translateX(-100%);
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50%      { transform: translateX(100%); }
}
.ip-box:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-glow), var(--shadow-inset-pixel);
}
.ip-box .ip-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.ip-box .ip-value {
    font-family: 'Pixelify Sans', monospace;
    font-size: 22px;
    color: var(--gold-bright);
    font-weight: 700;
}
.ip-box .ip-copy-hint { font-size: 11px; color: var(--text-dim); }

/* Status-Dot */
.status-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
    margin-right: 6px;
    position: relative;
}
.status-dot.online {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}
.status-dot.online::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--emerald);
    opacity: .5;
    animation: ringPulse 2s ease-out infinite;
}
@keyframes ringPulse {
    0%   { transform: scale(.7); opacity: .8; }
    100% { transform: scale(2.4); opacity: 0; }
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }

.hero-stats {
    display: flex; justify-content: center; gap: 32px;
    margin-top: 28px; flex-wrap: wrap;
}
.hero-stat {
    text-align: center;
}
.hero-stat-value {
    font-family: 'Pixelify Sans', monospace;
    font-size: 32px;
    color: var(--gold-bright);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}
.hero-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ===========================================================
   BUTTONS
=========================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.10), rgba(212, 175, 55, 0.02));
    color: var(--gold-bright);
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--t-med) var(--ease-out);
    text-decoration: none;
    box-shadow: var(--shadow-inset-pixel);
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.18), transparent);
    transform: translateX(-100%);
    transition: transform var(--t-slow);
}
.btn:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    color: var(--bg-deep);
    background: var(--gold-grad);
    box-shadow: var(--shadow-glow);
}
.btn:hover::before { transform: translateX(100%); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gold-grad); color: var(--bg-deep); border-color: var(--gold-bright); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--border-gold);
    color: var(--gold-bright);
}

.btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ===========================================================
   CARDS
=========================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: all var(--t-med) var(--ease-out);
    position: relative;
    box-shadow: var(--shadow-md);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(212, 175, 55, 0.1);
}
.card-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.03));
    border: 1px solid var(--border-gold);
    margin-bottom: 16px;
    font-size: 24px;
    transition: all var(--t-med) var(--ease-out);
}
.card:hover .card-icon {
    transform: scale(1.1) rotate(-4deg);
    border-color: var(--gold);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
}
.card-title { font-size: 18px; margin-bottom: 6px; color: var(--gold-bright); }
.card-text { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* === 3D-Tilt-Wrapper === */
.tilt {
    transform-style: preserve-3d;
    transition: transform var(--t-fast) ease-out;
}
.tilt-inner {
    transform: translateZ(20px);
    transition: transform var(--t-fast);
}

/* === Pixel-Frame Card (MC-Style) === */
.card-pixel {
    background: var(--bg-card);
    border: 4px solid;
    border-image: linear-gradient(135deg, var(--gold-bright), var(--gold-dim)) 1;
    image-rendering: pixelated;
    box-shadow:
      inset 2px 2px 0 rgba(255, 255, 255, 0.08),
      inset -2px -2px 0 rgba(0, 0, 0, 0.6),
      0 8px 24px rgba(0, 0, 0, 0.7);
    padding: 24px;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }

/* ===========================================================
   RANK CARDS
=========================================================== */
.rank-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all var(--t-med) var(--ease-out);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.rank-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, var(--rank-color, var(--gold)) 0%, transparent 50%);
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity var(--t-med);
    pointer-events: none;
    z-index: 0;
}
.rank-card > * { position: relative; z-index: 1; }
.rank-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--rank-color, var(--gold));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 24px var(--rank-color, var(--gold));
}
.rank-card:hover::before { opacity: .15; }
.rank-icon-img {
    width: 64px; height: 64px;
    margin-bottom: 12px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 12px var(--rank-color, var(--gold)));
    transition: transform var(--t-med) var(--ease-bouncy);
}
.rank-card:hover .rank-icon-img { transform: scale(1.15) rotate(8deg); }
.rank-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--rank-color, var(--gold-bright));
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}
.rank-perks {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.rank-card.buerger  { --rank-color: var(--r-buerger); }
.rank-card.ritter   { --rank-color: var(--r-ritter); }
.rank-card.baron    { --rank-color: var(--r-baron); }
.rank-card.herzog   { --rank-color: var(--r-herzog); }
.rank-card.koenig   { --rank-color: var(--r-koenig); }
.rank-card.kaiser   { --rank-color: var(--r-kaiser); }
.rank-card.monarch  { --rank-color: var(--r-monarch); }

/* ===========================================================
   LIVE WIDGETS (Online-Players, Top, Next Event, News)
=========================================================== */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    position: relative;
    transition: border-color var(--t-med);
}
.widget:hover { border-color: var(--border-gold); }
.widget-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.widget-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.widget-tag {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(46, 204, 113, 0.15);
    color: var(--emerald);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.widget-tag.live::before {
    content: '●';
    margin-right: 4px;
    animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .3; } }

/* Online-Player-Heads */
.online-heads { display: flex; flex-wrap: wrap; gap: 8px; }
.head-tile {
    width: 40px; height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-elev);
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    position: relative;
    image-rendering: pixelated;
}
.head-tile img { width: 100%; height: 100%; image-rendering: pixelated; }
.head-tile:hover {
    transform: translateY(-3px) scale(1.1);
    border-color: var(--gold);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), 0 0 12px var(--gold);
    z-index: 10;
}
.head-tile-name {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-overlay);
    border: 1px solid var(--border-gold);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--gold-bright);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast);
}
.head-tile:hover .head-tile-name { opacity: 1; }
.head-tile.more {
    display: flex; align-items: center; justify-content: center;
    font-family: 'Pixelify Sans', monospace;
    color: var(--gold-bright);
    font-size: 14px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
}

/* Top-Player-Cards */
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all var(--t-fast) var(--ease-out);
}
.top-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
    transform: translateX(4px);
}
.top-rank-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Pixelify Sans', monospace;
    font-weight: 700;
    font-size: 13px;
}
.top-row.r1 .top-rank-badge { background: linear-gradient(135deg, #fdec64, #d4af37); color: #2a2208; box-shadow: 0 0 12px rgba(212, 175, 55, 0.65); }
.top-row.r2 .top-rank-badge { background: linear-gradient(135deg, #e8e8e8, #a8a8a8); color: #1a1a1a; }
.top-row.r3 .top-rank-badge { background: linear-gradient(135deg, #d4a373, #8b5a2b); color: #2a1505; }
.top-rank-badge { background: var(--bg-deep); color: var(--text-muted); }
.top-row img.head { width: 32px; height: 32px; border-radius: 4px; image-rendering: pixelated; }
.top-name { flex: 1; font-weight: 600; color: var(--text); }
.top-value { font-family: 'Pixelify Sans', monospace; color: var(--gold-bright); font-weight: 700; }

/* Next-Event Countdown */
.event-card {
    text-align: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06), rgba(122, 31, 44, 0.06));
    border: 1px solid var(--border-gold);
    border-radius: 12px;
}
.event-emoji { font-size: 36px; margin-bottom: 8px; display: block; }
.event-name {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    color: var(--gold-bright);
    margin-bottom: 6px;
}
.event-when {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
}
.countdown {
    display: flex; justify-content: center; gap: 8px;
}
.countdown-cell {
    background: var(--bg-deep);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 56px;
    text-align: center;
    box-shadow: var(--shadow-inset-pixel);
}
.countdown-num {
    font-family: 'Pixelify Sans', monospace;
    font-size: 26px;
    color: var(--gold-bright);
    font-weight: 700;
    display: block;
    line-height: 1;
}
.countdown-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* News */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
    padding: 12px 14px;
    background: var(--bg-elev);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    transition: all var(--t-fast) var(--ease-out);
}
.news-item:hover {
    transform: translateX(4px);
    background: var(--bg-card-hover);
    border-left-color: var(--gold-bright);
}
.news-date {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Pixelify Sans', monospace;
    margin-bottom: 4px;
}
.news-title {
    font-size: 14px;
    color: var(--gold-bright);
    font-weight: 600;
    margin-bottom: 4px;
}
.news-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ===========================================================
   LEADERBOARD
=========================================================== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; justify-content: center; }
.tab-btn {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--t-fast);
}
.tab-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
    color: var(--gold-bright);
}
.tab-btn.active {
    background: var(--gold-grad);
    color: var(--bg-deep);
    border-color: var(--gold-bright);
    box-shadow: var(--shadow-glow);
}
.lb-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.lb-row {
    display: flex; align-items: center;
    padding: 14px 20px;
    gap: 16px;
    transition: all var(--t-fast);
    border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.lb-rank {
    font-family: 'Pixelify Sans', monospace;
    font-size: 18px;
    color: var(--text-muted);
    min-width: 50px;
    font-weight: 700;
}
.lb-row.gold .lb-rank { color: var(--gold-bright); font-size: 22px; text-shadow: 0 0 10px var(--gold); }
.lb-row.silver .lb-rank { color: #d4d4d4; font-size: 20px; }
.lb-row.bronze .lb-rank { color: #cd7f32; font-size: 20px; }
.lb-avatar { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; }
.lb-name { flex: 1; font-weight: 600; }
.lb-value { font-family: 'Pixelify Sans', monospace; color: var(--gold-bright); font-weight: 700; font-size: 16px; }

/* ===========================================================
   PROFILE
=========================================================== */
.profile-header {
    display: flex; align-items: center; gap: 28px;
    flex-wrap: wrap;
    padding: 32px;
    background:
      linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(122, 31, 44, 0.04)),
      var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 50%, rgba(212, 175, 55, 0.12), transparent 50%);
    pointer-events: none;
}
.profile-avatar {
    width: 128px; height: 128px;
    max-width: 128px; max-height: 128px;
    flex-shrink: 0;
    border-radius: 12px;
    image-rendering: pixelated;
    box-shadow: 0 0 28px rgba(212, 175, 55, 0.4);
    border: 3px solid var(--gold);
    object-fit: cover;
}
.profile-name {
    font-size: 36px;
    margin-bottom: 6px;
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rank-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px;
    background: var(--rank-color, var(--gold-grad));
    color: var(--bg-deep);
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 0 16px var(--rank-color, var(--gold));
    max-width: fit-content;
    width: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all var(--t-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}
.stat-tile::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0; height: 2px;
    background: var(--gold-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-med) var(--ease-out);
}
.stat-tile:hover {
    transform: translateY(-3px);
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
}
.stat-tile:hover::after { transform: scaleX(1); }
.stat-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.stat-value {
    font-family: 'Pixelify Sans', monospace;
    font-size: 26px;
    color: var(--gold-bright);
    font-weight: 700;
    line-height: 1.1;
}
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 6px;
}

/* ===========================================================
   ACHIEVEMENT-GRID (Profil)
=========================================================== */
.ach-tabs {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.ach-tab {
    padding: 6px 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex; align-items: center; gap: 6px;
}
.ach-tab:hover { background: var(--bg-card-hover); border-color: var(--border-gold); color: var(--gold-bright); }
.ach-tab.active {
    background: var(--gold-grad);
    color: var(--bg-deep);
    border-color: var(--gold-bright);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}
.ach-tab-count {
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-family: 'Pixelify Sans', monospace;
}
.ach-tab.active .ach-tab-count { background: rgba(0, 0, 0, 0.35); }

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.ach-badge {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.10), rgba(212, 175, 55, 0.02));
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    transition: all var(--t-fast) var(--ease-out);
    cursor: default;
}
.ach-badge:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}
.ach-emoji { font-size: 22px; flex-shrink: 0; }
.ach-id {
    font-size: 12px;
    color: var(--text);
    font-family: 'Pixelify Sans', monospace;
    text-transform: capitalize;
}

/* ===========================================================
   FORMS / LOGIN
=========================================================== */
.form-card {
    max-width: 460px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold-grad);
}
.form-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 8px;
    background: var(--gold-grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.form-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Pixelify Sans', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    text-align: center;
    transition: all var(--t-fast);
    margin-bottom: 16px;
}
.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.form-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.step {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    transition: all var(--t-fast);
}
.step:hover { background: var(--bg-card-hover); }
.step-num {
    width: 24px; height: 24px;
    background: var(--gold-grad);
    color: var(--bg-deep);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Pixelify Sans', monospace;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.step code {
    font-family: 'Pixelify Sans', monospace;
    color: var(--gold-bright);
    background: var(--bg-deep);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===========================================================
   RULES / TEXT-HEAVY PAGES
=========================================================== */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--rule-color, var(--gold));
    border-radius: 10px;
    padding: 22px;
    transition: all var(--t-med) var(--ease-out);
}
.rule-card:hover {
    transform: translateX(4px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}
.rule-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.rule-title {
    font-size: 18px;
    color: var(--gold-bright);
    margin-bottom: 8px;
}
.rule-text { color: var(--text-muted); font-size: 14px; line-height: 1.65; }
.rule-text ul { margin: 8px 0 0 16px; }
.rule-text li { margin: 4px 0; }

/* ===========================================================
   TOASTS
=========================================================== */
.toast-host {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 1000;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 14px 20px;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    animation: toastSlide .4s var(--ease-bouncy);
    min-width: 220px;
}
.toast.success { border-left: 3px solid var(--emerald); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--gold); }
@keyframes toastSlide {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===========================================================
   SCROLL REVEAL
=========================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1)  { transition-delay: 0ms;   }
.reveal-stagger.in > *:nth-child(2)  { transition-delay: 80ms;  }
.reveal-stagger.in > *:nth-child(3)  { transition-delay: 160ms; }
.reveal-stagger.in > *:nth-child(4)  { transition-delay: 240ms; }
.reveal-stagger.in > *:nth-child(5)  { transition-delay: 320ms; }
.reveal-stagger.in > *:nth-child(6)  { transition-delay: 400ms; }
.reveal-stagger.in > *:nth-child(7)  { transition-delay: 480ms; }

/* ===========================================================
   ANIMATIONS
=========================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* ===========================================================
   UTILS
=========================================================== */
.text-gold { color: var(--gold-bright); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

.footer {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--gold-bright); }

/* ===========================================================
   RESPONSIVE (Tablet + Phone)
=========================================================== */

/* === Tablet (≤1024px) === */
@media (max-width: 1024px) {
    .nav-inner { padding: 12px 20px; }
    .nav-link { padding: 7px 10px; font-size: 13px; }
    .container { padding: 0 20px; }
    .section { padding: 64px 0; }
    .hero { min-height: 78vh; padding: 50px 20px 80px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .widgets-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .rules-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: clamp(40px, 7vw, 72px); }
}

/* === Phone Landscape & kleines Tablet (≤768px) === */
@media (max-width: 768px) {
    body::after { background-size: 24px 24px; }
    .navbar { backdrop-filter: blur(6px); }
    .nav-inner {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
        position: relative;
    }
    .nav-logo { font-size: 18px; gap: 8px; }
    .nav-logo img, .kc-mark { width: 28px; height: 28px; }
    .nav-toggle { display: inline-flex; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 0 4px;
        border-top: 1px solid var(--border);
        margin-top: 8px;
    }
    .nav-links.open { display: flex; }
    .nav-link {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 6px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .nav-link::after { display: none; }

    .container { padding: 0 14px; }
    .section { padding: 48px 0; }
    .section-title { font-size: 28px; }
    .section-subtitle { font-size: 14px; margin-bottom: 32px; }

    .hero { min-height: 70vh; padding: 32px 16px 60px; }
    .kc-mark-xl { width: 72px; height: 72px; margin-bottom: 12px; }
    .hero-title { font-size: clamp(36px, 10vw, 56px); letter-spacing: 1px; }
    .hero-subtitle { font-size: 14px; min-height: 1.6em; }
    .hero-typewriter { display: inline-block; min-width: 90px; text-align: left; }

    .ip-box { padding: 12px 18px; gap: 10px; flex-wrap: wrap; justify-content: center; }
    .ip-box .ip-value { font-size: 18px; }
    .ip-box .ip-copy-hint { font-size: 10px; width: 100%; text-align: center; }

    .hero-stats { gap: 18px; }
    .hero-stat-value { font-size: 24px; }
    .hero-stat-label { font-size: 10px; }

    .btn { padding: 14px 22px; font-size: 13px; min-height: 48px; }
    .btn-row { gap: 10px; }

    .grid-2, .grid-3, .grid-4, .widgets-grid, .stats-grid, .rules-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card { padding: 20px; }
    .card-icon { width: 40px; height: 40px; font-size: 20px; }
    .card-title { font-size: 16px; }
    .card-text { font-size: 13px; }

    .widget { padding: 18px; }
    .head-tile { width: 44px; height: 44px; }
    .countdown-cell { padding: 8px 10px; min-width: 48px; }
    .countdown-num { font-size: 22px; }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 16px;
    }
    .profile-avatar { width: 96px; height: 96px; }
    .profile-name { font-size: 28px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-tile { padding: 16px 12px; }
    .stat-value { font-size: 22px; }
    .stat-icon { font-size: 24px; }

    .lb-row { padding: 12px 14px; gap: 10px; }
    .lb-rank { min-width: 36px; font-size: 16px; }
    .lb-avatar { width: 28px; height: 28px; }
    .lb-value { font-size: 14px; }

    .tabs { gap: 4px; }
    .tab-btn { padding: 10px 14px; font-size: 12px; min-height: 44px; }

    .form-card { margin: 32px auto; padding: 28px 20px; }
    .form-title { font-size: 24px; }
    .form-input { font-size: 16px; padding: 14px; letter-spacing: 1px; }

    .rule-card { padding: 18px; }
    .rule-title { font-size: 16px; }

    .footer { padding: 32px 16px; font-size: 12px; }
}

/* === Phone (≤480px) === */
@media (max-width: 480px) {
    .hero-title { font-size: clamp(32px, 12vw, 48px); }
    .grid-2, .grid-3, .grid-4, .widgets-grid, .rules-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { gap: 12px; }
    .hero-stat { flex: 0 0 calc(50% - 6px); }

    .ip-box .ip-value { font-size: 16px; word-break: break-all; }
    .countdown { gap: 6px; }
    .countdown-cell { padding: 6px 8px; min-width: 42px; }
    .countdown-num { font-size: 20px; }

    .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .tab-btn { white-space: nowrap; }
}

/* === Touch Devices: Tilt + Parallax disable === */
@media (hover: none) and (pointer: coarse) {
    .tilt:hover { transform: none !important; }
    .head-tile:hover { transform: none; }
    .card:hover { transform: none; }
    .rank-card:hover { transform: none; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
