﻿:root {
    --access-ink: #3b2916;
    --access-muted: #6b4c23;
    --access-line: #dfc583;
    --access-soft: #f4e3ae;
    --access-accent: #80551f;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body.play-access {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--access-ink);
    font: 400 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fa;
}

button { font: inherit; }

.access-orientation-guard[hidden] { display: none; }

.access-orientation-guard {
    position: fixed;
    z-index: 10;
    inset: 0;
    display: grid;
    padding: 28px;
    color: #fff;
    text-align: center;
    place-items: center;
    background: #181818;
}

.access-orientation-guard__content { max-width: 320px; }

.access-orientation-guard p {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.45;
}

.access-stage {
    display: flex;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    justify-content: center;
    padding: 0;
    background: #f5f7fa;
}

.access-phone {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: clamp(320px, 100%, 480px);
    height: 100dvh;
    overflow: hidden;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    background: #181818;
    isolation: isolate;
}

.access-preloader-background {
    position: absolute;
    z-index: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.access-phone::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    content: "";
    background: rgb(0 0 0 / 56%);
}

.access-game-logo {
    position: absolute;
    z-index: 0;
    top: clamp(34px, 7dvh, 70px);
    left: 50%;
    width: min(56%, 258px);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 8px 12px rgb(0 0 0 / 30%));
}

.access-panel-shell {
    --access-sheet-drag-y: 0px;
    position: relative;
    z-index: 2;
    width: 95%;
    max-width: 400px;
    align-self: center;
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 16px 48px rgb(16 24 40 / 25%);
    transform: translateY(var(--access-sheet-drag-y));
    transition: transform 220ms cubic-bezier(.2, .75, .25, 1);
    will-change: transform;
}

/* Do not paint the access sheet when this document immediately continues to
   the installed PWA or an earlier browser choice. */
.access-panel-shell:not(.access-panel-shell--ready) {
    visibility: hidden;
}

.access-panel-shell--enter {
    animation: access-panel-enter 800ms cubic-bezier(.22, .85, .3, 1) both;
}

.access-panel {
    display: flex;
    min-width: 0;
    max-height: calc(100dvh - 48px);
    flex-direction: column;
}

.access-panel-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.access-brand-bar {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: #ecd69c;
    border-bottom: 1px solid #dfc583;
}

.access-brand-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    border-radius: 9px;
}

.access-brand-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.access-brand-copy span,
.access-brand-copy small {
    display: block;
}

.access-brand-copy span {
    color: #361501;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.access-brand-copy small {
    margin-top: 3px;
    color: #361501;
    font-size: 12px;
    line-height: 1.2;
}

.access-install-action,
.access-back-action {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    color: #fff7e3;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 0;
    border-radius: 999px;
}

