/* Spielesammlung — Design-System
   Dunkler Spiel-Look, eine Akzentfarbe (Punkti-Gelb), glossy runde Kacheln */

:root {
    --bg: #12101a;
    --bg-2: #1a1626;
    --surface: #211c31;
    --surface-2: #2b2444;
    --ink: #f4f1fa;
    --ink-2: #b9b3c9;
    --gelb: #f7cf1f;
    --gelb-dunkel: #c9a506;
    --rot: #ff6b7a;
    --gruen: #5fc9a8;
    --hairline: rgba(255, 255, 255, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

body {
    background:
        radial-gradient(circle at 15% 10%, rgba(247, 207, 31, 0.07), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(138, 106, 216, 0.12), transparent 50%),
        var(--bg);
    min-height: 100vh;
}

#app { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }

h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.01em; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: 0.45; cursor: default; }

input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--hairline);
    background: rgba(255, 255, 255, 0.07);
    color: var(--ink);
    font: inherit;
    outline: none;
}
input:focus { border-color: var(--gelb); box-shadow: 0 0 0 3px rgba(247, 207, 31, 0.25); }
input::placeholder { color: var(--ink-2); }

/* ---------- Buttons ---------- */

.ss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 17px;
    transition: transform 0.08s ease, box-shadow 0.15s ease;
    user-select: none;
}
.ss-btn:active:not(:disabled) { transform: scale(0.97); }

.ss-btn-primary {
    background: linear-gradient(180deg, #ffe27a, var(--gelb) 55%, #e8bc0e);
    color: #2a2100;
    box-shadow: 0 6px 18px rgba(247, 207, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.ss-btn-secondary {
    background: var(--surface-2);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.ss-btn-ghost { color: var(--ink-2); min-height: 48px; }
.ss-btn-big { width: 100%; }
.ss-btn-klein { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }

.ss-back {
    color: var(--ink-2);
    font-weight: 600;
    font-size: 15px;
    min-height: 44px;
    padding: 0 4px;
}

.ss-fehler { color: var(--rot); font-weight: 600; margin: 4px 0 0; }

/* ---------- Start / Anmeldung ---------- */

.ss-start {
    min-height: calc(100vh - 68px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 24px 8px;
}
.ss-start-punkti { width: 110px; height: 110px; filter: drop-shadow(0 10px 24px rgba(247, 207, 31, 0.35)); }
.ss-start-punkti svg { width: 100%; height: 100%; }
.ss-title { font-size: 34px; margin: 0; }
.ss-sub { color: var(--ink-2); margin: 0 0 12px; }
.ss-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Allgemeine Bildschirme ---------- */

.ss-screen { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.ss-h1 { font-size: 26px; }

.ss-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ss-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ss-chip-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3); }

/* ---------- Profile ---------- */

.ss-profiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ss-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 12px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 45%), var(--surface);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    transition: transform 0.1s ease;
}
.ss-profile:active { transform: scale(0.97); }
.ss-profile-dot {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.28), inset 0 3px 6px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
}
.ss-profile-plus {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px dashed var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--ink-2);
}
.ss-profile-name { font-weight: 700; }

.ss-newprofil { display: flex; flex-direction: column; gap: 14px; }
.ss-farben { display: flex; flex-wrap: wrap; gap: 12px; }
.ss-farbe {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    border: 3px solid transparent;
}
.ss-farbe.is-wahl { border-color: var(--ink); }

/* ---------- Lobby ---------- */

