/*
 * The Blot shell, verbatim where it matters.
 *
 * `#login-screen`, `.loader-container`, `#loader-progress`, `#loader-logo`
 * and `@keyframes round` are copied from kb-front/src/css/style.css — the
 * same z-order story (loader z-20 above the screen's z-10, black first,
 * artwork fading in via `.ready`, loader fading out via the 0.3s opacity
 * transition), the same spinning PNG, the same logo sizing. What is NOT
 * copied is Blot's login buttons and Telegram plumbing: poker has no auth
 * yet, so the screen goes straight from loaded to lobby.
 */

/* The faces the whole shell claims. kp-front named SFUIText from day one
   (copied components, canvas text) but never shipped the files — every
   surface silently fell back to the UA sans. Same woff2s kb-front ships. */
@font-face { font-family: 'SFUIText-Bold'; src: url('/fonts/SFUIText-Bold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'SFUIText-Regular'; src: url('/fonts/SFUIText-Regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NotoSansArmenian-Bold'; src: url('/fonts/NotoSansArmenian-Bold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NotoSansArmenian-Regular'; src: url('/fonts/NotoSansArmenian.woff2') format('woff2'); font-display: swap; }

/* kb-front style.css's opening resets, verbatim — the universal margin
   kill is LOAD-BEARING: Blot's React Text component renders <p> elements,
   and without this every label carries the UA's ~1em vertical margins.
   That was exactly the "chip pills too tall" bug: the pill's flex row was
   34px of text plus 68px of browser-default paragraph margin. */
* {
    margin: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-focus-ring-color: rgba(0,0,0,0);
    outline: none !important;
}
*:focus, *:active, *:hover {
    outline: none !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
/* Blot's <p> contract (style.css:182): Text pre-computes its own bounds,
   so paragraphs must not wrap, re-align or eat pointer events. */
p {
    white-space: pre;
    text-align: center;
    pointer-events: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #0F0B26;
    overflow: hidden;
    font-family: 'SFUIText-Regular', -apple-system, system-ui, sans-serif;
}
html, body, div, canvas, img {
    box-sizing: border-box;
    padding: 0;
}

/* ── Login / loading screen — kb-front style.css, trimmed ── */
#login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 10;
    overflow: hidden;
    background: #000;
    transition: opacity 0.4s ease-out;
}
#login-screen.gone {
    opacity: 0;
    pointer-events: none;
}
/* Zoomed background matches the native splash end state (1.15x). Split in
   two rules exactly as kb-front does: transparent until `.ready`, so slow
   networks see black + the centre loader, never a half-loaded JPEG. */
#login-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    transform: scale(1.15);
    transform-origin: center center;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
#login-screen.ready::before {
    background: url('/assets/login.jpg') center / cover no-repeat;
    opacity: 1;
}

/* ── Blot's login-bottom block, verbatim (style.css) — hidden until the
      shell decides auto-vs-manual entry, exactly as loginController does. */
.login-design {
    position: absolute;
    z-index: 1;
    width: 1920px;
    height: 1080px;
    transform-origin: 0 0;
    pointer-events: none;
}
.login-bottom-group {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.login-buttons-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
}
.login-buttons-bg {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(85, 85, 85, 0.5);
    border-radius: 10px;
    pointer-events: none;
    z-index: -1;
}
.login-buttons-row {
    position: relative;
    display: flex;
    z-index: 1;
    justify-content: center;
}
.login-guest {
    margin-top: 24px;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.login-guest:active { opacity: 0.6; }
.login-guest-text {
    color: #fff;
    font-size: 34px;
    font-family: SFUIText-Regular, -apple-system, sans-serif;
    text-decoration: underline;
}

/* ── Centre loader — kb-front style.css verbatim ── */
.loader-container {
    position: absolute;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
    pointer-events: none;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}
#loader-progress {
    width: 32%;
    height: auto;
    transform-origin: 50% 50%;
    top: 50%;
    left: 50%;
    animation-name: round;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}
#loader-logo {
    width: 25%;
    height: auto;
}
@keyframes round {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── React lobby host + game canvas host ── */
.reactWrapper {
    position: fixed;
    inset: 0;
    z-index: 5;
}
.reactWrapper.hidden {
    display: none;
}
#game {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: #0b1220;
    /* Notch note: no safe-area inset here ON PURPOSE. The canvas is sized
       to the window and FIT-letterboxed to 16:9 — on 19.5:9 phones the
       side bars land exactly where the notch is, so content clears it
       naturally. Insetting this box also broke web: #game is display:none
       at mount, so a box-tracking renderer measured zero. */
}

/* ── Rotate gate — the table is landscape-only, like Blot. Pure CSS so it
      works before a single module loads. ── */
#rotate-gate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: #0F0B26;
    color: #EDE9F8;
    text-align: center;
    font-family: 'SFUIText-Bold', system-ui, sans-serif;
}
@media (orientation: portrait) and (max-width: 920px) {
    #rotate-gate {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 18px;
    }
}
#rotate-gate .phone {
    width: 46px;
    height: 84px;
    border: 3px solid #E040FB;
    border-radius: 10px;
    animation: kp-rotate 1.6s ease-in-out infinite;
}
@keyframes kp-rotate {
    0%, 20% { transform: rotate(0deg); }
    60%, 100% { transform: rotate(90deg); }
}
#rotate-gate span { font-size: 18px; letter-spacing: 1px; color: #C9B8E8; }
#game.hidden {
    display: none;
}

/* ── Bonus popups — kb-front style.css, verbatim ── */
/* The Free Chips hub's tile row scrolls without a visible scrollbar. */
.market-carousel::-webkit-scrollbar {
    display: none;
}

@keyframes wheelWinBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Soft pulsing gold halo around the winning wheel segment. Replaces
   the old whole-wheel `win.png` blink with a per-segment highlight. */
@keyframes wheelWinHighlight {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.65;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.18);
        opacity: 1;
    }
}