.access-install-action { background: #80551f; }
.access-back-action { background: #80551f; }

.access-install-action svg,
.access-back-action svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.access-install-action:hover { background: #684215; }
.access-back-action:hover { background: #684215; }

.access-install-action:focus-visible { outline-color: #80551f; }
.access-back-action:focus-visible { outline-color: #80551f; }

.access-panel-shell--dragging { transition: none; }
.access-panel-shell--dismissing { pointer-events: none; transform: translateY(110dvh); }

.access-panel-content { padding: 22px 28px max(20px, env(safe-area-inset-bottom)); }
.access-panel-content--with-footer { padding-bottom: 0; }

.access-choice-intro,
.access-instruction-intro,
.access-instruction-outro,
.access-intro,
.access-note,
.access-status { margin: 0; }

.access-choice-intro,
.access-instruction-intro,
.access-intro {
    color: var(--access-ink);
    font-size: 15px;
    line-height: 1.5;
}

.access-choice-intro { margin-bottom: 16px; }
.access-instruction-intro { margin-bottom: 10px; }

.access-benefits,
.access-steps {
    padding: 0;
    margin: 0;
    list-style: none;
}

.access-benefits { display: grid; gap: 9px; margin-bottom: 16px; }

.access-benefits li,
.access-steps li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.access-benefits li {
    color: var(--access-ink);
    font-size: 14px;
    line-height: 1.4;
}

.access-benefit-icon,
.access-step-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    color: #3b2916;
    place-items: center;
    border-radius: 7px;
}

.access-benefit-icon { background: #ecd69c; }
.access-step-icon { background: #ecd28d; }

.access-benefit-icon svg,
.access-step-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.access-game-preview { margin: 18px 0 10px; }

.access-game-preview-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 0 2px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.access-game-preview-track::-webkit-scrollbar { display: none; }

.access-game-preview-track img {
    width: min(48%, 112px);
    height: auto;
    flex: 0 0 auto;
    aspect-ratio: 490 / 1053;
    object-fit: contain;
    scroll-snap-align: start;
}

.access-browser-choice {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    margin: 25px 0 4px;
    color: #80551f;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    background: #fff;
    border: 1px solid #80551f;
    border-radius: 999px;
}

.access-instruction-outro {
    margin: 18px 0 0;
    background: #f5f5f5;
    border-top: 2px dotted #b99555;
}

.access-steps { margin: 0 0 16px; }

.access-steps li {
    min-height: 0;
    padding: 8px 0;
    color: var(--access-ink);
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid var(--access-line);
}

.access-steps li:last-child { border-bottom: 0; }

.access-step-icon { width: 36px; height: 36px; flex-basis: 36px; font-size: 18px; }
.access-step-icon--app { overflow: hidden; }
.access-step-icon--app img { width: 22px; height: 22px; object-fit: contain; }
.access-steps strong { font-weight: 700; }

.access-instruction-outro {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px max(22px, env(safe-area-inset-bottom));
    color: #244f8f;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.access-instruction-outro p { margin: 0; }

.access-instruction-outro > svg {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.1;
}

.access-note {
    margin-top: 16px;
    color: var(--access-muted);
    font-size: 13px;
    line-height: 1.45;
}

.access-copy-link {
    min-height: 40px;
    padding: 8px 12px;
    margin-top: 16px;
    color: var(--access-ink);
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--access-line);
    border-radius: 8px;
}

.access-heading {
    display: grid;
    gap: 14px;
    justify-items: center;
    padding: 24px 28px 0;
    text-align: center;
}

.access-logo { width: min(100%, 180px); height: auto; }
.access-heading h1 { margin: 0; font-size: 23px; line-height: 1.2; }
.access-detection { margin: 18px 0; padding: 0; border-top: 1px solid var(--access-line); }
.access-detection div { display: grid; grid-template-columns: minmax(104px, .9fr) minmax(0, 1.5fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--access-line); }
.access-detection dt { color: var(--access-muted); font-size: 12px; font-weight: 700; }
.access-detection dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.access-primary { display: block; width: 100%; min-height: 44px; padding: 10px 16px; color: #fff; font-weight: 700; cursor: pointer; background: var(--access-accent); border: 0; border-radius: 999px; }
.access-secondary { display: block; width: 100%; min-height: 44px; padding: 10px 16px; margin-top: 10px; color: var(--access-muted); cursor: pointer; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.access-status { margin-top: 12px; color: var(--access-muted); font-size: 13px; }
.access-variant-options { display: grid; gap: 12px; margin-top: 18px; }
.access-variant-choice { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 14px; color: var(--access-ink); font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; background: #fbf1d1; border: 1px solid var(--access-line); border-radius: 10px; }
.access-variant-icon { display: grid; width: 42px; height: 42px; place-items: center; background: #fff; border-radius: 9px; }
.access-variant-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.access-preloader { display: grid; gap: 12px; padding: 28px; place-items: center; }
.access-loader { width: 44px; height: 44px; border: 4px solid #dce2e9; border-top-color: var(--access-accent); border-radius: 50%; animation: access-spin 800ms linear infinite; }

@keyframes access-spin { to { transform: rotate(360deg); } }

@keyframes access-panel-enter {
    from { opacity: 0; transform: translateY(100dvh); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .access-panel-shell,
    .access-panel-shell--enter { transition: none; animation: none; }
}

button:focus-visible,
.access-game-preview-track:focus-visible { outline: 3px solid var(--access-accent); outline-offset: 2px; }

@media (max-width: 480px) {
    .access-panel-shell { max-width: none; }
    .access-brand-bar { padding-right: 22px; padding-left: 22px; }
    .access-panel-content { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 340px) {
    .access-brand-bar { gap: 9px; padding-right: 16px; padding-left: 16px; }
    .access-brand-icon { width: 34px; height: 34px; flex-basis: 34px; }
    .access-install-action,
    .access-back-action { padding-right: 12px; padding-left: 12px; font-size: 13px; }
    .access-panel-content { padding-right: 16px; padding-left: 16px; }
    .access-detection div { grid-template-columns: 1fr; gap: 3px; }
}

.access-qr-content { text-align: center; padding-block: 24px; }
.access-qr-content h1 { margin: 0 0 6px; font-size: 23px; line-height: 1.2; }
.access-qr-content p { margin: 0; line-height: 1.45; }
.access-qr-content .access-qr { width: min(100%, 195px); height: auto; aspect-ratio: 1; margin: 12px auto 0; }

.access-preloader .access-loader + .access-status { text-align: center; color: var(--access-ink); }

.access-open-app { display: grid; justify-items: center; gap: 10px; padding: 25px 24px 27px; text-align: center; }
.access-open-app h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.access-open-app p { max-width: 30ch; margin: 0; line-height: 1.45; }
.access-open-illustration { display: grid; place-items: center; margin-bottom: 2px; }
.access-open-phone { display: grid; place-items: center; position: relative; width: 47px; height: 72px; border: 2px solid #222; border-radius: 10px; background: #fff; }
.access-open-phone::after { content: ""; position: absolute; bottom: 5px; width: 12px; height: 2px; border-radius: 1px; background: #222; }
.access-open-tiles { display: grid; grid-template-columns: repeat(2, 8px); gap: 4px; }
.access-open-tiles i { display: block; width: 8px; height: 8px; border: 1.5px solid #222; border-radius: 2px; }
.access-qr svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }

.access-open-link { width: auto; text-decoration: none; }

.access-qr-content .access-qr-alternative { margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }

.access-orientation-animation { display: grid; place-items: center; width: 120px; height: 120px; margin: 0 auto 14px; }
.access-orientation-phone { position: relative; display: block; width: 51px; height: 94px; border: 2px solid #fff; border-radius: 10px; animation: access-turn-upright 2.7s ease-in-out infinite; }
.access-orientation-phone::after { content: ""; position: absolute; width: 15px; height: 2px; bottom: 6px; left: 50%; border-radius: 2px; transform: translateX(-50%); background: #fff; }
.access-orientation-guard p[data-orientation-body] { margin: 0; color: #fff; font-size: 18px; font-weight: 600; }
@keyframes access-turn-upright {
    0%, 22% { transform: rotate(90deg); opacity: 1; }
    60%, 91% { transform: rotate(0deg); opacity: 1; }
    100% { transform: rotate(0deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .access-orientation-phone { animation: none; }
}