.ss-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ss-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%), var(--surface);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: left;
    min-height: 168px;
    transition: transform 0.1s ease;
}
.ss-tile:active { transform: scale(0.97); }
.ss-tile-icon { width: 56px; height: 56px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.ss-tile-icon svg { width: 100%; height: 100%; }
.ss-tile-name { font-size: 19px; font-weight: 800; }
.ss-tile-desc { color: var(--ink-2); font-size: 14px; line-height: 1.35; flex: 1; }
.ss-tile-stars { color: var(--gelb); font-weight: 800; font-size: 15px; }

.ss-gast-hinweis { color: var(--ink-2); font-size: 14px; text-align: center; }

/* ---------- Spiel: Setup ---------- */

.ss-game-mount { display: flex; flex-direction: column; min-height: calc(100vh - 68px); }
.ss-setup { display: flex; flex-direction: column; gap: 18px; }
.ss-setup-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.ss-setup-head svg { width: 90px; height: 90px; filter: drop-shadow(0 8px 20px rgba(247, 207, 31, 0.3)); }
.ss-setup-head p { color: var(--ink-2); margin: 0; max-width: 420px; }

.ss-levels { display: flex; flex-direction: column; gap: 12px; }
.ss-level {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%), var(--surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: left;
    transition: transform 0.1s ease;
}
.ss-level:active { transform: scale(0.98); }
.ss-level-name { font-size: 19px; font-weight: 800; }
.ss-level-detail { color: var(--ink-2); font-size: 14px; }
.ss-level-meta { color: var(--gelb); font-weight: 700; font-size: 14px; margin-top: 2px; }

/* ---------- Punkti Minus: Spiel ---------- */

.pm-game { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.pm-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.pm-progress { color: var(--ink-2); font-weight: 600; font-size: 14px; }

.pm-status { display: flex; align-items: center; gap: 14px; }
.pm-punkti { width: 64px; height: 64px; flex: none; }
.pm-punkti svg { width: 100%; height: 100%; }
.pm-punkti-big { width: 120px; height: 120px; filter: drop-shadow(0 10px 26px rgba(247, 207, 31, 0.35)); }
.pm-say {
    margin: 0;
    background: var(--surface);
    border-radius: 16px;
    padding: 12px 16px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    min-height: 48px;
    flex: 1;
}

.pm-task {
    margin: 0;
    text-align: center;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.pm-eq-result { color: var(--gelb); }

.pm-field {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 26px rgba(0, 0, 0, 0.3);
}
.pm-dot {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid #3a3450;
    position: relative;
}
.pm-dot.is-yellow {
    border-color: var(--gelb-dunkel);
    background: radial-gradient(circle at 32% 30%, #ffe27a, var(--gelb) 62%, #d9ae0c);
}
.pm-dot.is-out { opacity: 0.55; }
.pm-dot.is-out::before,
.pm-dot.is-out::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 118%;
    height: 3px;
    border-radius: 2px;
    background: #251f21;
    animation: pm-strike 0.18s ease-out;
}
.pm-dot.is-out::before { transform: translate(-50%, -50%) rotate(45deg); }
.pm-dot.is-out::after { transform: translate(-50%, -50%) rotate(-45deg); }
@keyframes pm-strike { from { transform: translate(-50%, -50%) scale(0.4) rotate(45deg); } }

.pm-controls { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.pm-hint { color: var(--ink-2); text-align: center; margin: 0; min-height: 24px; }

.pm-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
}
.pm-key {
    min-height: 60px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 55%), var(--surface-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-size: 26px;
    font-weight: 800;
    transition: transform 0.06s ease;
}
.pm-key:active { transform: scale(0.94); }
.pm-key-ok {
    background: linear-gradient(180deg, #ffe27a, var(--gelb) 55%, #e8bc0e);
    color: #2a2100;
    box-shadow: 0 4px 12px rgba(247, 207, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- Punkti Minus: Schluss ---------- */

.pm-done {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 24px 0;
}
.pm-done h1 { font-size: 32px; }
.pm-done-text { color: var(--ink-2); margin: 0; font-size: 18px; }
.pm-done-stars { color: var(--gelb); font-size: 34px; letter-spacing: 0.12em; margin: 0 0 10px; text-shadow: 0 0 18px rgba(247, 207, 31, 0.45); }
.pm-done-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }

/* ---------- kleine Screens (iPhone SE) ---------- */

@media (max-width: 340px) {
    .pm-task { font-size: 36px; }
    .pm-field { gap: 4px; padding: 10px; }
    .pm-key { min-height: 54px; font-size: 22px; }
    .ss-tiles { gap: 10px; }
    .ss-tile { min-height: 150px; padding: 14px; }
}

/* ---------- flache Screens: alles ohne Scrollen erreichbar ---------- */

@media (max-height: 740px) {
    #app { padding-top: 4px; padding-bottom: 12px; }
    .pm-game { gap: 8px; }
    .pm-top { min-height: 32px; }
    .pm-punkti { width: 40px; height: 40px; }
    .pm-say { min-height: 36px; padding: 6px 10px; font-size: 13px; }
    .pm-task { font-size: 26px; }
    .pm-field { gap: 3px; padding: 8px; max-width: 240px; margin: 0 auto; width: 100%; }
    .pm-key { min-height: 44px; font-size: 19px; }
    .pm-pad { gap: 6px; max-width: 264px; grid-template-columns: repeat(4, 1fr); }
    .pm-controls { gap: 6px; }
    .pm-top .ss-back { min-height: 32px; }
}

/* ---------- grosse Screens ---------- */

@media (min-width: 641px) {
    #app { padding-top: 32px; }
    .ss-tiles { grid-template-columns: repeat(3, 1fr); }
    .ss-profiles { grid-template-columns: repeat(3, 1fr); }
}
