/* DS Virtual Gaming – Demo Lobby. Colors from virtualgaming.com (navy #00427c, cyan #0299cf). */
:root {
    --navy: #00427c;
    --navy-dark: #00264a;
    --navy-deep: #001a33;
    --cyan: #0299cf;
    --cyan-dark: #15779b;
    --surface: #0a2d52;
    --surface-2: #0f3a66;
    --text: #ffffff;
    --text-muted: #a9c3dc;
    --line: rgba(255, 255, 255, .1);
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 10, 30, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Montserrat', 'Gotham Book', 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, #0a4f8f 0%, transparent 60%), var(--navy-deep);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    /* Kein horizontales Scrollen: sonst vergrößert Chrome (Android) den Layout-Viewport und das Spiel-Overlay wird breiter als der Screen */
    overflow-x: clip;
}
button, input, select { font: inherit; }
[hidden] { display: none !important; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    border: 0; border-radius: 999px; padding: .75em 1.6em; cursor: pointer;
    font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--text);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--cyan-dark)); box-shadow: 0 6px 18px rgba(2, 153, 207, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(2, 153, 207, .55); }
.btn-ghost { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-small { padding: .5em 1.1em; font-size: .85rem; }
.btn-large { padding: 1em 2.2em; font-size: 1.05rem; }

/* Login */
.login-page { display: grid; place-items: center; padding: 16px; }
.login-card {
    width: 100%; max-width: 400px; background: #fff; color: #1b2733;
    border-radius: 20px; padding: 40px 32px; box-shadow: var(--shadow); text-align: center;
}
.login-logo { width: 220px; max-width: 80%; margin-bottom: 12px; }
.login-card h1 { margin: 8px 0 4px; color: var(--navy); font-size: 1.6rem; }
.login-sub { margin: 0 0 24px; color: #5b6b7a; font-size: .9rem; }
.login-card form { display: grid; gap: 10px; text-align: left; }
.login-card label { font-weight: 600; font-size: .85rem; color: #33475b; }
.login-card input {
    padding: .8em 1em; border: 1px solid #cfd8e1; border-radius: 10px; font-size: 1rem;
}
.login-card input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.login-card .btn { margin-top: 8px; width: 100%; }
.login-card .btn-ghost { color: var(--navy); border-color: #cfd8e1; }
.alert { background: #fdecec; color: #a12222; border-radius: 10px; padding: .7em 1em; margin-bottom: 16px; font-size: .9rem; text-align: left; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(0, 26, 51, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand img { height: 46px; display: block; }
.categories { display: flex; gap: 4px; flex: 1; }
.cat {
    background: none; border: 0; padding: .6em 1em; border-radius: 999px; cursor: pointer;
    color: var(--text-muted); font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.cat:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.cat.active { background: var(--cyan); color: #fff; }
.account { display: flex; align-items: center; gap: 12px; }
.account select { border: 1px solid var(--line); border-radius: 8px; padding: .4em .5em; color: #fff; background: var(--surface); }
.balance { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 4px; }
.balance-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.balance-value { font-weight: 800; font-size: 1.1rem; color: #fff; font-variant-numeric: tabular-nums; }
.balance-value.flash { animation: flash .8s ease; }
@keyframes flash { 50% { color: var(--cyan); transform: scale(1.06); } }
.user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--navy), var(--cyan)); color: #fff; font-weight: 700; text-transform: uppercase;
}
.logout { margin: 0; }

/* Hero */
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-dark) 55%, #013a5e 100%); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { max-width: 1400px; margin: 0 auto; padding: 48px 24px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.badge {
    display: inline-block; background: rgba(2, 153, 207, .2); color: #7fd6f5; border: 1px solid rgba(2, 153, 207, .5);
    border-radius: 999px; padding: .3em .9em; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; margin: 16px 0; font-weight: 800; }
.hero p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; max-width: 520px; margin: 0 0 28px; }
.hero-image {
    aspect-ratio: 16 / 9; border-radius: 20px; background-size: cover; background-position: center;
    box-shadow: var(--shadow), 0 0 0 1px var(--line); cursor: pointer; transition: transform .3s ease;
}
.hero-image:hover { transform: scale(1.02); }

/* Lobby grid */
.lobby { max-width: 1400px; margin: 0 auto; padding: 36px 24px 60px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 1.4rem; }
.count { color: var(--text-muted); font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.tile {
    background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3); border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(2, 153, 207, .6); }
.tile-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.tile:hover .tile-media img { transform: scale(1.06); }
.tile-play {
    position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 26, 51, .55);
    opacity: 0; transition: opacity .2s ease;
}
.tile:hover .tile-play, .tile:focus-visible .tile-play { opacity: 1; }
.tile-play span {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark)); box-shadow: 0 6px 20px rgba(2, 153, 207, .6); font-size: 1.4rem;
}
.tile-live {
    position: absolute; top: 10px; left: 10px; background: #e53935; color: #fff; font-size: .68rem; font-weight: 800;
    letter-spacing: .08em; padding: .25em .6em; border-radius: 4px;
}
.tile-body { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-title { font-weight: 700; font-size: 1rem; }
.tile-sub { color: var(--text-muted); font-size: .8rem; margin-top: 2px; }
.tile-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7fd6f5; border: 1px solid rgba(2, 153, 207, .4); border-radius: 999px; padding: .25em .7em; white-space: nowrap; }
.empty { color: var(--text-muted); grid-column: 1 / -1; padding: 40px 0; text-align: center; }

