/* Google Slides UI Recreation - View Only Mode */

/* Self-hosted Amatic SC to avoid flaky remote loads */
@font-face {
    font-family: 'Amatic SC';
    src: url('assets/fonts/AmaticSC-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Amatic SC';
    src: url('assets/fonts/AmaticSC-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #fff;
}

body {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
}


/* ===== Container ===== */
/* ===== Container ===== */
.gs-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    overflow: hidden;
}

/* ===== Header Bar ===== */
.gs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    /* height: 56px; Removed fixed height to allow padding to dictate size */
    padding: 16px 12px 4px 16px;
    /* Increased top/left padding for breathing room */
    background-color: #fff;
    position: relative;
    z-index: 100;
    will-change: transform;
    transform: translateZ(0);
    pointer-events: auto;
}

.gs-header-left {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.gs-logo {
    display: flex;
    align-items: flex-start;
    padding: 0 4px;
    border-radius: 4px;
    cursor: pointer;
}

.gs-logo:hover {
    background-color: #f1f3f4;
}

.gs-title-block {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.gs-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gs-doc-title {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #202124;
    line-height: 1.2;
}

.gs-cloud-icon {
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.gs-cloud-check {
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.gs-menu-bar {
    display: flex;
    gap: 0;
    margin-left: -6px;
}

.gs-menu-item {
    padding: 4px 7px;
    font-size: 15px;
    color: #202124;
    cursor: pointer;
    border-radius: 4px;
}

.gs-menu-item:hover {
    background-color: #f1f3f4;
}

.gs-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gs-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #8e44ad;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.gs-presence-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #188038;
    background-color: transparent;
    color: #188038;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    margin-right: 0px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

.gs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #dadce0;
    background-color: #fff;
    color: #3c4043;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.gs-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.gs-btn .material-icons {
    font-size: 18px;
}

.gs-btn-slideshow {
    border: 1px solid #dadce0;
    background-color: #fff;
    border-radius: 50px;
    /* Full pill shape */
    padding: 0;
    gap: 0;
    /* Override parent gap */
    display: flex;
    align-items: center;
    height: 36px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gs-btn-slideshow .slideshow-text {
    padding: 0 12px 0 18px;
    flex: 1;
    font-weight: 400;
    font-size: 14px;
    color: #3c4043;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

.gs-btn-slideshow .slideshow-divider {
    width: 1px;
    height: 24px;
    background-color: #dadce0;
    margin: 0;
    display: block;
}

.gs-btn-slideshow .slideshow-arrow {
    padding: 0 10px;
    font-size: 20px;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.gs-btn-slideshow:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.1);
    border-color: #dadce0;
}

.gs-btn-share {
    border: none;
    background-color: #d3e3fd;
    border-radius: 50px;
    padding: 0 14px 0 10px;
    gap: 6px;
    display: flex;
    align-items: center;
    height: 36px;
    min-width: 100px;
    cursor: pointer;
}

.gs-btn-share .share-icon {
    font-size: 18px;
    color: #5f6368;
}

.gs-btn-share .share-text {
    font-weight: 500;
    font-size: 14px;
    color: #3c4043;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    margin: 0 2px;
}

.gs-btn-share .share-arrow {
    font-size: 18px;
    color: #5f6368;
    margin-left: 2px;
}

.gs-btn-share:hover {
    background-color: #c8d9f9;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.1);
}

.gs-btn-signin {
    border: none;
    background-color: #1a73e8;
    border-radius: 8px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 36px;
    min-width: 80px;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    margin-left: 0px;
}

.gs-btn-signin:hover {
    background-color: #1b66c9;
    box-shadow: 0 1px 3px rgba(66, 133, 244, 0.3), 0 4px 8px rgba(66, 133, 244, 0.15);
}

.gs-dropdown-arrow {
    font-size: 18px !important;
    margin-left: -4px;
    margin-right: -8px;
}

/* ===== Toolbar ===== */
.gs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    padding: 0 8px;
    margin: 0 12px 6px;
    background-color: #f0f4f9;
    border-radius: 20px;
    position: relative;
    z-index: 90;
    will-change: transform;
    transform: translateZ(0);
    pointer-events: auto;
}

.gs-toolbar-right {
    display: flex;
    align-items: center;
}

.gs-dropdown-icon {
    font-size: 15px !important;
    margin-left: 4px;
}

.gs-fit-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 8px 8px 4px;
    color: #5f6368;
    cursor: default;
}

.gs-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gs-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #5f6368;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    height: 32px;
    transition: background-color 0.15s, border-color 0.15s;
}

.gs-tool-btn:hover {
    background-color: #eef2f8;
}

.gs-tool-btn .material-icons {
    font-size: 18px;
    color: inherit;
}

.gs-icon-only {
    padding: 6px;
    width: 32px;
    justify-content: center;
}

.gs-fit-label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #5f6368;
    padding: 8px 6px 8px 2px;
    cursor: default;
}

