@font-face {
    font-family: 'PP Editorial Old';
    src: url('Resources/fonts/PPEditorialOld-UltralightItalic.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Tondo';
    src: url('Resources/fonts/tondo-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Tondo Bold';
    src: url('Resources/fonts/tondo-bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Accent colors for each experience */
    --accent-color: #4F95E8;
    --mirror-color: #4F95E8;
    --books-color: #FF9F0A;
    --scribble-color: #4CB963;
    --puzzles-color: #FFD60A;
    --counting-color: #5E5CE6;
    
    /* Background colors for experiences */
    --mirror-bg: #000000;
    --books-bg: #FFF8E6;
    --scribble-bg: #FFFFFF;
    --puzzles-bg: #FFF9E0;
    --counting-bg: #F0F8FF;
    
    /* Safe area insets - used for iOS notch and home indicator areas */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);

    /* CSS variable for layout settings */
    --image-border-radius: 0px;
    --gallery-border-radius: 4px;
}

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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Tondo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes logoGlow {
    0% {
        box-shadow: 0 0 5px 2px var(--accent-color, var(--camera-color));
    }
    50% {
        box-shadow: 0 0 15px 5px var(--accent-color, var(--camera-color));
    }
    100% {
        box-shadow: 0 0 5px 2px var(--accent-color, var(--camera-color));
    }
}

@keyframes logoJiggle {
    0% { transform: rotate(0deg) translate(0, 0); }
    25% { transform: rotate(-2deg) translate(-1px, 1px); }
    50% { transform: rotate(2deg) translate(1px, -1px); }
    75% { transform: rotate(-1deg) translate(0, 0); }
    100% { transform: rotate(0deg) translate(0, 0); }
}

/* Combine the two .nav-brand-icon classes */
.nav-brand-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    animation: logoGlow 3s ease-in-out infinite;
    transition: transform 0.2s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid var(--accent-color);
    cursor: pointer;
}

.nav-brand-icon:hover {
    animation: logoJiggle 0.3s ease-in-out 1;
}

.nav-brand-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

#gallery-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#gallery-canvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: none; /* Hide by default as we're using the mirror interface */
    background: #000;
}

/* Overlay Elements */
.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 15;
    z-index: 1001;
    pointer-events: none;
}

.overlay-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* Pass through all touch events by default */
}

.overlay-header {
    text-align: left;
    margin: 0;
}

.overlay-header h1 {
    font-family: 'Tondo', sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    color: var(--accent-color);
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.overlay-header .tagline {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 400;
    margin: 0;
}

.overlay-nav {
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: top;
    height: auto;
    pointer-events: none; /* This makes the nav pass through touch events by default */
    background: linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 100%);
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1); /* Add smooth transition */
    padding-bottom: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    margin: 0;
    padding: 0;
    pointer-events: auto; /* Enable pointer events for the links */
}

.overlay-nav a,
.badge-container {
    pointer-events: auto; /* Enable pointer events specifically for links and badges */
}

.overlay-nav a {
    color: var(--accent-color);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.overlay-nav a:hover {
    opacity: 1;
}

.badge-container {
    display: flex;
    gap: 8px;
    align-items: top;
    margin: 0;
    pointer-events: auto;
}

/* Wrapper */
.wrapper {
    width: 100%;
    height: 100vh; /* Use viewport height */
    position: relative; /* Change from fixed */
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr 1fr; /* Stack children vertically */
    gap: 4px;
    margin-bottom: env(safe-area-inset-bottom);
}

/* Adding animation for toybox to slide in from bottom */
@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ToyBox Styles */
.toybox {
    position: relative; /* Change from fixed */
    bottom: unset; /* Remove fixed positioning */
    left: unset; /* Remove fixed positioning */
    width: 100%;
    height: 80px; /* Define a fixed height, adjust as needed */
    background-color: #212124;
    border-top-left-radius: 56px;
    border-top-right-radius: 56px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1); /* Adjust shadow */
    z-index: 1000;
    overflow: hidden; 
    flex-shrink: 0; /* Prevent toybox from shrinking */
    /* Apply padding for safe area */
    padding-bottom: var(--safe-area-inset-bottom);
    box-sizing: content-box; /* Ensure padding adds to height */
    /* Animation properties */
    animation: slideInFromBottom 0.25s ease-out forwards;
    /* Removed unnecessary styles like -webkit-text-size-adjust, transform, -webkit-overflow-scrolling */
}

