/* =========================================================================
   Arkonia – Stylesheet
   Dunkles Fantasy-Theme mit Pergament-Tafeln (angelehnt an das Original).
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=EB+Garamond:ital@0;1&display=swap');

:root {
    --bg:        #1a140d;
    --bg-2:      #241a10;
    --panel:     #2d2114;
    --panel-2:   #3a2c1a;
    --parchment: #e9dcc3;
    --parchment-2: #f3ead2;
    --ink:       #2c2417;
    --gold:      #d8af55;
    --gold-soft: #b8923f;
    --border:    #5a4628;
    --border-lt: #6f572f;
    --text:      #e7dcc6;
    --text-dim:  #b3a585;
    --hp:        #b1372f;
    --hp-2:      #d6564a;
    --mana:      #2f5caa;
    --mana-2:    #3f78d6;
    --energy:    #c8a72e;
    --rage:      #b1372f;
    --xp:        #7a4ca0;
    --xp-2:      #9c66c6;
    --ok:        #4f7a3a;
    --err:       #9c3b2e;
    --shadow:    0 6px 22px rgba(0,0,0,.45);
    /* Fluid: skaliert mit der Viewport-Breite; bei 2560px ≈ Originalwerte (340/170),
       schrumpft auf 1080p proportional, wächst auf 4K mit. */
    --sidebar-w: clamp(258px, 14.5vw, 520px);
    --adslot-w:  clamp(140px, 6.6vw, 260px);
    /* Höhenbudget außerhalb der Karte = Topbar/Ränder (120px) + Chat-Streifen.
       So füllt das Spielfeld exakt --play-h und endet bündig am Chat – ohne Scrollen. */
    --map-budget: calc(120px + var(--chat-h));
    --chat-h: clamp(116px, 17vh, 188px); /* Höhe des Chat-Streifens unten */
    /* Gemeinsame Höhe für Charakter-, Spiel- und Auftragsfenster:
       die verfügbare Höhe vom Topbar bis zum Chat-Streifen. Karte & Aufträge füllen sie ganz aus. */
    --play-h: max(300px, calc(100vh - 100px - var(--chat-h)));
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 50% -10%, #3a2a18 0%, transparent 60%),
        linear-gradient(180deg, #1d160d 0%, #120d08 100%);
    background-attachment: fixed;
    min-height: 100vh;
    /* Fluid: ~17px bei 2560px, Lesbarkeits-Untergrenze 15px, wächst auf 4K bis 25px. */
    font-size: clamp(15px, 0.66vw, 25px);
    line-height: 1.55;
}