.gs-cursor-btn svg {
    width: 20px;
    height: 20px;
}

.gs-toolbar-left .gs-tool-btn:first-child {
    background-color: #fff;
    border-color: #e2e5ec;
    padding: 7px 26px 7px 26px;
    font-size: 14px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.gs-search-icon {
    font-size: 20px;
    margin-left: 0;
    transform: translateX(-6px);
}

.gs-cursor-btn {
    background-color: #e8f0fe;
    border-color: #dadce0;
    color: #3c4043;
}

.gs-toolbar-divider {
    width: 1px;
    height: 18px;
    background-color: #cdd6e3;
    margin: 0 6px;
}

.gs-view-only-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    margin-left: 8px;
    font-size: 14px;
    color: #1a2f6f;
    background-color: #dde7f5;
    border-radius: 18px;
    height: 34px;
}

.gs-view-eye {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.gs-view-only-badge .material-icons {
    font-size: 16px;
}

/* ===== Main Content Area ===== */
.gs-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Changed from visible to hidden to prevent double scrollbars if content overflows */
    position: relative;
    /* Ensure relative positioning for children */
}

/* ===== Sidebar ===== */
.gs-sidebar {
    display: flex;
    flex-direction: column;
    width: 88px;
    min-width: 88px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    position: relative;
    z-index: 90;
    will-change: transform;
    transform: translateZ(0);
    pointer-events: auto;
}

.gs-slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.gs-slide-thumb {
    display: flex;
    align-items: flex-start;
    padding: 4px 6px 4px 4px;
    cursor: pointer;
    position: relative;
}

.gs-slide-thumb:hover .gs-thumb-preview {
    border-color: #1a73e8;
}

.gs-slide-number {
    width: 14px;
    font-size: 10px;
    color: #5f6368;
    text-align: right;
    margin-right: 4px;
    padding-top: 8px;
    flex-shrink: 0;
}

.gs-thumb-preview {
    width: 56px;
    height: 32px;
    background: linear-gradient(135deg, #7ab8f5 0%, #b8d4f0 100%);
    border: 1px solid #bdc1c6;
    border-radius: 2px;
    flex-shrink: 0;
}

.gs-thumb-selected {
    position: relative;
}

.gs-thumb-selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background-color: #1a73e8;
    border-radius: 0 2px 2px 0;
}

.gs-thumb-selected .gs-thumb-preview {
    border-color: #1a73e8;
}

.gs-sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-top: 1px solid #dadce0;
    background-color: #f1f3f4;
}

.gs-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #5f6368;
}

.gs-sidebar-btn:hover {
    background-color: #dadce0;
}

.gs-sidebar-btn .material-icons {
    font-size: 18px;
}

/* ===== Slide Area ===== */
.gs-slide-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    padding: 16px;
    overflow: visible;
    will-change: transform;
    transform: translateZ(0);
}

.slide-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.14);
    z-index: 5;
}

.slide-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0;
    pointer-events: none;
}

#game-container {
    position: absolute;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}

#game-container canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

#game-click-target {
    position: absolute;
    top: 110px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    /* Below toolbar/header so they remain clickable */
    background-color: transparent;
    touch-action: none;
    /* prevent scrolling on mobile */
}

.game-above-ui {
    z-index: 130 !important;
}

.game-behind-ui {
    z-index: 60 !important;
}