.toybox::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('Resources/images/ShapesSquare.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.25; /* Increased opacity to make it more visible */
    z-index: 0; /* Changed from -1 to ensure it appears above the background color */
    pointer-events: none; /* Ensure it doesn't interfere with clicks */
}

.toybox-scroll-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.toybox-container {
    position: relative;
    z-index: 1;
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.toybox-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Fixed shadow overlays */
.toybox-shadow-left,
.toybox-shadow-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.toybox-shadow-left {
    left: 0;
    background: linear-gradient(to right, rgba(33, 33, 36, 1), rgba(33, 33, 36, 0));
}

.toybox-shadow-right {
    right: 0;
    background: linear-gradient(to left, rgba(33, 33, 36, 1), rgba(33, 33, 36, 0));
}

.toybox-nav {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 25px;
    min-width: max-content;
    padding: 0 calc(50vw - 120px); /* Centers the active button */
}

/* Combine toybox-button and toybox-link with shared properties */
.toybox-button,
.toybox-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.toybox-link {
    text-decoration: none;
}

.toybox-button:active,
.toybox-link:active {
    transform: scale(0.95);
}

.icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
}

/* Consolidate icon styles */
.toybox-icon,
.modal-close-icon,
.action-icon {
    transition: opacity 0.2s ease;
}

.toybox-icon {
    width: 24px;
    height: 24px;
    opacity: 1;
    filter: brightness(0) invert(1); /* Make icons white by default */
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.modal-close-icon {
    width: 16px;
    height: 16px;
    color: rgb(255, 255, 255);
    z-index: 3;
    opacity: 0.5;
}

.action-icon {
    width: 24px;
    height: 24px;
    color: #FFD700;
    opacity: 0.9;
}

.modal-close-icon:hover,
.action-icon:hover,
.layout-settings-btn:hover img {
    opacity: 1;
}

.toybox-label {
    font-size: 12px;
    font-family: 'Tondo Bold', 'Tondo', sans-serif;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.toybox-button.active .toybox-icon {
    filter: brightness(1) invert(0);
}

.toybox-button.active .toybox-label {
    color: var(--accent-color);
}

.toybox-spacer {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* Apply accent colors to active icons based on experience */
.toybox-button[data-experience="mirror"].active .toybox-icon {
    filter: brightness(0) saturate(100%) invert(53%) sepia(96%) saturate(1233%) hue-rotate(194deg) brightness(97%) contrast(87%);
}

.toybox-button[data-experience="books"].active .toybox-icon {
    filter: brightness(0) saturate(100%) invert(80%) sepia(29%) saturate(5954%) hue-rotate(346deg) brightness(103%) contrast(101%);
}

.toybox-button[data-experience="scribble"].active .toybox-icon {
    filter: brightness(0) saturate(100%) invert(73%) sepia(40%) saturate(728%) hue-rotate(78deg) brightness(92%) contrast(88%);
}

.toybox-button[data-experience="puzzles"].active .toybox-icon {
    filter: brightness(0) saturate(100%) invert(88%) sepia(36%) saturate(1100%) hue-rotate(356deg) brightness(103%) contrast(103%);
}

.toybox-button[data-experience="counting"].active .toybox-icon {
    filter: brightness(0) saturate(100%) invert(42%) sepia(43%) saturate(7424%) hue-rotate(231deg) brightness(98%) contrast(94%);
}

/* Apply the same accent colors to the nav-brand-icon border for each experience */
body[data-active-experience="mirror"] .nav-brand-icon {
    border-color: var(--mirror-color);
}

body[data-active-experience="books"] .nav-brand-icon {
    border-color: var(--books-color);
}

body[data-active-experience="scribble"] .nav-brand-icon {
    border-color: var(--scribble-color);
}

body[data-active-experience="puzzles"] .nav-brand-icon {
    border-color: var(--puzzles-color);
}

body[data-active-experience="counting"] .nav-brand-icon {
    border-color: var(--counting-color);
}

/* Content container */
.content-container {
    position: relative; /* Change from fixed */
    width: 100%;
    overflow-y: auto; /* Allow vertical scrolling */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    height: calc(100vh - 76px);
}

/* Experience styles */
.experience {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    border-radius: 0 0 56px 56px;
    overflow: hidden;
    box-sizing: border-box;
    max-height: 100%;
}

.experience.active {
    display: block;
}

/* Specific background colors for each experience */
.camera-experience {
    background-color: var(--mirror-bg);
}

.books-experience,
.scribble-experience {
    background-color: var(--scribble-bg);
}

.puzzle-experience {
    background-color: var(--puzzles-bg);
}

.counting-experience {
    background-color: var(--counting-bg);
    color: #333;
}

/* Shared placeholder styles */
.placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.placeholder h2 {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--accent-color);
    font-weight: 500;
}

.placeholder p {
    font-size: 18px;
    color: rgba(0, 0, 0, 0.7);
}

/* Experience-specific placeholder color overrides */
.camera-experience .placeholder h2 {
    color: var(--mirror-color);
}

.camera-experience .placeholder p {
    color: rgba(255, 255, 255, 0.7);
}

.books-experience .placeholder h2 {
    color: var(--books-color);
}

.scribble-experience .placeholder h2 {
    color: var(--scribble-color);
}

.puzzle-experience .placeholder h2 {
    color: var(--puzzles-color);
}

.counting-experience .placeholder h2 {
    color: var(--counting-color);
}

/* Camera feed */
.camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Center the camera feed container */
#camera-feed-container {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.camera-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.camera-error p {
    margin-bottom: 10px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Color Menu Styles for Drawing Experience */
.color-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #e5e5ea;
    display: flex;
    justify-content: center;
    padding: 12px 0;
    z-index: 100;
}

/* Fullscreen View */
#fullscreen-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1500;
    cursor: pointer;
    overflow: hidden;
}

