html, body, div {
    margin: 0;
    padding: 0;
    border: 0;
    vertical-align: baseline;
}

html {
    height: 100%;
}

body {
    overflow: hidden;
    background-color: #000;
    height: 100%;
    font-family: sans-serif;
    font-size: 0.9em;
}

canvas {
    -webkit-tap-highlight-color: transparent;
}

#main {
    position: fixed;
    left:     50%;
    top:      50%;
}

#ttgScreenCanvas, #ttgErrorCanvas
{
    position:absolute;
    left:0px;
    top:0px;
}

#ttgBarCanvas
{
    position:absolute;
    left:0px;
}

/* Error Styles */
#error {
    color: #2F4F4F;
    height: 100%;
    padding: 20px;
    background-color: #FFF;
}

#errorTitle {
    font-weight: bold;
    font-size: 1.3em;
    padding-bottom: 10px;
}

#errorMessage {
    font-size: 1.2em;
    font-weight: bold;
}

#errorCode {
    font-size: 0.8em;
    font-weight: bold;
    padding-top: 10px;
}

#errorDebug {
    padding-top: 15px;
    font-size: 0.8em;
}

.textButton {
    background-color: #FFFFFF;
    border: none;
    color: black;
    padding: 15px 13px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 26px;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 4px #999;
    border: 2px solid #F0F0F0;
    outline: none;
    margin-bottom: 25px;
    width: 300px;
}

.textButton:active {
  background-color: #000000;
  color: white;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}

@font-face
{
	font-family: "Yantramanav";
	font-style: normal;
	font-weight: 400;
	src: local("Yantramanav"), local("Yantramanav-Regular"), url("../fonts/Yantramanav.woff2") format("woff2");
}

@font-face
{
    font-family: "Futura_medium";
    font-style: all;
    font-weight: 400;
    src: local("Futura"), local("Futura"), url("../fonts/Futura.ttc") format("ttc");
}

@font-face
{
    font-family: "Futura_bold";
    font-style: all;
    font-weight: 600;
    src: local("FuturaLT-Futura"), local("Futura"), url("../fonts/Futura.ttc") format("ttc");
}

/* --- Error-screen reload affordance (2026-08-04) -------------------------------------------------
   The inactivity-timeout screen told players to "reload the game" while offering no way to do it:
   the error screen is canvas-drawn (nothing tappable), and `body { overflow: hidden }` above means the
   document never scrolls, so iOS Safari never offers pull-to-refresh either. Reported on a real iPhone.

   `ttg-error-mode` is applied by ErrorView.showError ONLY, so the scroll lock stays in force during
   live gameplay — unlocking it there would let the mobile address bar show/hide on drag, changing
   viewport height and driving the resize path (which has a bug history). Nothing to disturb post-error.
   ------------------------------------------------------------------------------------------------ */
html.ttg-error-mode, body.ttg-error-mode {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
}

#ttgReloadBar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 32px;
    /* keep clear of the iPhone home indicator / notch when present */
    bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: center;
    z-index: 2147483647;
    pointer-events: none;      /* only the button itself is interactive */
}

/* Dim the background BEHIND the button so the gold reads as a glowing control instead of glare on a
   white page.
   Deliberately a bottom-anchored scrim, NOT a full-viewport overlay: both error views paint their
   message as ordinary DOM/canvas content that this fixed layer would sit on top of (#error is a
   static, full-viewport white panel, so no z-index can put a positioned overlay behind its text).
   The message lives at the TOP, the button at the BOTTOM -- so darken only the lower band and the
   error text keeps its full contrast.
   Implemented as the bar's own ::before so neither ErrorView.js nor ErrorPopupView.js changes, and it
   inherits pointer-events:none from the bar -- it must never eat the tap it exists to advertise.
   Scoped for free: #ttgReloadBar only exists in error mode. */
#ttgReloadBar::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52vh;
    max-height: 420px;
    pointer-events: none;
    background:
        /* soft lift right around the button, so it sits in a pool of light */
        radial-gradient(ellipse 220px 170px at 50% 82%, rgba(255, 198, 74, .13) 0%, rgba(255, 198, 74, 0) 70%),
        /* the scrim itself: fades to nothing well above the error text */
        linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .56) 34%, rgba(0, 0, 0, .22) 68%, rgba(0, 0, 0, 0) 100%);
    animation: ttgReloadDimIn .45s ease-out both;
}

@keyframes ttgReloadDimIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Icon-only on purpose: a circular refresh arrow needs no translation, which the previous hardcoded
   English "Reload" label did (the framework ships 20+ locales). The button still carries the text
   node as its accessible name for screen readers -- font-size:0 hides it visually without removing
   it from the accessibility tree.

   Built as a gold "coin": dark bezel ring + gold body + top gloss + bottom shade, to sit naturally
   next to the casino chrome instead of reading as a browser control. */
#ttgReloadBtn {
    pointer-events: auto;
    position: relative;
    width: 112px;              /* 64 -> 88 -> 112: this is the one control a stuck player must find */
    height: 112px;
    z-index: 1;                /* above the ::before dimmer, which is the bar's first child */
    padding: 0;
    font-size: 0;              /* hides the "Reload" text node, keeps the accessible name */
    line-height: 0;
    color: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    background-image:
        radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, #fff0b4 0%, #f8cf68 36%, #e5ac36 64%, #c2871b 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    box-shadow:
        0 0 0 2px rgba(94, 58, 6, .60),          /* crisp dark bezel                */
        0 0 0 6px rgba(255, 226, 150, .22),      /* soft gold halo, lifts off art   */
        0 10px 26px rgba(0, 0, 0, .55),          /* depth                           */
        inset 0 2px 1px rgba(255, 255, 255, .85),/* top gloss                       */
        inset 0 -4px 7px rgba(94, 58, 6, .32);   /* bottom shade -> domed, not flat */
    transition: transform .18s cubic-bezier(.2, .7, .3, 1),
                box-shadow .18s ease,
                filter .18s ease;
    /* Idle attention pulse. Deliberately NOT hover-only: this button matters most on MOBILE, where
       :hover does not exist, so a hover-only affordance would be invisible exactly where a stuck
       player needs it. Paused while hovered/pressed so the states do not fight. */
    animation: ttgReloadAttention 2.6s ease-in-out infinite;
}

