﻿/* styles.css */

/* =========================
   Global: no scroll, full height
   ========================= */
html, body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden; /* never show scrollbars */
}

/* =========================
   Page wrapper + background image
   ========================= */
.page {
    height: 100dvh; /* mobile-friendly dynamic viewport */
    height: 100vh; /* fallback */
    display: flex;
    flex-direction: column;
    /* Background image */
    background-image: url("img/demo_bk_3.jpg"); /* <-- change path if needed */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* =========================
   NEW: background darkening layer
   (Adjust --bg-dim for darker/lighter)
   ========================= */
:root {
    --bg-dim: 0.55; /* 0 = no darkening, 0.8 = very dark */
}

.page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, var(--bg-dim));
    pointer-events: none;
    z-index: 0;
}

/* Keep everything above the dim overlay */
.topbar, .stage {
    position: relative;
    z-index: 1;
}

/* =========================
   Top button bar
   ========================= */
.topbar {
    flex: 0 0 auto;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
}

.topbar-inner {
    display: flex;
    flex-wrap: nowrap; 
    align-items: center;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    align-items: center;
    justify-content: center;
}

.spacer {
    flex: 1 1 auto;
    min-width: 10px;
}

.topbtn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex: 0 0 auto; /* default: size to content */
}

.topbtn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.topbtn:active {
    transform: translateY(1px);
}

.topbtn.exit {
    background: rgba(255, 90, 90, 0.24);
    border-color: rgba(255, 90, 90, 0.35);
}

.topbtn {
    flex: auto; /* buttons can stretch */
    text-align: center;
}

.topbtn.exit {
    flex: none; 
}

/* =========================
   Main stage: iframe must fit remaining height
   ========================= */
.stage {
    flex: 1 1 auto;
    min-height: 0; /* ✅ critical: allows iframe area to shrink without overflow */
    padding: 0 12px max(12px, env(safe-area-inset-bottom));
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* Desktop: centered with max width, empty sides */
.frame-shell {
    width: 100%;
    max-width: 720px; /* <-- adjust max width */
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    /* ✅ strong containment so iframe cannot "bleed" visually */
    contain: layout paint size style;
    position: relative; /* required because iframe is absolutely positioned */
}

/* Force iframe to fill ONLY the frame-shell */
.aira {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
    background: transparent;
}

/* Mobile: feel more full-screen */
@media (max-width: 640px) {
    .stage {
        padding: 0;
    }

    .topbar {
        padding-left: 10px;
        padding-right: 10px;
    }

    .frame-shell {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