#fullscreen-view.visible {
    opacity: 1;
}

#fullscreen-view.hidden {
    display: none;
}

#fullscreen-canvas {
    position: absolute;
    object-fit: cover;
    transition: width 0.3s ease, height 0.3s ease;
}

.app-store-badge {
    height: 32px;
    width: auto;
    display: block;
    margin: 0;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.app-store-badge:hover {
    opacity: 1;
}

.one-time-badge {
    height: 32px;
    width: 120px;
    background: #000;
    border: 1px solid #eac342e1;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 12px;
    transition: all 0.2s ease;
    opacity: 0.9;
    text-decoration: none;
    cursor: pointer;
}

.one-time-badge:hover {
    opacity: 1;
    text-decoration: none;
}

.one-time-badge .subtitle {
    color: #eac342c9;
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 2px;
    text-align: center;
}

.one-time-badge .title {
    color: #eac342;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* Standardize modal-related styles with shared properties */
.feature-modal,
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
}

.feature-modal {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 40px 20px;
}

.feature-modal.visible {
    opacity: 1;
    visibility: visible;
}

/* Modal responsive styles moved to the end */

.modal-header {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a; /* Fallback background color */
    /*margin-bottom: 24px;*/
}

#manage-modal .modal-header {
    background-image: url('Resources/images/PlayPack_icon.webp');
}

#create-modal .modal-header {
    background-image: url('Resources/images/PlayPack_icon.webp');
}

#about-modal .modal-header {
    background-image: url('Resources/images/PlayPack_icon.webp');
}

#pricing-modal .modal-header {
    background-image: url('Resources/images/PlayPack_icon.webp');
}

.modal-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1;
}

.modal-header-content {
    position: absolute;
    z-index: 2;
    height: 100%;
    display: flex;
    padding: 24px;
    flex-direction: column;
    justify-content: flex-end;
}

.modal-header h1 {
    font-family: 'Tondo', sans-serif;
    font-size: 72px;
    font-weight: 200;
    font-style: italic;
    letter-spacing: -0.02em;
    line-height: 0.8;
    padding-bottom: 2rem;
    color: #fff;
}