.slide-mock {
    position: relative;
    z-index: 2;
    width: 90%;
    height: 88%;
    max-width: 1200px;
    background: linear-gradient(180deg, #dce9ff 0%, #6b97d8 70%, #507ac1 100%);
    border-radius: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    opacity: 0;
    /* Hide HTML slides, using Phaser rendering now */
}

.slide-box {
    position: absolute;
    min-width: 0;
    min-height: 46px;
    padding: 8px 18px;
    color: #f3f7ff;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.8px;
    line-height: 1.3;
    border: 4px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 26px rgba(46, 84, 150, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    background: rgba(99, 145, 209, 0.1);
    border-radius: 6px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.box-blank-top {
    top: 17%;
    left: 15%;
    width: 340px;
    min-height: 50px;
    background: rgba(255, 255, 255, 0.06);
}

.box-text-right {
    top: 38%;
    right: 13%;
    width: auto;
}

.box-text-left {
    bottom: 22%;
    left: 8%;
    width: auto;
}

.box-blank-bottom {
    bottom: 18%;
    right: 9%;
    width: 240px;
    min-height: 52px;
    background: rgba(255, 255, 255, 0.06);
}

/* ===== Slide Wrapper for Multi-Slide Support ===== */
.slide-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.8s ease-out;
}

.slide-mock {
    flex-shrink: 0;
}

/* ===== Slide 2 Specific Styles ===== */
.slide-2 {
    margin-top: 40px;
    /* Gap between slides */
}

.slide2-box-top-left {
    top: 6%;
    left: 4%;
    width: auto;
    max-width: 55%;
}

.slide2-box-top-right {
    top: 10%;
    left: 35%;
    width: auto;
    max-width: 65%;
    color: #1a3a5c;
    text-shadow: none;
}

.slide2-box-mid-left {
    top: 38%;
    left: 6%;
    width: 320px;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.06);
}

.slide2-box-rotated {
    bottom: 12%;
    right: 8%;
    width: auto;
    max-width: 50%;
    transform: rotate(-15deg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.rotated-label {
    position: absolute;
    top: -30px;
    right: 10px;
    font-size: 22px;
    transform: rotate(10deg);
}

/* ===== Mobile Intro Screen ===== */
#mobile-intro {
    display: none;
}

.mobile-intro-active .gs-container {
    display: none;
}

.mobile-intro-active #mobile-intro {
    display: flex;
}

.mobile-intro-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #1f1f1f;
    color: #f5f5f5;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

.intro-status-bar {
    display: none;
}

.intro-status-icons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.intro-status-icons .material-icons {
    font-size: 18px;
}

.intro-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #2f2f2f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.intro-toolbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.intro-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #f5f5f5;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.intro-icon-btn .material-icons {
    font-size: 26px;
}

.intro-icon-btn:active {
    transform: scale(0.96);
}

.intro-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.intro-play {
    background: rgba(255, 255, 255, 0.08);
}

.intro-callout {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 10;
}

.intro-callout-label {
    background: #ffffff;
    color: #111;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    animation: introBlink 1s ease-in-out infinite alternate;
}

.intro-callout-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 14px solid #ffffff;
    animation: introBlink 1s ease-in-out infinite alternate;
}