h1, h2, h3, .brand__title { font-family: 'Cinzel', Georgia, serif; letter-spacing: .5px; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: #f0cd7a; text-decoration: underline; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block; cursor: pointer; border: 1px solid var(--border-lt);
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    color: var(--text); font-family: 'Cinzel', serif; font-size: 15px;
    padding: 10px 18px; border-radius: 6px; transition: all .15s ease;
    text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.btn:hover { border-color: var(--gold); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn--primary {
    background: linear-gradient(180deg, #caa24c, #9b7a31);
    color: #2a1f0c; border-color: #e6c878; font-weight: 700;
}
.btn--primary:hover { background: linear-gradient(180deg, #e0b659, #b08c3a); color: #1a1206; }
.btn--ghost { background: transparent; }
.btn--lg { font-size: 18px; padding: 13px 26px; }
.btn--block { display: block; width: 100%; }
.btn--xs { font-size: 10px; padding: 3px 7px; }
.btn--sm { font-size: 12px; padding: 5px 10px; }
.btn--danger { border-color: #9c3b2e; color: #e6a99c; }
.btn--danger:hover { background: #9c3b2e; color: #fff; border-color: #c25; }
.btn--plus { width: 30px; height: 30px; font-size: 18px; padding: 0; line-height: 1; }

/* ---------------- Flash ---------------- */
.flash {
    border-radius: 6px; padding: 11px 16px; margin: 0 0 16px;
    border: 1px solid var(--border-lt); background: var(--panel);
}
.flash--success { border-color: #6f9a54; background: #2c3a22; color: #d9eccb; }
.flash--error   { border-color: #b85543; background: #3a221d; color: #f0cabf; }
.flash--info    { border-color: var(--gold-soft); background: #332710; color: #f1e2bc; }

/* ============================ GAST-LAYOUT ============================ */
.guest-wrap { max-width: 560px; margin: 0 auto; padding: 40px 20px 60px; }
.guest-wrap--wide { max-width: 1000px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand__link { display: inline-flex; align-items: center; gap: 12px; font-size: 34px; color: var(--gold); }
.brand__link:hover { text-decoration: none; }
.brand__sigil { font-size: 30px; filter: drop-shadow(0 0 6px rgba(216,175,85,.5)); }
.brand__title { color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.brand__subtitle { text-align: center; color: var(--text-dim); margin: 6px 0 0; font-style: italic; }
.guest-footer { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 36px; }

/* SPA-Modus: Login / Register – kein Scrollen, Formular vertikal zentriert */
body.guest.spa-layout { height: 100vh; overflow: hidden; }
body.guest.spa-layout .guest-wrap {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 560px;
}
body.guest.spa-layout .brand { flex-shrink: 0; padding: 16px 0 0; margin-bottom: 0; }
body.guest.spa-layout .flash { flex-shrink: 0; margin: 8px 0 0; }
body.guest.spa-layout .guest-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
body.guest.spa-layout .guest-footer { flex-shrink: 0; margin-top: 0; padding: 10px 0; }

/* Hero */
.hero { text-align: center; }
.hero__lore {
    background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--gold-soft);
    padding: 18px 22px; border-radius: 6px; text-align: left; font-size: 18px; box-shadow: var(--shadow);
}
.hero__lead { color: var(--text-dim); font-size: 18px; margin: 22px 8px; }
.hero__actions { display: flex; gap: 14px; justify-content: center; margin: 26px 0 34px; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 18px 14px; }
.feature__icon { font-size: 30px; display: block; margin-bottom: 6px; }
.feature h3 { margin: 4px 0 6px; color: var(--gold); font-size: 18px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* Card (Formulare) */
.card {
    background: linear-gradient(180deg, var(--parchment-2), var(--parchment));
    color: var(--ink); border: 1px solid var(--border-lt); border-radius: 8px;
    padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.card__title { margin: 0 0 18px; color: #4a3a1d; text-align: center; }
.card__foot { text-align: center; margin: 16px 0 0; color: #5b4a2c; }
.card__foot a { color: #7a5a1d; }

/* Felder */
.form .field { display: block; margin-bottom: 15px; }
.field__label { display: block; font-weight: 700; color: #4a3a1d; margin-bottom: 5px; font-size: 15px; }
.field__input {
    width: 100%; padding: 10px 12px; border: 1px solid #b59b6a; border-radius: 5px;
    background: #fffdf6; color: #2c2417; font-family: inherit; font-size: 16px;
}
.field__input:focus { outline: none; border-color: var(--gold-soft); box-shadow: 0 0 0 3px rgba(184,146,63,.25); }
.field__hint { color: #7a6a48; font-size: 13px; }
.field--inline { margin-bottom: 4px; }

/* Vom JS gesteuerte Sichtbarkeit */
.is-hidden { display: none !important; }

/* Toasts */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
    min-width: 220px; max-width: 360px; padding: 11px 16px; border-radius: 8px; color: #fff;
    font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.5); opacity: 0; transform: translateX(30px);
    transition: opacity .3s, transform .3s; border: 1px solid rgba(255,255,255,.12);
}
.toast.is-in { opacity: 1; transform: translateX(0); }
.toast--ok  { background: linear-gradient(180deg, #3c6a2c, #2c5020); }
.toast--err { background: linear-gradient(180deg, #8a3326, #6a261c); }

/* Hinweis / Info */
.hint { font-size: 14px; color: var(--text-dim); }
.hint--gold { color: var(--gold); }

/* Session-Sperre */
.session-lock {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(8, 6, 3, .82); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: session-fade .25s ease;
}
@keyframes session-fade { from { opacity: 0; } to { opacity: 1; } }
.session-lock__box {
    max-width: 460px; width: 100%; text-align: center;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 2px solid var(--gold-soft); border-radius: 12px;
    padding: 32px 34px; box-shadow: 0 12px 48px rgba(0, 0, 0, .75);
}
.session-lock__icon { font-size: 48px; line-height: 1; filter: drop-shadow(0 0 10px rgba(216,175,85,.4)); }
.session-lock__title { font-family: 'Cinzel', serif; color: var(--gold); font-size: 23px; margin: 14px 0 10px; }
.session-lock__msg { color: var(--text); font-size: 16px; line-height: 1.5; margin-bottom: 22px; }

/* Footer & Rechtliches */
.legal-links {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
    margin-bottom: 6px;
}
.legal-links a { color: var(--text-dim); font-size: clamp(13px, 0.3vw + 12px, 15px); }
.legal-links a:hover { color: var(--gold); }

.legal {
    max-width: 760px; margin: 0 auto; text-align: left;
    background: var(--panel); border: 1px solid var(--border-lt);
    border-radius: 8px; padding: 22px 26px; box-shadow: var(--shadow);
}
.legal h1 { color: var(--gold); margin-top: 0; }
.legal h2 { color: var(--gold-soft); font-size: 1.15em; margin: 1.2em 0 .3em; }
.legal p { margin: .4em 0; }
.legal ul { margin: .4em 0 .6em; padding-left: 1.3em; }
.legal li { margin: .25em 0; }
.legal strong { color: var(--gold-soft); }
.legal em { color: var(--text-dim); }
.legal__note { color: var(--text-dim); font-style: italic; font-size: .9em; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 16px; }

/* LESBARKEIT & RESPONSIVITÄT – Basisschriften skalieren */
body { font-size: clamp(18px, 0.5vw + 16px, 23px); }
.btn                  { font-size: clamp(15px, 0.45vw + 13px, 18px); }
.btn--sm              { font-size: clamp(14px, 0.35vw + 12px, 16px); }

/* Rarity badges */
.rarity { font-size: .75rem; padding: 1px 6px; border-radius: 3px; }
.rarity--1 { color: #9ca3af; }
.rarity--2 { color: #22c55e; }
.rarity--3 { color: #3b82f6; }
.rarity--4 { color: #a855f7; }
.rarity--5 { color: #f97316; }