.modal-tagline {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.description {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
}

.description p {
    font-size: 17px;
    color: #808080;
    font-weight: 400;
    line-height: 1.5;
}

.features {
    padding: 32px 0;
}

/* Combined legal content heading styles moved to the end */
.features h2 {
    font-family: 'Tondo', sans-serif;
    font-size: 32px;
    font-weight: 200;
    font-style: italic;
    margin-bottom: 32px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feature-row span {
    font-size: 17px;
    color: #fff;
    white-space: nowrap;
}

.feature-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.modal-close {
    position: fixed;
    top: 4px;
    right: 4px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.modal-close::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: rgba(127, 127, 127, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s ease;
}

.modal-close img {
    position: relative;
    width: 16px;
    height: 16px;
    z-index: 1;
    color: white;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.modal-close:hover img {
    opacity: 1;
}

.modal-close:active::before {
    transform: scale(0.92);
}

.modal-close-icon {
    width: 16px;
    height: 16px;
    color: rgb(255, 255, 255);
    z-index: 3;
    opacity: 0.5;
}

.modal-close-icon:hover {
    opacity: 1;
}

/* Modal responsive styles moved to the end */

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    color: #000;
    min-height: 100vh;
}

body.legal-body {
    overflow-y: auto;
    background: #FCF4E2;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    position: relative;
}

body.legal-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('assets/images/ShapesSquare.png');
    background-size: cover;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.legal-header {
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.app-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Legal header styles consolidated at the end */
.legal-header h1 {
    font-family: 'Tondo', sans-serif;
    font-size: 72px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.8;
    margin-bottom: 16px;
    color: #000;
    text-align: center;
}

/* Legal tagline styles consolidated at the end */
.legal-tagline {
    font-size: 17px;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
}

.legal-content {
    position: relative;
    z-index: 1;
}

.legal-content section {
    margin-bottom: 48px;
}

/* Legal content heading styles consolidated at the end */
.legal-content h2 {
    font-family: 'Tondo', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #000;
}

.legal-content h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 24px 0 12px;
    color: #000;
}

.legal-content p {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 16px;
}

.legal-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.legal-content li {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.legal-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: purple;
}

.legal-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.back-link {
    color: purple;
    text-decoration: none;
    font-size: 17px;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.back-link:hover {
    opacity: 0.8;
}

/* Legal responsive styles moved to the end */

.feature-request-body {
    flex: 1;
    min-height: 700px;
    position: relative;
}

.feature-request-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
} 

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plain-terms {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 48px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.plain-terms-section {
    margin-bottom: 24px;
}

.plain-terms-section:last-child {
    margin-bottom: 0;
}

/* Legal content heading styles consolidated at the end */
.plain-terms h3 {
    font-family: 'Tondo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: purple;
    margin-bottom: 8px;
}

.plain-terms p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
}

.terms-divider {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    margin: 40px 0;
    border-radius: 2px;
}

.modal-cta {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 24px;
}

.modal-cta .app-store-badge {
    height: 48px;
    width: auto;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.modal-cta .app-store-badge:hover {
    opacity: 0.9;
} 

/* Heading styles consolidated at the end */

.video-container {
    width: 65%;
    max-width: 800px;
    margin: 0 auto 24px;
    position: relative;
    padding-top: calc(65% * (16 / 9));
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
} 

/* Layout Settings */
.layout-settings-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.layout-settings-btn:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
}

.layout-settings-btn.active {
    background: rgba(0, 0, 0, 0.8);
    border-color: #f7ce46;
}

.layout-settings-btn img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.layout-settings-btn:hover img,
.layout-settings-btn.active img {
    opacity: 1;
}

.layout-settings-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 300px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
    z-index: 10001;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, height 0.3s ease;
}

.layout-settings-panel.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.layout-settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.layout-settings-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.layout-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 11px;
    color: #fff;
}

.layout-control-value {
    color: #f7ce46;
}

.layout-settings-types {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.layout-type-button {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.layout-type-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.layout-type-button.active {
    background: rgba(255, 255, 255, 0.1);
}

.layout-type-button img {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.layout-type-button:hover img,
.layout-type-button.active img {
    opacity: 1;
}

.layout-type-button.active img {
    color: #f7ce46;
}

.layout-type-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}

.layout-type-button.active::after {
    background: #f7ce46;
}

/* Slider styles */
.layout-slider-container {
    padding: 0 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.layout-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 2px;
}

.layout-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layout-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.layout-slider::-webkit-slider-thumb:hover,
.layout-slider:active::-webkit-slider-thumb {
    background: #f7ce46;
    transform: scale(1.1);
}

.layout-slider::-moz-range-thumb:hover,
.layout-slider:active::-moz-range-thumb {
    background: #f7ce46;
    transform: scale(1.1);
}

/* Layout settings responsive styles moved to the end */

/* Apply border radius to the gallery items */
.gallery-item {
    border-radius: var(--gallery-border-radius);
    overflow: hidden;
}

/* Typography - Global Font Declarations */
body,
button,
input, 
select, 
textarea,
.toybox-button,
h1, h2, h3, h4, h5, h6,
.overlay-nav a,
.toybox-nav,
.modal-close,
.modal-body,
.modal-content p,
.legal-content p,
.legal-content li,
.legal-tagline,
.badge-container,
.back-link,
.one-time-badge,
.modal-cta,
.color-menu,
.plain-terms p,
.plain-terms h3 {
    font-family: 'Tondo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.lut-name, 
.layout-control-header {
    font-family: 'Tondo', ui-monospace, "SF Mono", monospace;
}

.toybox-label {
    font-family: 'Tondo Bold', 'Tondo', sans-serif;
}

.feature-modal .modal-body.legal-content-modal {
    max-height: 80vh;
    min-height: 700px;
    height: 700px;
    overflow-y: auto;
    padding: 0;
}

.feature-modal iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: none;
    background: transparent;
}

/* Styling for iframe parent pages */
.iframe-mode .legal-page {
    padding: 20px;
    max-width: none;
    margin: 0;
    min-height: auto;
}

.iframe-mode .legal-header {
    margin-bottom: 30px;
}

.iframe-mode .legal-header h1 {
    font-size: 42px;
}

.iframe-mode .back-link {
    display: none;
}

/* Camera experience styles */
.camera-experience {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

#camera-feed-container {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
}

.camera-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    pointer-events: auto;
}

.shutter-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: 4px solid white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.shutter-button:active {
    transform: scale(0.95);
}

.animated-border {
    z-index: 10;
    overflow: hidden;
}

/* Saved images container */
.saved-images-container {
    position: absolute;
    bottom: 32px; /* Anchor to bottom */
    right: 0;
    height: 100%;
    max-height: calc(100% - 40px); /* Max height, leaving padding */
    padding: 0 32px; /* Remove top/bottom padding, keep side */
    display: flex;
    flex-direction: column-reverse; /* Stack items upwards */
    gap: 10px;
    z-index: 20;
    overflow-y: auto; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    
    /* Fade-out effect at the TOP */
    mask-image: linear-gradient(to top, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 85%, transparent 100%);
}

.saved-images-container::-webkit-scrollbar {
    display: none; 
}

/* Placeholder styling */
.placeholder-thumbnail {
    /* Uses same size/border as regular thumbnails */
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner animation */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s ease-in-out infinite;
}

.shapes-option .image-container {
    width: 100px;
    height: 100px;
    background-image: url('Resources/images/ShapesSquare.webp'); /* Replace with actual image path */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.watermark::before,
.watermark::after {
    content: "";
    position: absolute;
    background-image: url('Resources/images/PlayPack_icon.webp');
    background-repeat: repeat;
    background-size: 150px; /* Adjust size as needed */
    opacity: 0.05; /* Adjust opacity as needed */
    pointer-events: none; /* Ensure watermark doesn't interfere with interactions */
}

.watermark::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.watermark::after {
    top: 75px; /* Offset the second layer */
    left: 75px;
    width: calc(100% - 75px);
    height: calc(100% - 75px);
}

/* Re-add the modal-content styles that were accidentally removed */
.modal-content {
    margin: auto;
    width: 100%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    position: relative;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease;
}

.feature-modal.visible .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* --- Consolidated Media Queries --- */

/* General Responsive (max-width: 768px) */
@media (max-width: 768px) {
    /* Overlay */
    .overlay-header {
        position: fixed;
        text-align: center;
        margin-bottom: 8px;
        pointer-events: auto; /* Enable pointer events for the header */
    }
    .overlay-header h1 {
        font-size: 28px;
    }
    .overlay-header .tagline {
        font-size: 0.75rem;
    }
    
    /* Nav Links */
    .nav-links {
        justify-content: center;
        gap: 16px;
        width: 100%;
        flex-wrap: wrap;
    }
    .badge-container {
        order: 3;
    }
    .app-store-badge {
        height: 28px;
    }
    
    /* Toybox */
    .toybox {
        height: 70px; /* Adjust height for smaller screens if needed */
        /* border-radius adjustments might go here if needed */
    }
    .toybox-nav {
        gap: 15px;
        padding: 0 calc(50vw - 70px); /* Adjust for smaller screens */
    }
    .toybox-button, 
    .toybox-link {
        padding: 8px 5px;
    }
    .toybox-icon {
        width: 22px;
        height: 22px;
    }
    .toybox-label {
        font-size: 10px;
    }
    .toybox-spacer {
        height: 24px;
    }
    
    /* Modals */
    .feature-modal {
        padding: 0;
        align-items: flex-end;
    }
    .modal-content {
        min-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .feature-modal.visible .modal-content {
        transform: translateY(0);
    }
    .modal-close {
        position: fixed;
        top: env(safe-area-inset-top, 4px);
        right: env(safe-area-inset-right, 4px);
    }
    .modal-header h1 {
        font-size: 48px;
    }
    .modal-body {
        flex: 1;
    }
    
    /* Legal Pages */
    .legal-header h1 {
        font-size: 48px;
    }
    .legal-content h2 {
        font-size: 24px;
    }
    
    /* Layout Settings */
    .layout-settings-btn {
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
    }
    .layout-settings-btn img {
        width: 16px;
        height: 16px;
    }
    .layout-settings-panel {
        top: 60px;
        right: 16px;
        width: calc(100% - 32px);
        max-width: 300px;
    }
}

/* --- Puzzles Section --- */

.puzzle-area {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    overflow: hidden;
    transition: height 0.3s ease;
}

.puzzle-grid {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.2;
    z-index: 1;
    transition: opacity 0.8s ease-in-out;
    /* Center the grid within the puzzle area */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}

.puzzle-completed-image {
    position: absolute;
    /* Match the puzzle grid size */
    width: inherit;
    height: inherit;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 20; /* Above pieces when showing */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    /* Center in the same place as the puzzle grid */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}

.puzzle-completed-image.visible {
    opacity: 1;
}

.puzzle-grid {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.2;
    z-index: 1;
    transition: opacity 0.8s ease-in-out;
    /* Center the grid within the puzzle area */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}

.puzzle-grid.completed {
    opacity: 0; /* Hide the grid when showing completed image */
    visibility: hidden; /* Remove from layout completely */
}

.puzzle-pieces-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: opacity 0.8s ease-in-out, visibility 0s 0.8s;
    opacity: 1;
    /* Ensure the container properly contains all pieces */
    left: 0;
    top: 0;
}

.puzzle-pieces-container.completed {
    opacity: 0; /* Hide the pieces when showing completed image */
    visibility: hidden; /* Remove from layout completely after fade */
}

.puzzle-piece {
    position: absolute;
    background-size: cover; /* Use cover for better piece fit */
    background-repeat: no-repeat;
    border-radius: 2px; /* Subtle rounding */
    cursor: grab;
    /* Updated shadow to only affect content, not transparent areas */
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.25));
    transition: filter 0.3s ease, z-index 0s linear 0.3s, transform 0.3s ease, left 0.2s ease-out, top 0.2s ease-out;
    z-index: 10; /* Default above correct pieces */
    /* Remove box-shadow that was adding inner shadow */
    background-blend-mode: normal;
    background-color: transparent;
}

.puzzle-piece.correct {
    filter: none; /* Remove drop shadow */
    z-index: 5; /* Below default, above grid */
    cursor: default;
    /* Remove the green outline */
    transition: filter 0.3s ease, z-index 0s linear 0s, transform 0.3s ease, left 0.3s ease-out, top 0.3s ease-out;
}

.puzzle-piece.dragging {
    z-index: 999 !important; /* Ensure dragging is always on top */
    cursor: grabbing;
    filter: drop-shadow(2px 3px 8px rgba(0,0,0,0.4)); /* Match Swift dragging shadow */
    transform: scale(1.05); /* Slight scale effect */
    transition: filter 0.1s ease, z-index 0s linear 0s, transform 0.1s ease, left 0s, top 0s; /* Faster transition while dragging */
}

/* --- Picker Styles --- */
.puzzle-picker {
    position: absolute; /* Keep absolute for overlaying */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FCF4E2; /* Match background */
    z-index: 100; /* Below nav overlay */
    /* display: flex; - Remove flex */
    /* flex-direction: column; - Remove flex */
    box-sizing: border-box;
    overflow: hidden; /* Prevent picker scrolling itself */
    /* No padding needed directly on picker */
}

/* Removed .puzzle-picker-header styles */
/* Removed .puzzle-difficulty-selector styles */

.puzzle-picker-grid {
    position: absolute; /* Position absolutely */
    top: calc(84px + env(safe-area-inset-top, 0px)); /* Account for nav overlay + notch */
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* Account for bottom bar + notch (estimate bar height) */
    left: 0px; /* Add side padding */
    right: 0px; /* Add side padding */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Responsive columns */
    gap: 20px; /* Gap between items */
    overflow-y: auto; /* Enable vertical scrolling */
    padding-bottom: 10px; /* Add slight padding at the bottom of scroll area */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    justify-items: center;
    padding-top: 24px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 125px;
    /* Remove flex: 1 and max-height */
    /* Remove background gradient shadows since we're using separate elements */
}

/* Shadow elements for puzzle picker scrolling */
.puzzle-picker-shadow {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px; /* Slightly taller for more visible effect */
    pointer-events: none; /* Allow clicks to pass through to items underneath */
    z-index: 105; /* Above grid content but below bottom bar */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

.puzzle-picker-shadow.top {
    top: calc(84px + env(safe-area-inset-top, 0px)); /* Match grid top position */
    background: linear-gradient(to bottom, rgba(252, 244, 226, 0.98) 20%, rgba(252, 244, 226, 0.9) 40%, rgba(252, 244, 226, 0.7) 60%, rgba(252, 244, 226, 0.4) 80%, rgba(252, 244, 226, 0));
}

.puzzle-picker-shadow.bottom {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* Match grid bottom position */
    background: linear-gradient(to top, rgba(252, 244, 226, 0.98) 20%, rgba(252, 244, 226, 0.9) 40%, rgba(252, 244, 226, 0.7) 60%, rgba(252, 244, 226, 0.4) 80%, rgba(252, 244, 226, 0));
}

.puzzle-picker-shadow.visible {
    opacity: 1;
}

.puzzle-thumbnail {
    position: relative;
    /* aspect-ratio: 1; - Remove aspect ratio */
    height: 125px; /* Set fixed height */
    width: 125px; /* Set fixed width */
    background-color: white; /* Background for image */
    border-radius: 12px; /* Match Swift */
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); /* Subtle shadow */
    overflow: hidden; /* Ensure content stays within bounds */
}

.puzzle-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Cover ensures image fills space */
}


