/*
 * OBJEKT Trilogy - Design System
 * Unified CSS Design System
 */

/* ========================================
   1. FONT-FACE DEFINITIONS (Local Fonts)
   ======================================== */

/* Pretendard - Project Standard (Brand, Body, Accent) */
@font-face {
    font-family: 'Pretendard';
    src: url('/shared/fonts/pretendard-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('/shared/fonts/pretendard-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('/shared/fonts/pretendard-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Space Grotesk - Link App (Portal) */
@font-face {
    font-family: 'Space Grotesk';
    src: url('/shared/fonts/spacegrotesk-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Chakra Petch - Rush App */
@font-face {
    font-family: 'Chakra Petch';
    src: url('/shared/fonts/chakrapetch-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Cinzel - Duel App */
@font-face {
    font-family: 'Cinzel';
    src: url('/shared/fonts/cinzel-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Righteous - Cast App */
@font-face {
    font-family: 'Righteous';
    src: url('/shared/fonts/righteous-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Racing Sans One - Vice App */
@font-face {
    font-family: 'Racing Sans One';
    src: url('/shared/fonts/racingsans-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Oxanium - Sign App */
@font-face {
    font-family: 'Oxanium';
    src: url('/shared/fonts/oxanium-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* IM Fell Double Pica - Tear App */
@font-face {
    font-family: 'IM Fell Double Pica';
    src: url('/shared/fonts/imfelldp-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Exo 2 - Star Signal App */
@font-face {
    font-family: 'Exo 2';
    src: url('/shared/fonts/exo2-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Korean Calligraphy - Saju App Signature Font */
@font-face {
    font-family: 'Korean Calligraphy';
    src: url('/shared/fonts/koreancalligraphy-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Yuji Boku - Saju Signature Hanja / Special Symbols Font */
@font-face {
    font-family: 'Yuji Boku';
    src: url('/shared/fonts/yujiboku-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* Gaegu - Self App Signature Font */
@font-face {
    font-family: 'Gaegu';
    src: url('/shared/fonts/gaegu-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Fredoka - Bump App Signature Font */
@font-face {
    font-family: 'Fredoka';
    src: url('/shared/fonts/fredoka-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Material Icons - Shared Utility Icons */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url('/shared/fonts/symbols-400.woff2') format('woff2');
    font-display: swap;
}

.material-icons {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Noto Sans Symbols 2 - Shared Icons */
@font-face {
    font-family: 'Noto Sans Symbols 2';
    src: url('/shared/fonts/symbols2-400.woff2') format('woff2');
    font-display: swap;
}

/* ========================================
   2. CSS VARIABLES - Global (Overridable per App)
   ======================================== */

:root {
    /* --- [THEME SYSTEM v1.0] --- */
    --color-base: #121212;     /* Background / Mood */
    --color-base-rgb: 18, 18, 18;
    --color-main: #ffffff;     /* Primary Accent / Signature */
    --color-main-rgb: 255, 255, 255;
    --color-sub1: #a0a0a0;     /* Secondary Accent */
    --color-sub1-rgb: 160, 160, 160;
    --color-sub2: #404040;     /* Tertiary / Functional / UI Elements */
    --color-sub2-rgb: 64, 64, 64;
    --color-text: #ffffff;     /* Basic Content / Text / Border */
    --color-text-rgb: 255, 255, 255;

    /* --- FONT SYSTEM (Title, Bold, Text + Game Signature) --- */

    /* 1. Title: Platform level major headings (ExtraBold 800) */
    --font-title: 'Pretendard', sans-serif;
    --font-title-weight: 800;

    /* 2. Bold: UI emphasis and data labels (Bold 600) */
    --font-bold: 'Pretendard', sans-serif;
    --font-bold-weight: 600;

    /* 3. Text: Narrative and functional descriptions (Regular 400) */
    --font-text: 'Pretendard', sans-serif;
    --font-text-weight: 400;

    /* 4. Signature: The unique identity of each game */
    --font-signature: var(--font-text);
    --font-signature-weight: 400;

    /* Icons/Symbols */
    --font-symbols: 'Noto Sans Symbols 2', sans-serif;
    --font-hanja: 'Yuji Boku', serif;
    --font-hanja-weight: 400;

    /* Theme Mode (Overridden per app) */
    --theme-mode: dark;
    --scrollbar-thumb: var(--color-sub1);
    --scrollbar-track: rgba(128, 128, 128, 0.1);
    --modal-backdrop: rgba(0, 0, 0, 0.8);
    --modal-panel-bg: rgba(20, 20, 30, 0.7);
    --modal-panel-border: rgba(255, 255, 255, 0.1);

    /* Shell Settings */
    --objekt-shell-subtitle-spacing: 0.05em;

    /* Z-Index Layers (Minimalist Decade Management) */
    /* [APP CONTENT - Local] */
    --z1: 1;  /* App Base / Background */
    --z2: 2;  /* App Game Objects */
    --z3: 3;  /* App HUD / UI */
    --z4: 4;  /* Reserved for App */

    /* [PLATFORM SHELL - Global] */
    --z5: 11; /* Shell Utility Buttons (Home, Settings) */
    --z6: 12; /* Main Modals (Ranking, Settings) */
    --z7: 13; /* Sub Modals (Archive, Database, Feedback, Reset) */
    --z8: 14; /* Notifications / Instant Messages */

    /* [SHELL FRAME TOKENS] */
    --shell-bar-height: 4rem;
    --shell-bar-bg: rgba(10, 11, 16, 0.85);
    --shell-bar-border: rgba(255, 255, 255, 0.1);
    
    /* Modern dynamic viewport height support for mobile toolbar safety */
    --app-vh: 1dvh;
    /* ========================================
       APP SIGNATURE COLOR TOKENS (Centralized)
       ======================================== */
    --app-rush: #00f2ff;
    --app-rush-rgb: 0, 242, 255;
    --app-duel: #d4af37;
    --app-duel-rgb: 212, 175, 55;
    --app-star: #e0e0e0;
    --app-star-rgb: 224, 224, 224;
    --app-self: #f97316;
    --app-self-rgb: 249, 115, 22;
    --app-cast: #ec4899;
    --app-cast-rgb: 236, 72, 153;
    --app-bump: #a3e635;
    --app-bump-rgb: 163, 230, 53;
    --app-saju: #10b981;
    --app-saju-rgb: 16, 185, 129;
    --app-vice: #ff2d55;
    --app-vice-rgb: 255, 45, 85;
    --app-fate: #2563eb;
    --app-fate-rgb: 37, 99, 235;
    --app-info: #5c4fe5;
    --app-info-rgb: 92, 79, 229;
    --app-tear: #bc6eff;
    --app-tear-rgb: 188, 110, 255;
    --app-play: #be185d;
    --app-play-rgb: 190, 24, 93;
}

/* ========================================
   2. LAYER UTILITY CLASSES
   ======================================== */
.layer-1 { z-index: var(--z1); }
.layer-2 { z-index: var(--z2); }
.layer-3 { z-index: var(--z3); }
.layer-4 { z-index: var(--z4); }

/* Global layers use !important to ensure consistency across apps */
.layer-5 { z-index: var(--z5) !important; }
.layer-6 { z-index: var(--z6) !important; }
.layer-7 { z-index: var(--z7) !important; }
.layer-8 { z-index: var(--z8) !important; }

/* Base Body Styles */
html, body { overscroll-behavior: none; overscroll-behavior-y: none; touch-action: none; } body {
    font-family: var(--font-text);
    font-weight: var(--font-text-weight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Prevent text selection system-wide to block unintended browser translate popups */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow text selection in interactive inputs, textareas, selects and editable items */
input, textarea, select, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* General utility class for any custom element that needs to be selectable */
.selectable, .user-select-text {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* ========================================
   3. FONT UTILITY CLASSES
   ======================================== */

.font-title {
    font-family: var(--font-title);
    font-weight: var(--font-title-weight);
}

.font-bold {
    font-family: var(--font-bold);
    font-weight: var(--font-bold-weight);
}

.font-text {
    font-family: var(--font-text);
    font-weight: var(--font-text-weight);
}

.font-signature {
    font-family: var(--font-signature);
    font-weight: var(--font-signature-weight);
}

.font-symbols {
    font-family: var(--font-symbols);
}

.font-hanja {
    font-family: var(--font-hanja);
    font-weight: var(--font-hanja-weight);
}

/* ========================================
   4. BUTTON SYSTEM - Standard Action Buttons
   ======================================== */

.btn-action {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: all 0.2s;
    /* Uses font-signature as default */
    font-family: var(--font-signature);
    font-weight: var(--font-signature-weight);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   5. TEXT UTILITIES
   ======================================== */

.text-glow {
    text-shadow: 0 0 8px currentColor;
}

.text-glow-sm {
    text-shadow: 0 0 4px currentColor;
}

/* ========================================
   6. SCROLLBAR UTILITIES
   ======================================== */

.scrollbar-none {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

.objekt-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.objekt-scrollbar::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.objekt-scrollbar::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

.objekt-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
}

/* ========================================
   7. MODAL SYSTEM
   ======================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--modal-backdrop);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    z-index: var(--z6);
    /* Top level UI */
}

.modal-panel {
    background: var(--modal-panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--modal-panel-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-radius: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 28rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ========================================
   7.2 STANDARD APP MODAL (Ranking/Database)
   Outer Layout "The Walls"
   ======================================== */

.objekt-modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--modal-backdrop);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem;
    font-family: var(--font-text), sans-serif;
    color: var(--color-text);
    z-index: var(--z7);
}

.objekt-modal-panel {
    width: 100%;
    max-width: 448px; /* 28rem (Mobile Standard) */
    height: 100%;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    background: var(--modal-panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--modal-panel-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 1.5rem;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.objekt-modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.objekt-modal-title {
    font-family: var(--font-bold), sans-serif;
    font-size: 1.5rem; /* text-2xl */
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-main);
    text-transform: uppercase;
}

.objekt-modal-subtitle {
    font-family: var(--font-bold), sans-serif;
    font-size: 0.75rem; /* text-xs */
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 0.25rem;
    color: var(--color-text);
}

.objekt-modal-content {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.25rem; /* Space for scrollbar */
    
    /* Inherit Objekt Scrollbar style */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.objekt-modal-content::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.objekt-modal-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

.objekt-modal-content::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
}

.objekt-modal-footer {
    flex-shrink: 0;
    display: flex;
    gap: 0.75rem;
}

.objekt-modal-back-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-bold), sans-serif;
    transition: all 0.3s;
    background: rgba(var(--color-text-rgb), 0.05);
    border: 1px solid rgba(var(--color-text-rgb), 0.15);
    color: var(--color-text);
    cursor: pointer;
}

.objekt-sub-btn:hover {
    background-color: rgba(var(--color-text-rgb), 0.1);
    border-color: rgba(var(--color-text-rgb), 0.4);
}

/* Badge Item Utility */
.objekt-badge-item {
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    border: 1px solid rgba(var(--color-text-rgb), 0.1);
    background-color: rgba(var(--color-base-rgb), 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
    opacity: 0.6;
}

.objekt-badge-item.is-selected {
    background-color: rgba(var(--color-main-rgb), 0.1) !important;
    border-color: var(--color-main) !important;
    transform: scale(1.05);
    opacity: 1;
}

.objekt-badge-item:hover:not(.is-selected) {
    opacity: 1;
    background-color: rgba(var(--color-text-rgb), 0.05);
    border-color: rgba(var(--color-text-rgb), 0.3);
}

.objekt-modal-back-btn:hover {
    background: rgba(var(--color-text-rgb), 0.15);
    border-color: rgba(var(--color-text-rgb), 0.4);
    transform: translateY(-2px);
}

.objekt-modal-back-btn:active {
    transform: scale(0.98) translateY(0px);
}

/* ========================================
   8. SHELL SYSTEM (Global UI)
   ======================================== */

.objekt-shell-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 448px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: var(--z5);
}

.objekt-shell-btn {
    pointer-events: auto;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: rgba(var(--color-main-rgb), 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(var(--color-main-rgb), 0.2);
    color: var(--color-main) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none !important;
}

.objekt-shell-btn:hover {
    background: var(--color-main);
    color: white !important;
}

.objekt-shell-btn:active {
    transform: scale(0.95);
}

.objekt-shell-btn i,
.objekt-shell-btn span,
.objekt-shell-btn svg {
    font-size: 1.35rem !important;
    transition: transform 0.3s ease;
}

/* Utility Group (Top Buttons in Title) */
.objekt-shell-top-utility {
    width: 100%;
    max-width: 448px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem 0.25rem; /* Matches utility app (pt-3.5 px-5 pb-1) button offset */
    pointer-events: none;
}

/* Hover effects for Home/Settings */
.objekt-shell-btn-home:hover i,
.objekt-shell-btn-home:hover span,
.objekt-shell-btn-home:hover svg {
    transform: translateX(-4px);
}

.objekt-shell-btn-settings:hover i,
.objekt-shell-btn-settings:hover span,
.objekt-shell-btn-settings:hover svg {
    transform: rotate(90deg); } .objekt-shell-btn-share:hover i, .objekt-shell-btn-share:hover span, .objekt-shell-btn-share:hover svg { transform: scale(1.15); }

/* --- TITLE SHELL SYSTEM --- */

.objekt-shell-title-group {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: var(--z1);
    pointer-events: none;
    padding-top: env(safe-area-inset-top);
}

/* Branding & Logo Locks */
.objekt-shell-logo-group {
    margin-top: calc(var(--app-vh, 1vh) * 18);
    width: 100%;
    max-width: 448px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.objekt-shell-logo-branding {
    font-family: var(--font-title);
    font-weight: var(--font-title-weight);
    font-size: 2rem !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    margin-bottom: 0.1rem !important;
    pointer-events: auto;
}

.objekt-shell-game-name {
    height: 5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto;
}

.objekt-shell-game-name span {
    font-family: var(--font-signature), sans-serif !important;
    font-size: 5rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
}

.objekt-shell-subtitle {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: var(--objekt-shell-subtitle-spacing) !important;
    text-transform: uppercase !important;
    font-family: 'Pretendard', sans-serif !important;
    margin-top: 0.5rem !important;
    pointer-events: auto;
    /* Signature Accent color from each app */
    color: var(--color-main) !important;
}

.objekt-shell-btn-deck {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: auto;
}

.objekt-shell-main-btn {
    width: 100% !important;
    padding: 0.75rem !important;
    border-radius: 0.75rem !important;
    /* [LOCK] Button type standards */
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    border: 1px solid transparent;
    outline: none;
    /* Force using Signature font */
    font-family: var(--font-signature), sans-serif !important;
}

/* Button States */
.btn-action.disabled,
.btn-action:disabled {
    opacity: 0.3 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

.objekt-shell-sub-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

.objekt-shell-sub-btn {
    width: 100% !important;
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    cursor: pointer;
    transition: all 0.3s;
    background: none;
    border: 1px solid transparent;
    outline: none;
    /* Force using Signature font */
    font-family: var(--font-signature), sans-serif !important;
}
/* ========================================
   9. TOAST NOTIFICATION SYSTEM
   ======================================== */

.objekt-toast-container {
    position: fixed;
    top: 4.5rem; /* Raised higher up */
    left: 50%;
    transform: translate(-50%, -2rem) scale(0.9);
    opacity: 0;
    width: max-content;
    min-width: 180px;
    max-width: 90vw;
    padding: 0.55rem 1.25rem; /* Reduced vertical padding for a slimmer look */
    border-radius: 1rem; /* rounded-2xl */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--toast-border-color);
    background: var(--toast-bg-color);
    box-shadow: 0 0 20px var(--toast-shadow-color);
    font-family: var(--font-signature, sans-serif);
    font-size: 0.875rem; /* text-sm */
    font-weight: 900; /* font-black */
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-style: italic;
    color: var(--toast-text-color);
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.objekt-toast-container.is-active {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.objekt-toast-icon {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: var(--toast-icon-color);
    flex-shrink: 0;
}

.objekt-toast-icon.animate-pulse {
    animation: toast-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes toast-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.objekt-toast-message {
    text-shadow: 0 0 10px rgba(var(--color-main-rgb, 255, 255, 255), 0.2);
    white-space: nowrap;
}

/* Default / System Type */
.objekt-toast-container.is-system,
.objekt-toast-container.is-info {
    --toast-bg-color: rgba(var(--color-base-rgb, 18, 18, 18), 0.85);
    --toast-border-color: rgba(var(--color-text-rgb, 255, 255, 255), 0.15);
    --toast-shadow-color: rgba(0, 0, 0, 0.2);
    --toast-text-color: var(--color-text, #ffffff);
    --toast-icon-color: var(--color-sub1, #ffffff);
}

/* Correct / Success Type */
.objekt-toast-container.is-correct,
.objekt-toast-container.is-success {
    --toast-bg-color: rgba(var(--color-base-rgb, 18, 18, 18), 0.85);
    --toast-border-color: var(--color-main, #ffffff);
    --toast-shadow-color: rgba(var(--color-main-rgb, 255, 255, 255), 0.3);
    --toast-text-color: var(--color-text, #ffffff);
    --toast-icon-color: var(--color-main, #ffffff);
}

/* Fail / Incorrect / Warn Type */
.objekt-toast-container.is-fail,
.objekt-toast-container.is-incorrect,
.objekt-toast-container.is-warn {
    --toast-bg-color: rgba(var(--color-base-rgb, 18, 18, 18), 0.85);
    --toast-border-color: var(--color-sub1, #ef4444);
    --toast-shadow-color: rgba(var(--color-sub1-rgb, 239, 68, 68), 0.3);
    --toast-text-color: var(--color-text, #ffffff);
    --toast-icon-color: var(--color-sub1, #f87171);
}

/* ========================================
   8. SYSTEM UI STANDARD CLASSES
   ======================================== */

/* Root Overlay Container */
.objekt-system-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 448px; /* max-w-md */
    margin-left: auto;
    margin-right: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    backdrop-filter: blur(12px);
    background-color: rgba(var(--color-base-rgb), 0.85);
    font-family: var(--font-text), sans-serif;
    color: var(--color-text);
}

/* Common Panel Styling */
.objekt-panel-std {
    background-color: rgba(var(--color-base-rgb), 0.5);
    border: 1px solid rgba(var(--color-text-rgb), 0.3);
    border-left-width: 4px;
    border-left-color: var(--color-main);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.objekt-panel-plain {
    background-color: rgba(var(--color-base-rgb), 0.5);
    border: 1px solid rgba(var(--color-text-rgb), 0.3);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

/* Info/Input Box Styling */
.objekt-info-box {
    display: flex;
    align-items: center;
    border: 1px solid rgba(var(--color-text-rgb), 0.4);
    background-color: rgba(var(--color-base-rgb), 0.3);
    border-radius: 0.5rem;
    padding: 0.25rem 0.625rem;
}

/* Text & Glow Effects */
.text-main { color: var(--color-main) !important; }
.text-sub { color: var(--color-sub1) !important; }
.text-text { color: var(--color-text) !important; }
.text-glow { 
    text-shadow: 0 0 10px rgba(var(--color-main-rgb, 255, 255, 255), 0.4); 
}

/* Form Elements */
.objekt-select {
    appearance: none;
    background-color: rgba(var(--color-base-rgb), 0.3);
    border: 1px solid rgba(var(--color-text-rgb), 0.4);
    color: var(--color-text);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    outline: none;
    transition: all 0.2s;
}

.objekt-slider {
    flex-grow: 1;
    height: 0.5rem;
    border-radius: 0.5rem;
    appearance: none;
    cursor: pointer;
    background-color: rgba(var(--color-text-rgb), 0.4);
}

.objekt-btn-outline {
    background-color: rgba(var(--color-text-rgb), 0.05);
    border: 1px solid rgba(var(--color-text-rgb), 0.4);
    color: var(--color-text);
    border-radius: 0.75rem;
    padding: 0.625rem;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s;
}

/* Sub-Modal Backdrop */
.objekt-sub-modal-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(12px);
    background-color: rgba(var(--color-base-rgb), 0.6);
    font-family: var(--font-text), sans-serif;
    color: var(--color-text);
    z-index: var(--z7);
}

.objekt-border-dim { border-color: rgba(var(--color-text-rgb), 0.1) !important; }
.objekt-bg-dim { background-color: rgba(var(--color-text-rgb), 0.05) !important; }

.objekt-modal-panel {
    width: 100%;
    max-width: 384px; /* max-w-sm */
    background-color: var(--color-base);
    border: 1px solid rgba(var(--color-text-rgb), 0.2);
    border-radius: 1.5rem; /* rounded-3xl */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 92dvh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.objekt-sub-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    border: 1px solid rgba(var(--color-text-rgb), 0.2);
    background-color: rgba(var(--color-text-rgb), 0.05);
    color: var(--color-text);
    transition: all 0.2s;
}


/* ========================================
   9. CONFIRM MODAL (Centralized)
   ======================================== */

.objekt-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: objekt-confirm-fadein 0.2s ease-out;
}

@keyframes objekt-confirm-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.objekt-confirm-card {
    width: 100%;
    max-width: 320px;
    background-color: var(--color-base, #121212);
    border: 1px solid rgba(var(--color-text-rgb, 255, 255, 255), 0.15);
    border-radius: 1.25rem;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: objekt-confirm-scaleup 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes objekt-confirm-scaleup {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.objekt-confirm-icon {
    text-align: center;
    font-size: 1.75rem;
    line-height: 1;
}

.objekt-confirm-title {
    font-family: var(--font-text, sans-serif);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-sub1, #ef4444);
    text-align: center;
}

.objekt-confirm-message {
    font-family: var(--font-text, sans-serif);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(var(--color-text-rgb, 255, 255, 255), 0.6);
    text-align: center;
    white-space: pre-line;
}

.objekt-confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.objekt-confirm-btn {
    width: 100%;
    padding: 0.65rem;
    border-radius: 0.65rem;
    font-family: var(--font-text, sans-serif);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    outline: none;
}

.objekt-confirm-btn.btn-danger {
    background-color: var(--color-sub1, #ef4444);
    color: #000;
}

.objekt-confirm-btn.btn-danger:hover {
    filter: brightness(1.15);
}

.objekt-confirm-btn.btn-cancel {
    background-color: rgba(var(--color-text-rgb, 255, 255, 255), 0.06);
    border: 1px solid rgba(var(--color-text-rgb, 255, 255, 255), 0.15);
    color: rgba(var(--color-text-rgb, 255, 255, 255), 0.7);
}

.objekt-confirm-btn.btn-cancel:hover {
    background-color: rgba(var(--color-text-rgb, 255, 255, 255), 0.12);
    color: var(--color-text, #fff);
}

/* ========================================
   9. GLOBAL BASE & SHELL UTILITIES
   ======================================== */

[x-cloak] {
    display: none !important;
}

body,
#game-container {
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    background-color: var(--color-base);
    color: var(--color-text);
}

.objekt-app-frame {
    width: 100%;
    max-width: 448px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.objekt-bar-top-frame {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    height: calc(var(--shell-bar-height) + env(safe-area-inset-top));
    background: var(--shell-bar-bg);
    border-bottom: 1px solid var(--shell-bar-border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
    z-index: var(--z5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.objekt-bar-bottom-frame {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    height: calc(var(--shell-bar-height) + env(safe-area-inset-bottom));
    background: var(--shell-bar-bg);
    border-top: 1px solid var(--shell-bar-border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    z-index: var(--z5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

/* SIGNATURE HEADERS - Uses Signature font */
h1,
h2,
h3,
h4 {
    font-family: var(--font-signature);
}

/* --- THEME UTILS --- */
.text-main {
    color: var(--color-main);
}

.text-sub1 {
    color: var(--color-sub1);
}

.text-sub2 {
    color: var(--color-sub2);
}

/* Glass Button Utilities (Shared UI) */
.glass-btn, .glass-button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.2s ease;
}

.glass-btn:hover, .glass-button:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06)) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
}
