/* Alissa Valley – Basis, Hauptmenü, Unterseiten, Footer */
:root {
  --ui-scale: 1;
  --bg: #16241f;
  --ink: #f6ecd6;
  --ink-dim: #cbbfa6;
  --muted: #a99c86;
  --panel: rgba(36, 28, 44, 0.94);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 236, 200, 0.14);
  --gold: #f2c94c;
  --green: #7cc45a;
  --green-d: #4e9a3a;
  --coral: #e8735a;
  --sky: #7fc8f0;
  --plum: #2b2233;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(10, 6, 20, 0.45);
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select { -webkit-user-select: text; user-select: text; font-family: inherit; }
canvas#game { position: fixed; inset: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
img { image-rendering: pixelated; }
a { color: var(--gold); }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; margin-right: .3em; border-radius: 5px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-bottom-width: 2px; font: 700 .8em/1.5 var(--font); text-align: center; color: #fff; }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; font: 700 calc(15px * var(--ui-scale)) / 1.2 var(--font); color: var(--ink); background: linear-gradient(180deg, #4a3d58, #3a2f46); padding: .75em 1.2em; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 0 #1f1828, 0 6px 14px rgba(0,0,0,.25); transition: transform .08s, filter .15s, box-shadow .08s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4em; letter-spacing: .01em; }
.btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 0 #1f1828; }
.btn:focus-visible, .chip:focus-visible, .slot:focus-visible, .swatch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #8fd16a, #5ea24c); color: #14240f; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 0 #2f5a26, 0 6px 14px rgba(0,0,0,.25); }
.btn.danger { background: linear-gradient(180deg, #e8735a, #c4513c); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 #6e2a1e; }
.btn.ghost { background: transparent; box-shadow: none; border: 1px solid var(--line); }
.btn.small { padding: .5em .85em; font-size: calc(13.5px * var(--ui-scale)); border-radius: 10px; }
.btn.big { font-size: calc(18px * var(--ui-scale)); padding: .85em 1.4em; }
.icon-btn { appearance: none; border: 0; background: rgba(255,255,255,.08); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 18px; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,.16); }
.linklike { background: none; border: 0; color: var(--ink-dim); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: .45em .8em; border-radius: 999px; font: 600 13px var(--font); cursor: pointer; }
.chip.active, .chip:hover { background: rgba(124,196,90,.22); border-color: rgba(124,196,90,.6); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.warn { color: #ffb08a; } .note { color: var(--sky); }

/* Screens */
.screen { position: fixed; inset: 0; display: none; z-index: 30; }
.screen.active { display: flex; }

/* Laden */
#loading { z-index: 100; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #24402f, #0f1a15); }
.loading-inner { text-align: center; width: min(360px, 80vw); }
.loading-title { font-size: 34px; font-weight: 900; letter-spacing: .06em; color: #ffe9a8; text-shadow: 0 3px 0 #7a3d2a; margin-bottom: 22px; }
.loading-bar { height: 12px; border-radius: 8px; background: rgba(255,255,255,.1); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
#loading-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5ea24c, #a8e86a); transition: width .25s; }
#loading-text { margin-top: 12px; color: var(--ink-dim); font-size: 14px; }

/* Hauptmenü */
#menu { flex-direction: column; align-items: center; justify-content: space-between; background: linear-gradient(90deg, rgba(14,10,24,.72) 0%, rgba(14,10,24,.35) 38%, rgba(14,10,24,0) 60%), linear-gradient(0deg, rgba(14,10,24,.75), rgba(14,10,24,0) 35%); overflow-y: auto; touch-action: pan-y; }
.menu-inner { align-self: flex-start; margin: max(4vh, 20px) 0 0 max(5vw, 18px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min(380px, 90vw); }
#logo { width: min(360px, 86vw); height: auto; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); animation: logoFloat 5s ease-in-out infinite; }
@keyframes logoFloat { 50% { transform: translateY(-5px); } }
.tagline { margin: 0 0 14px 4px; color: var(--ink-dim); font-weight: 600; letter-spacing: .03em; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.menu-buttons .btn { justify-content: flex-start; width: 100%; padding-left: 1.2em; background: linear-gradient(180deg, rgba(74,61,88,.92), rgba(58,47,70,.92)); backdrop-filter: blur(4px); }
.menu-buttons .btn.primary { background: linear-gradient(180deg, #8fd16a, #5ea24c); }
.save-info { margin-top: 12px; font-size: 13px; color: var(--ink-dim); background: rgba(20,14,30,.6); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); line-height: 1.5; }

/* Footer */
.site-footer { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; padding: 16px max(5vw, 18px) calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(14,10,24,.92), rgba(14,10,24,.6)); border-top: 1px solid var(--line); font-size: 13px; }
.site-footer h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; padding: 4px 0; }
.foot-links a span { color: var(--muted); font-size: 12px; }
.foot-links a:hover b { color: var(--gold); text-decoration: underline; }
.foot-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.site-footer.compact { position: static; flex: none; }

/* Unterseiten */
#page { align-items: center; justify-content: center; background: rgba(10,6,20,.55); backdrop-filter: blur(3px); z-index: 40; flex-direction: column; }
#page.in-game .site-footer { display: none; }
.page-card { width: min(860px, 94vw); max-height: calc(100vh - 180px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); margin: auto; min-height: 0; }
#page { padding-top: 14px; }
#page.in-game .page-card { max-height: 92vh; }
@media (max-height: 720px) { #page .site-footer.compact { display: none; } .page-card { max-height: 94vh; } }
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.page-head h2 { margin: 0; font-size: 22px; }
.page-body { padding: 18px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.legal h3 { margin: 18px 0 6px; color: var(--gold); font-size: 16px; }
.legal p, .legal li { line-height: 1.6; color: var(--ink-dim); }
.legal .note { background: rgba(127,200,240,.1); border: 1px solid rgba(127,200,240,.3); padding: 10px 12px; border-radius: 10px; color: var(--sky); }
.keys { border-collapse: collapse; width: 100%; } .keys td { padding: 6px 8px; border-bottom: 1px solid var(--line); } .keys td:first-child { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* Weitere Spiele */
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.game-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.game-card h3 { margin: 6px 0 0; } .game-card p { margin: 0 0 8px; color: var(--ink-dim); flex: 1; line-height: 1.5; }
.gc-logo { height: 120px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 -20px 40px rgba(0,0,0,.25); }
.gc-logo span { font-size: 46px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); } .gc-logo b { font-size: 20px; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0,0,0,.3); }

/* Charaktererstellung */
.create-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 22px; }
.create-preview { display: flex; flex-direction: column; align-items: center; background: radial-gradient(circle at 50% 60%, #4f8f45, #2f5a2a); border-radius: 16px; padding: 18px; border: 1px solid var(--line); align-self: start; }
.preview-canvas { width: 128px; height: 192px; image-rendering: pixelated; }
.create-form { display: flex; flex-direction: column; gap: 8px; }
.create-form label { font-weight: 700; font-size: 14px; margin-top: 4px; }
.create-form input[type=text], select { background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.create-form input[type=text]:focus, select:focus { outline: 2px solid var(--green); }
.swatch-groups { display: flex; flex-direction: column; gap: 10px; margin: 6px 0; }
.swatch-group > span { font-size: 13px; color: var(--ink-dim); display: block; margin-bottom: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 2px solid rgba(255,255,255,.2); cursor: pointer; color: var(--ink); background: var(--panel-2); font: 600 11px var(--font); }
.swatch.wide { width: auto; padding: 0 10px; }
.swatch:not([style]) { width: auto; min-width: 44px; padding: 0 8px; }
.swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,201,76,.4); }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }

/* Einstellungen */
.set-sec { margin-bottom: 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 12px; }
.set-sec h3 { margin: 10px 0 8px; font-size: 16px; }
.set-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1.4fr) 56px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.set-row > :nth-child(2):last-child { grid-column: 2 / 4; justify-self: start; }
.set-val { color: var(--gold); font-weight: 700; font-size: 13px; text-align: right; }
input[type=range] { width: 100%; accent-color: var(--green); }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(255,255,255,.15); border-radius: 26px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green-d); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--gold); }

#fade { position: fixed; inset: 0; background: #0b0812; opacity: 0; pointer-events: none; transition: opacity .4s; z-index: 90; }
#fade.on { opacity: 1; }

@media (max-width: 700px) {
  .menu-inner { margin: 18px auto 0; align-self: center; align-items: center; }
  .tagline { margin-left: 0; text-align: center; }
  .site-footer { grid-template-columns: 1fr; font-size: 12px; }
  .create-wrap { grid-template-columns: 1fr; }
  .create-preview { flex-direction: row; justify-content: center; gap: 12px; }
  .preview-canvas { width: 80px; height: 120px; }
  .set-row { grid-template-columns: 1fr 1fr; }
  .set-row .set-val { display: none; }
  .page-card { max-height: 86vh; margin-bottom: 0; }
  #page .site-footer.compact { display: none; }
}
@media (prefers-reduced-motion: reduce) { #logo { animation: none; } * { transition: none !important; } }