.puzzle-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.puzzle-thumbnail.selected {
    box-shadow: 0 0 0 4px #FFD60A; /* Match Swift selection */
    transform: scale(1.0); /* Prevent scaling when selected */
}

 /* Checkmark for selected thumbnail */
.puzzle-thumbnail .checkmark {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background-color: #FFD60A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.puzzle-thumbnail.selected .checkmark {
    opacity: 1;
}

.puzzle-thumbnail .checkmark svg {
    width: 14px;
    height: 14px;
    color: #4a331a; /* Match Swift checkmark color */
    fill: currentColor;
}


.puzzle-thumbnail .name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: white;
    padding: 15px 8px 8px 8px; /* More padding */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: left; /* Align left */
    font-size: 14px;
    font-weight: 500; /* Medium weight */
    font-family: 'Tondo', -apple-system, sans-serif; /* Match font */
    line-height: 1.2;
    /* Prevent text selection */
     -webkit-user-select: none; /* Safari */
     -ms-user-select: none; /* IE 10+ */
     user-select: none;
}

/* Picker Bottom Bar (Play Button) */
.puzzle-picker-bottom-bar {
     position: absolute;
     bottom: 0;
     left: 0;
     right: 0;
     height: calc(100px + env(safe-area-inset-bottom, 0px)); /* Define fixed height including safe area */
     padding: 12px 20px 0 20px; /* Adjust padding, bottom padding handled by height */
     box-sizing: border-box; /* Include padding in height */
     background: rgba(255, 255, 255, 0.8); /* Material-like background */
     backdrop-filter: blur(10px);
     -webkit-backdrop-filter: blur(10px);
     z-index: 110; /* Above picker grid */
     display: flex; /* Use flex to center button vertically */
     align-items: flex-start; /* Center button vertically */
}