/* The glyph lives on its own layer so the click animation can spin ONLY the arrow -- rotating the
   whole button would drag the gloss and drop shadow around with it and look broken. */
#ttgReloadBtn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a2405' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 12a8.5 8.5 0 1 1-2.49-6.01'/%3E%3Cpolyline points='20.5 4.5 20.5 10 15 10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 62px 62px;
}

/* Expanding ring, drawn on click. Sits behind nothing and eats no taps. */
#ttgReloadBtn::after {
    content: "";
    position: absolute;
    left: -6px;
    top: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 232, 155, .95);
    opacity: 0;
    pointer-events: none;
}

/* @media (hover: hover) so a touch device never latches a sticky :hover after a tap -- on mobile the
   idle pulse is the affordance instead. */
@media (hover: hover) and (pointer: fine) {
    #ttgReloadBtn:hover {
        transform: scale(1.09);
        filter: brightness(1.12) saturate(1.06);
        animation: none;               /* hover takes over from the idle pulse */
        box-shadow:
            0 0 0 2px rgba(94, 58, 6, .60),
            0 0 0 10px rgba(255, 226, 150, .30),   /* halo widens */
            0 0 26px 8px rgba(255, 198, 74, .55),  /* the glow itself */
            0 14px 32px rgba(0, 0, 0, .58),
            inset 0 2px 1px rgba(255, 255, 255, .92),
            inset 0 -4px 7px rgba(94, 58, 6, .32);
    }

    /* The ring becomes a steady glow outline on hover rather than the click ripple. */
    #ttgReloadBtn:hover::after {
        opacity: .55;
        transform: scale(1.12);
        transition: opacity .18s ease, transform .18s ease;
    }
}

/* Pulse: gold glow breathing in and out.
   Deliberately GLOW-ONLY -- no transform. An infinite transform animation never lets the element
   settle, so Playwright's actionability check ("element is not stable") times out on hover/click and
   any automated test that touches this button hangs. box-shadow does not change the bounding box, so
   the attention cue can run forever and the button stays clickable by automation. The scale lives on
   :hover, which is a discrete state that settles. */
@keyframes ttgReloadAttention {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(94, 58, 6, .60),
            0 0 0 6px rgba(255, 226, 150, .22),
            0 0 10px 2px rgba(255, 198, 74, .22),
            0 10px 26px rgba(0, 0, 0, .55),
            inset 0 2px 1px rgba(255, 255, 255, .85),
            inset 0 -4px 7px rgba(94, 58, 6, .32);
    }
    50% {
        box-shadow:
            0 0 0 2px rgba(94, 58, 6, .60),
            0 0 0 10px rgba(255, 226, 150, .32),
            0 0 24px 7px rgba(255, 198, 74, .50),
            0 12px 30px rgba(0, 0, 0, .58),
            inset 0 2px 1px rgba(255, 255, 255, .92),
            inset 0 -4px 7px rgba(94, 58, 6, .32);
    }
}

#ttgReloadBtn:focus-visible {
    outline: 0;
    box-shadow:
        0 0 0 2px rgba(94, 58, 6, .60),
        0 0 0 7px rgba(255, 255, 255, .85),
        0 10px 26px rgba(0, 0, 0, .55),
        inset 0 2px 1px rgba(255, 255, 255, .85),
        inset 0 -4px 7px rgba(94, 58, 6, .40);
}

/* Pressed: the coin sinks into the surface. */
#ttgReloadBtn:active {
    animation: none;               /* the press must win over the idle pulse */
    transform: translateY(3px) scale(.95);
    filter: brightness(.94);
    box-shadow:
        0 0 0 2px rgba(94, 58, 6, .60),
        0 0 0 6px rgba(255, 226, 150, .22),
        0 3px 8px rgba(0, 0, 0, .5),
        inset 0 3px 7px rgba(94, 58, 6, .50);
}

/* Click confirmation. The handler adds .ttg-reloading and delays the actual reload slightly, so the
   player gets feedback that the tap landed instead of staring at a frozen screen. */
#ttgReloadBtn.ttg-reloading {
    animation: none;               /* stop pulsing once the reload is committed */
    transform: scale(.97);
    filter: brightness(1.08);
}

#ttgReloadBtn.ttg-reloading::before {
    animation: ttgReloadSpin .62s cubic-bezier(.3, .05, .25, 1);
}

#ttgReloadBtn.ttg-reloading::after {
    animation: ttgReloadRipple .55s ease-out forwards;
}

@keyframes ttgReloadSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes ttgReloadRipple {
    0%   { opacity: .95; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.6); }
}

/* Respect the OS setting - the affordance must still work, it just stops moving. */
@media (prefers-reduced-motion: reduce) {
    #ttgReloadBtn,
    #ttgReloadBar::before,
    #ttgReloadBtn.ttg-reloading::before,
    #ttgReloadBtn.ttg-reloading::after {
        transition: none;
        animation: none;
    }
}