.intro-slide-stack {
    flex: 1;
    overflow-y: auto;
    background: #111;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.intro-slide {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    min-height: 0;
    padding: 16px;
    margin: 0 auto;
    box-sizing: border-box;
    background: linear-gradient(180deg, #dce9ff 0%, #6b97d8 70%, #507ac1 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

@supports not (aspect-ratio: 16 / 9) {
    .intro-slide {
        height: 0;
        padding-top: calc(56.25% + 16px);
    }
    .intro-slide > * {
        position: absolute;
    }
}

.intro-divider {
    height: 0px;
    background: transparent;
}

.intro-slide-b {
    background: linear-gradient(180deg, #e6efff 0%, #85aee6 75%, #5b86d1 100%);
}

.intro-slide-c {
    background: linear-gradient(180deg, #cfe4ff 0%, #7fa8e4 75%, #5c80c8 100%);
}

.intro-slide-d {
    background: linear-gradient(180deg, #d9e9ff 0%, #6a95d7 70%, #4c75bd 100%);
}

.intro-slide-e {
    background: linear-gradient(180deg, #d5e6ff 0%, #86aeea 70%, #547bc2 100%);
    padding-bottom: 32px;
}

.intro-slide-f {
    background: linear-gradient(180deg, #dce9ff 0%, #8bb3ec 70%, #5a82c6 100%);
}

.intro-slide-g {
    background: linear-gradient(180deg, #cfe4ff 0%, #7da7e3 70%, #577bbf 100%);
}

.intro-slide-h {
    background: linear-gradient(180deg, #dce9ff 0%, #86aeea 70%, #547bc2 100%);
}

.intro-box {
    position: absolute;
    color: #f3f7ff;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.4px;
    padding: 8px 14px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    background: rgba(90, 133, 200, 0.18);
    box-shadow: 0 8px 20px rgba(46, 84, 150, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.intro-box-top-left { top: 16%; left: 8%; }
.intro-box-top-right { top: 34%; left: 14%; right: 10%; font-size: 17px; }
.intro-box-bottom-left { bottom: 16%; left: 8%; }
.intro-box-bottom-right { bottom: 22%; right: 10%; width: 160px; min-height: 48px; }

.intro-box-left-small {
    top: 18%;
    left: 8%;
    width: 130px;
}

.intro-box-center-large {
    top: 28%;
    left: 16%;
    right: 16%;
    height: 180px;
    background: rgba(255, 255, 255, 0.08);
}

.intro-box-right-small {
    top: 28%;
    right: 8%;
    width: 130px;
}

.intro-box-center-bold {
    top: 44%;
    left: 8%;
    right: 8%;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.intro-box-left-wide {
    top: 26%;
    left: 6%;
    right: 50%;
    min-height: 120px;
    font-size: 22px;
    font-weight: 700;
    text-transform: lowercase;
    color: #ffd93b;
}

.intro-box-right-bold {
    top: 34%;
    left: 52%;
    right: 6%;
    text-align: center;
    font-weight: 800;
    color: #e0007e;
}

.intro-hot-pink {
    color: #ff1493;
    font-weight: 700;
}

.intro-player {
    position: absolute;
    bottom: 30%;
    left: 30%;
    width: 45px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
    image-rendering: pixelated;
}

.intro-box-title-wide {
    top: 8%;
    left: 8%;
    right: 8%;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.intro-media-frame {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 22%;
    height: 60%;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.intro-media-game {
    background: linear-gradient(180deg, #0d0d0f, #2a2a37);
    background-size: cover;
    background-position: center;
}

.intro-media-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('assets/images/coldplay-press1 copy.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.55;
    filter: saturate(1.1) contrast(1.05);
}

.intro-box-caption {
    bottom: 6%;
    left: 8%;
    right: 8%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
    color: #0f1b2d;
}

.intro-box-left-medium {
    top: 22%;
    left: 8%;
    right: 52%;
    min-height: 120px;
    text-transform: lowercase;
}

.intro-box-right-medium {
    top: 36%;
    left: 48%;
    right: 8%;
    min-height: 120px;
    text-transform: lowercase;
}

.intro-box-center-pill {
    top: 30%;
    left: 12%;
    right: 12%;
    text-align: center;
    font-weight: 700;
    border-radius: 999px;
}

.intro-box-bottom-strip {
    bottom: 12%;
    left: 10%;
    right: 10%;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.intro-box-final-cta {
    top: 40%;
    left: 12%;
    right: 12%;
    text-align: center;
    font-weight: 800;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #ffffff;
    color: #0f1b2d;
}

@keyframes introBlink {
    from { opacity: 1; }
    to { opacity: 0.25; }
}

/* ===== Mobile Play Mode ===== */
body.mobile-play-mode {
    background: #0c0c0f;
    overflow: hidden;
}

body.mobile-play-mode .gs-header,
body.mobile-play-mode .gs-toolbar,
body.mobile-play-mode .gs-sidebar,
body.mobile-play-mode .gs-sidebar-footer {
    display: none !important;
}

body.mobile-play-mode .gs-container {
    height: 100vh;
    width: 100vw;
}

body.mobile-play-mode .gs-main {
    height: 100vh;
}

body.mobile-play-mode .gs-slide-area {
    padding: 0;
    background: #0c0c0f;
    align-items: center;
    justify-content: center;
}

body.mobile-play-mode .slide-stage {
    width: 100%;
    height: 100%;
    box-shadow: none;
    background: #0c0c0f;
}

body.mobile-play-mode #game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    transform: none;
    pointer-events: auto;
}

body.mobile-play-mode #game-click-target {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    transform: none;
    background: transparent;
}

/* Let Phaser control canvas size on mobile to avoid stretch; center it */
body.mobile-play-mode #game-container canvas {
    position: absolute;
    inset: auto;
    left: 41.5%;
    top: var(--mobile-canvas-top, 50%);
    transform: translate(-50%, -50%);
    height: 100vh !important;
    height: 100dvh !important;
    width: auto !important;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 177.78vh; /* 16/9 of height */
    max-width: 177.78dvh;
    aspect-ratio: 16 / 9;
}

@media (orientation: portrait) {
    body.mobile-play-mode #game-container canvas {
        left: 50%;
        top: var(--mobile-canvas-top, 50%);
        transform: translate(-50%, -50%) rotate(90deg);
        height: 100vw !important;
        height: 100dvw !important;
        max-height: 100vw;
        max-height: 100dvw;
        max-width: 177.78vw; /* 16/9 of height (after rotate) */
        max-width: 177.78dvw;
    }
}

/* Chrome-specific vertical nudge */
body.mobile-play-mode.is-chrome {
    --mobile-canvas-top: 54%;
}

/* Mobile rotate prompt (portrait only) */
.rotate-prompt {
    position: fixed;
    left: 50%;
    top: calc(12px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 1500;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.2px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.rotate-prompt .rotate-icon {
    font-size: 18px;
    line-height: 1;
}

@media (orientation: portrait) {
    body.mobile-play-mode .rotate-prompt {
        display: flex;
    }
}

/* Mobile ladder slot */
.mobile-ladder-slot {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1300;
    display: none;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
    color: #fff;
}

body.mobile-play-mode .mobile-ladder-slot.active {
    display: flex;
}

.ladder-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    flex: 0 0 auto;
}

.ladder-icon-circle img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.ladder-tooltip {
    background: rgba(0, 0, 0, 0.65);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    display: none;
    max-width: 220px;
    order: -1; /* tooltip on the left */
    flex: 0 1 auto;
}

body.mobile-play-mode .mobile-ladder-slot.show-tooltip .ladder-tooltip {
    display: block;
}

body.mobile-play-mode .mobile-ladder-slot.disabled .ladder-icon-circle {
    opacity: 0.35;
    filter: grayscale(1);
    cursor: default;
}

/* Mobile controls */
.mobile-controls {
    position: fixed;
    inset: 0;
    z-index: 1400;
    pointer-events: none;
    display: none;
    font-family: 'Roboto', sans-serif;
}

body.mobile-play-mode .mobile-controls {
    display: block;
}

@media (orientation: portrait) {
    body.mobile-play-mode .mobile-controls {
        display: none;
    }
}

.mobile-move {
    position: absolute;
    left: 18px;
    bottom: 18px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.mobile-btn {
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-btn:active {
    transform: scale(0.98);
}

.mobile-btn-move {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
}

.mobile-btn-move .material-icons {
    font-size: 38px;
}

.mobile-ladder-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 6px;
}

.mobile-btn-ladder {
    width: 64px;
    height: 54px;
    display: grid;
    place-items: center;
}

.mobile-btn-ladder .material-icons {
    font-size: 40px;
}

.mobile-btn-jump {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 110px;
    height: 64px;
    font-weight: 800;
    letter-spacing: 1px;
    pointer-events: auto;
}


@media (min-width: 641px) {
    #mobile-intro {
        display: none !important;
    }
    .mobile-intro-active #mobile-intro {
        display: none !important;
    }
    .mobile-intro-active .gs-container {
        display: flex;
    }
}

/* Text color classes */
.text-magenta {
    color: #ff00ff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.text-yellow {
    color: #ffff00;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


/* ===== Bottom Bar ===== */
.gs-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    background-color: #3c4043;
    flex-shrink: 0;
    /* Prevent footer from shrinking */
    z-index: 40;
    /* Ensure it stays on top */
}

.gs-drag-handle {
    width: 32px;
    height: 3px;
    background-color: #5f6368;
    border-radius: 2px;
}

.gs-menu-item.gs-menu-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    pointer-events: auto;
    z-index: 220;
}

.gs-menu-item.gs-menu-help.open {
    background-color: #e8f0fe;
}

.gs-help-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 180px;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    display: none;
    z-index: 200;
}

.gs-menu-item.gs-menu-help.active .gs-help-dropdown {
    display: block;
}

.gs-help-item {
    padding: 6px 16px;
    font-size: 15px;
    color: #202124;
}

.gs-help-item.disabled {
    color: #9aa0a6;
    cursor: default;
}

.gs-help-item:not(.disabled):hover {
    background-color: #e8f0fe;
}

/* Ladder Success Tooltip */
.gs-ladder-tooltip {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    animation: fadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
}

.gs-tooltip-content {
    background-color: #202124;
    color: #fff;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    white-space: nowrap;
}

.gs-tooltip-arrow {
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #202124;
    border-left: 0;
    margin-right: -1px;
    /* Overlap slightly to avoid gap */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-10px, 0);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* YouTube Container for embedded videos */
#youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 65;
    /* Above game container to ensure videos are visible */
    pointer-events: none;
    /* Default to no interaction */
}

#youtube-container iframe {
    position: absolute;
    pointer-events: auto;
    /* Enable interaction on the iframes themselves */
    border: none;
    background: #000;
}