.puzzle-picker-bottom-bar button {
    display: flex; /* Use flex for icon + text */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    width: 100%;
    background-color: #FFD60A; /* Yellow */
    color: #4a331a; /* Specific text color */
    border: none;
    border-radius: 15px; /* Match Swift */
    padding: 14px 24px; /* Adjust padding */
    font-size: 18px; /* Match Swift */
    font-weight: 600; /* Semibold */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* System font stack */
}

 .puzzle-picker-bottom-bar button:active {
     transform: scale(0.98); /* Click effect */
     background-color: #f0c900; /* Slightly darker yellow */
}

 .puzzle-picker-bottom-bar button svg {
     fill: currentColor;
 }


/* Completion Message (Swift Style) */
.completion-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Initial state for animation */
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.7); /* Darker background */
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px; /* Match Swift */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 500; /* Above pieces */
    text-align: center;
    font-size: 32px; /* Larger font */
    font-weight: bold;
    font-family: 'Tondo', -apple-system, sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* Match Swift spring */
    pointer-events: none; /* Don't block interaction */
}

.completion-message.visible {
     opacity: 1;
     transform: translate(-50%, -50%) scale(1.0);
}

 /* Puzzle Name Display */
.puzzle-name-display {
    position: absolute;
    bottom: calc(120px + env(safe-area-inset-bottom)); /* Above bottom bar */
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.8); /* Material */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 99px; /* Capsule shape */
    color: #333;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Tondo', -apple-system, sans-serif;
    z-index: 400; /* Below completion message, above pieces */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.5s ease 0.2s; /* Fade in after completion */
    pointer-events: none;
}