.footer { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 16px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: .8rem; flex-wrap: wrap; }
.footer img { height: 28px; filter: brightness(0) invert(1); opacity: .6; }

/* Game overlay */
.game-overlay { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.game-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--navy-dark); border-bottom: 1px solid var(--line); }
.game-title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-bar .btn { flex-shrink: 0; white-space: nowrap; }
.game-balance { color: var(--text-muted); font-size: .9rem; margin-right: 8px; }
.game-balance strong { color: #fff; font-variant-numeric: tabular-nums; }
.game-frame { position: relative; flex: 1; }
.game-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
/* Schwebende Buttons, ersetzen im Querformat (Mobile) die game-bar */
.game-float { display: none; position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; gap: 8px; }
.game-float-btn {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid var(--line); background: rgba(0, 26, 51, .6); color: #fff; font-size: 1.1rem; line-height: 1;
}
/* Vollbild-Umschalter: Icon + Text wechseln mit dem Zustand (.is-fullscreen) */
.fs-icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.game-fs .fs-exit, .game-overlay.is-fullscreen .game-fs .fs-enter { display: none; }
.game-overlay.is-fullscreen .game-fs .fs-exit { display: inline; }
.game-overlay.no-fullscreen .game-fs { display: none; }
.loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--text-muted); z-index: 1; pointer-events: none; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal + toast */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 10, 25, .7); display: grid; place-items: center; padding: 16px; }
.modal-card { background: #fff; color: #1b2733; border-radius: 18px; padding: 28px; width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow); }
.modal-card h3 { margin: 0 0 6px; color: var(--navy); }
.modal-card p { margin: 0 0 20px; color: #5b6b7a; font-size: .9rem; }
.amounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.amount { border: 2px solid #dbe5ef; background: #f6f9fc; color: var(--navy); border-radius: 12px; padding: 14px; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.amount:hover { border-color: var(--cyan); background: #eaf7fc; }
.modal-card .btn-ghost { color: var(--navy); border-color: #dbe5ef; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--surface-2); border: 1px solid var(--line); padding: .8em 1.4em; border-radius: 999px; box-shadow: var(--shadow); font-size: .9rem; }
.toast.error { background: #8e1d1d; }

/* Responsive */
@media (max-width: 1000px) {
    .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
    .categories { order: 3; flex-basis: 100%; overflow-x: auto; }
    .account { margin-left: auto; }
    .user, .balance-label { display: none; }
    .hero-inner { grid-template-columns: 1fr; padding: 32px 16px; }
    .hero-image { order: -1; }
    .lobby { padding: 28px 16px 48px; }
}
@media (max-width: 560px) {
    .brand img { height: 36px; }
    .account { flex: 1 1 100%; min-width: 0; margin-left: 0; justify-content: space-between; gap: 8px; }
    .account select { min-width: 0; flex: 0 1 auto; font-size: .85rem; }
    .account .btn { white-space: nowrap; }
    .balance-value { font-size: 1rem; }
    .logout { display: none; }
    .game-balance, #game-newtab { display: none; }
    .game-fs .fs-label, .game-overlay.is-fullscreen .game-fs .fs-label { display: none; }
    .game-bar .game-fs { padding: .5em .8em; }
    .grid { grid-template-columns: 1fr; }
}

/* Integration guide (EN) */
.guide-callout {
    display: flex; align-items: center; gap: 18px; margin-bottom: 32px; padding: 18px 22px; border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(2, 153, 207, .28), rgba(2, 153, 207, .08)); border: 1px solid rgba(2, 153, 207, .7);
    box-shadow: 0 0 0 4px rgba(2, 153, 207, .12), var(--shadow); text-align: left;
}
.guide-callout-icon {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
    background: var(--cyan); color: #fff; font: 800 1.1rem Consolas, 'SFMono-Regular', Menlo, monospace;
}
.guide-callout-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-callout-text strong { font-size: 1.15rem; }
.guide-callout-text span { color: var(--text-muted); font-size: .92rem; }
.guide-open { flex: 0 0 auto; white-space: nowrap; font-family: inherit; }
@media (max-width: 700px) {
    .guide-callout { flex-wrap: wrap; padding: 16px; gap: 14px; }
    .guide-callout-text { flex-basis: calc(100% - 70px); }
    .guide-open { width: 100%; }
}
.guide-modal { grid-template-columns: minmax(0, 880px); justify-content: center; align-items: start; overflow-y: auto; padding: 24px 16px; }
.guide {
    width: 100%; min-width: 0; background: var(--navy-dark); color: var(--text); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow); text-align: left;
}
.guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 8px; }
.guide-head h2 { margin: 10px 0 0; font-size: 1.4rem; }
.guide-body { padding: 0 28px 28px; line-height: 1.6; font-size: .95rem; }
.guide-lead { color: var(--text-muted); }
.guide h3 { margin: 28px 0 8px; font-size: 1.05rem; color: #7fd6f5; }
.guide ul { margin: 0; padding-inline-start: 1.2em; }
.guide li { margin: 4px 0; }
.guide li strong { color: #fff; }
.guide code { font-family: Consolas, 'SFMono-Regular', Menlo, monospace; font-size: .86em; background: rgba(255, 255, 255, .08); padding: .1em .35em; border-radius: 4px; }
.guide-code { position: relative; margin: 12px 0; }
.guide-code pre { margin: 0; padding: 16px; background: #00121f; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font-size: .82rem; line-height: 1.5; }
.guide-code pre code { background: none; padding: 0; font-size: inherit; }
.guide-copy {
    position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted);
    border-radius: 6px; padding: .25em .7em; font-size: .75rem; cursor: pointer;
}
.guide-copy:hover { color: #fff; }
.guide-checklist { list-style: none; padding-inline-start: 0; }
.guide-checklist li::before { content: '±0  '; color: var(--cyan); }
@media (max-width: 560px) {
    .guide-modal { padding: 0; }
    .guide { border-radius: 0; min-height: 100%; }
    .guide-head, .guide-body { padding-left: 16px; padding-right: 16px; }
}

/* Mobile im Querformat: Spiel ohne Leiste über den ganzen Screen */
@media (orientation: landscape) and (max-height: 500px) {
    .game-bar { display: none; }
    .game-float { display: flex; }
}

/* Login card on dark (logo is designed for dark backgrounds) */
.login-card { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); color: var(--text); border: 1px solid var(--line); }
.login-card h1 { color: #fff; }
.login-sub { color: var(--text-muted); }
.login-card label { color: var(--text-muted); }
.login-card input { background: rgba(0, 0, 0, .25); border-color: var(--line); color: #fff; }
.login-card .btn-ghost { color: #fff; border-color: var(--line); }

/* Customer, game badge, language on the login page */
.welcome { color: #7fd6f5; font-weight: 600; font-size: .95rem; margin: 0 0 14px; }
.hero p.welcome { margin: 0 0 14px; color: #7fd6f5; }
.tile-badge {
    position: absolute; top: 10px; right: 10px; background: var(--cyan); color: #fff; font-size: .75rem; font-weight: 800;
    letter-spacing: .06em; padding: .25em .65em; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.login-card { position: relative; }
.login-lang { position: absolute; top: 14px; right: 14px; border: 1px solid var(--line); border-radius: 8px; padding: .3em .5em; color: #fff; background: var(--surface); font-size: .85rem; }

/* Right-to-left languages */
[dir="rtl"] .tile-live { left: auto; right: 10px; }
[dir="rtl"] .tile-badge { right: auto; left: 10px; }
[dir="rtl"] .login-lang { right: auto; left: 14px; }
[dir="rtl"] .login-card form, [dir="rtl"] .alert { text-align: right; }
[dir="rtl"] .tile-title { text-align: right; }