.puzzle-name-display.visible {
    opacity: 1;
}


 /* Bottom Bar (New Puzzle Button) */
.puzzle-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* Use similar height/padding approach as picker bar for consistency */
    height: calc(100px + env(safe-area-inset-bottom, 0px)); /* Define fixed height */
    padding: 12px 20px 0 20px; /* Adjust padding */
    box-sizing: border-box; /* Include padding in height */
    background: rgba(255, 255, 255, 0.8); /* Material-like background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.1);
    z-index: 300; /* Above puzzle grid */
    transform: translateY(100%); /* Start hidden below */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Swift-like animation */
    display: flex; /* Use flex to center button */
    align-items: flex-start; /* Center button vertically */
}

.puzzle-bottom-bar.visible {
     transform: translateY(0);
}

 .puzzle-bottom-bar button {
     /* Reuse styles from picker play button */
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     width: 100%;
     background-color: #FFD60A;
     color: #4a331a;
     border: none;
     border-radius: 15px;
     padding: 14px 24px;
     font-size: 18px;
     font-weight: 600;
     cursor: pointer;
     transition: background-color 0.2s ease, transform 0.1s ease;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
 }

 .puzzle-bottom-bar button:active {
     transform: scale(0.98);
     background-color: #f0c900;
 }

 .puzzle-bottom-bar button svg {
     fill: currentColor;
 }

 /* Ensure container scrolls if content overflows (e.g., picker grid) */
 /* Removed max-height rule here, handled by absolute positioning */

/* --- Mirror Tap Message --- */
.mirror-tap-message {
    position: absolute;
    bottom: calc(15px + var(--safe-area-inset-bottom, 0px)); /* Position above toybox, considering safe area */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    z-index: 100; /* Above camera feed, below toybox potentially */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mirror-tap-message.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}