:root {
    --ink-color: #2B4162;
    --paper-color: #F5D76E;
    --panel-bg: #EBF4F6;
    --accent-color: #E2725B;
    --shadow-color: rgba(43, 65, 98, 0.4);
    --shadow-offset: 4px;
    --border-width: 0px;
    --font-main: 'Nunito', sans-serif;
    --font-title: 'Fredoka One', cursive;
    --grid-line-color: rgba(255, 255, 255, 0.2);
    --placeholder-bg: #dbe4e6;
    --stitch-color: rgba(43, 65, 98, 0.5);
    --btn-stitch: rgba(249, 246, 240, 0.6);
}

body.dark-mode {
    --ink-color: #F9F6F0;
    --paper-color: #2B4162;
    --panel-bg: #3B5982;
    --accent-color: #E2725B;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --grid-line-color: rgba(255, 255, 255, 0.05);
    --placeholder-bg: #4a6a96;
    --stitch-color: rgba(249, 246, 240, 0.5);
    --btn-stitch: rgba(43, 65, 98, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--paper-color);
    color: var(--ink-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    /* Noise texture for felt background */
    background-image: 
        radial-gradient(var(--grid-line-color) 15%, transparent 20%),
        radial-gradient(var(--grid-line-color) 15%, transparent 20%);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
}

.comic-page {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 50px;
    width: 100%;
}

/* Comic Panel Common Styles -> Felt Patch Styles */
.comic-panel {
    background: var(--panel-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0px 4px 10px var(--shadow-color), inset 0px 2px 4px rgba(255,255,255,0.3);
    padding: 24px;
    position: relative;
    transition: transform 0.2s ease;
}

/* Stitched inner border */
.comic-panel::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 2px dashed var(--stitch-color);
    border-radius: 8px;
    pointer-events: none;
}

.comic-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 14px var(--shadow-color), inset 0px 2px 4px rgba(255,255,255,0.3);
}

.panel-label {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--accent-color);
    color: var(--paper-color);
    padding: 4px 14px;
    border-radius: 8px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    transform: rotate(-3deg);
    box-shadow: 2px 2px 5px var(--shadow-color);
}

/* Stitched inner border for panel-label */
.panel-label::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px dashed var(--btn-stitch);
    border-radius: 5px;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-title);
    text-transform: uppercase;
    margin-top: 0;
    color: var(--ink-color);
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.comic-title {
    font-size: 3.5rem;
    text-shadow: 2px 2px 4px var(--shadow-color);
    margin-bottom: 0.5rem;
    color: var(--ink-color);
}

.comic-subtitle {
    font-size: 1.5rem;
    color: var(--ink-color);
    opacity: 0.8;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Hero Section */
.hero-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px;
    position: relative;
}

.hero-image-placeholder {
    width: 100%;
    height: 200px;
    background: var(--placeholder-bg);
    border: 3px dashed var(--stitch-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    color: var(--ink-color);
    font-weight: bold;
}

.speech-bubble {
    position: relative;
    background: var(--panel-bg);
    border: none;
    border-radius: 20px;
    box-shadow: 0px 4px 10px var(--shadow-color);
    padding: 20px;
    max-width: 300px;
    margin: 20px auto;
    text-align: center;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 2px dashed var(--stitch-color);
    border-radius: 14px;
    pointer-events: none;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-top-color: var(--panel-bg);
    border-bottom: 0;
    border-left: 0;
    margin-left: -10px;
    filter: drop-shadow(0px 4px 2px var(--shadow-color));
}

/* Nav */
.nav-panel {
    padding: 26px 28px 30px;
}

.nav-panel h2 {
    display: inline-flex;
    align-items: center;
    margin: 0 0 18px;
    padding: 6px 16px;
    background: var(--accent-color);
    color: var(--paper-color);
    border-radius: 8px;
    font-size: 1.2rem;
    line-height: 1;
    position: relative;
    box-shadow: 2px 2px 5px var(--shadow-color);
    text-shadow: none;
}

.nav-panel h2::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1.5px dashed var(--btn-stitch);
    border-radius: 5px;
    pointer-events: none;
}

.nav-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.nav-panel li {
    min-width: 0;
}

.nav-panel a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    color: var(--ink-color);
    background: rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    line-height: 1.15;
    box-shadow: 0px 3px 6px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.25);
    position: relative;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-panel a::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1.5px dashed var(--stitch-color);
    border-radius: 5px;
    pointer-events: none;
    transition: border-color 0.2s ease;
}

.nav-panel a:hover,
.nav-panel a:focus-visible {
    background: var(--accent-color);
    color: var(--paper-color);
    transform: translateY(-2px);
    box-shadow: 0px 5px 8px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.25);
    outline: none;
}

.nav-panel a:hover::before,
.nav-panel a:focus-visible::before {
    border-color: var(--btn-stitch);
}

/* Character Sheet */
.character-sheet {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .character-sheet {
        grid-template-columns: 150px 1fr;
    }
}

.avatar-placeholder {
    width: 150px;
    height: 150px;
    background: var(--placeholder-bg);
    border: none;
    border-radius: 50%;
    box-shadow: 0px 4px 8px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-placeholder::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 2px dashed var(--stitch-color);
    border-radius: 50%;
    pointer-events: none;
}

.avatar-placeholder img {
    border-radius: 50%;
}

.stats-box ul {
    list-style: none;
    padding: 0;
}

.stats-box li {
    margin-bottom: 5px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 2px;
}

/* Projects */
.projects-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 20px;
    padding-top: 8px;
}

.project-image {
    height: 150px;
    background: var(--placeholder-bg);
    border: none;
    border-radius: 8px;
    box-shadow: inset 0px 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 2px dashed var(--stitch-color);
    border-radius: 4px;
    pointer-events: none;
}

.tech-stack {
    font-size: 0.9rem;
    color: var(--ink-color);
    opacity: 0.8;
    font-weight: bold;
    margin-top: 10px;
}

/* Skills */
.skill-item {
    margin-bottom: 10px;
    font-weight: bold;
}

.skill-bar {
    display: block;
    height: 14px;
    background: var(--accent-color);
    margin-top: 5px;
    position: relative;
    border-radius: 7px;
    box-shadow: inset 0px 2px 4px rgba(0,0,0,0.3);
}

.skill-bar::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border: 1px dashed rgba(255,255,255,0.6);
    border-radius: 5px;
    pointer-events: none;
}

/* Form */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.sketchy-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.5);
    box-shadow: inset 0px 2px 5px var(--shadow-color);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    position: relative;
}

.sketchy-input:focus {
    box-shadow: inset 0px 2px 5px var(--shadow-color), 0 0 0 2px var(--accent-color);
}

.sketchy-btn {
    background: var(--ink-color);
    color: var(--paper-color);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: var(--font-title);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0px 4px 6px var(--shadow-color);
    transition: all 0.2s;
    position: relative;
}

.sketchy-btn::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 2px dashed var(--btn-stitch);
    border-radius: 4px;
    pointer-events: none;
}

.sketchy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 10px var(--shadow-color);
    background: var(--accent-color);
}

.sketchy-btn:active {
    transform: translateY(2px);
    box-shadow: 0px 2px 4px var(--shadow-color);
}

/* --- Dynamic Missions Styles --- */
.category-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 5px 2px 12px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-color) transparent;
}

/* Dark mode scrollbar styling */
body.dark-mode .category-tabs {
    scrollbar-color: rgba(232, 232, 232, 0.5) rgba(255, 255, 255, 0.1);
}

body.dark-mode .category-tabs::-webkit-scrollbar {
    height: 8px;
}

body.dark-mode .category-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

body.dark-mode .category-tabs::-webkit-scrollbar-thumb {
    background: rgba(232, 232, 232, 0.5);
    border-radius: 4px;
}

body.dark-mode .category-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 232, 232, 0.7);
}

.tab-btn {
    background: var(--panel-bg);
    color: var(--ink-color);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-title);
    flex: 0 0 auto;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0px 3px 6px var(--shadow-color);
    scroll-snap-align: none;
    position: relative;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px dashed var(--stitch-color);
    border-radius: 5px;
    pointer-events: none;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 5px 8px var(--shadow-color);
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0px 4px 6px var(--shadow-color);
}

.tab-btn.active::before {
    border-color: var(--btn-stitch);
}

.missions-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 30px;
    width: 100%;
    overflow-x: auto;
    padding: 25px 2px 18px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
    max-width: 100%;
    min-width: 0;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-color) transparent;
}

/* Dark mode scrollbar styling */
body.dark-mode .missions-grid {
    scrollbar-color: rgba(232, 232, 232, 0.5) rgba(255, 255, 255, 0.1);
}

body.dark-mode .missions-grid::-webkit-scrollbar {
    height: 8px;
}

body.dark-mode .missions-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

body.dark-mode .missions-grid::-webkit-scrollbar-thumb {
    background: rgba(232, 232, 232, 0.5);
    border-radius: 4px;
}

body.dark-mode .missions-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 232, 232, 0.7);
}
.missions-scrollbar {
    width: 100%;
    height: 42px;
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(120px, 1fr) 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    touch-action: none;
}

.missions-scrollbar-track {
    position: relative;
    width: 100%;
    height: 34px;
}

.missions-scrollbar-track::before {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    top: 50%;
    height: 16px;
    background: var(--accent-color);
    border-radius: 8px;
    transform: translateY(-50%);
    box-shadow: 0px 3px 6px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.25);
}

.missions-scrollbar-track::after {
    content: '';
    position: absolute;
    left: 7px;
    right: 7px;
    top: 50%;
    height: 8px;
    border-top: 1.5px dashed var(--btn-stitch);
    border-bottom: 1.5px dashed var(--btn-stitch);
    transform: translateY(-50%);
    pointer-events: none;
}

.missions-scrollbar-track.is-scrollable {
    cursor: pointer;
}

.missions-scroll-arrow {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--accent-color);
    box-shadow: 0px 3px 6px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    position: relative;
}

.missions-scroll-arrow::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1.5px dashed var(--btn-stitch);
    border-radius: 5px;
    pointer-events: none;
}

.missions-scroll-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    transform: translateY(-50%);
    z-index: 1;
}

.missions-scroll-arrow-left::before {
    left: 10px;
    border-right: 8px solid var(--paper-color);
}

.missions-scroll-arrow-right::before {
    right: 10px;
    border-left: 8px solid var(--paper-color);
}

.missions-scroll-arrow:hover {
    transform: translateY(-1px);
    box-shadow: 0px 4px 8px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.25);
}

.missions-scroll-arrow:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

.missions-scroll-thumb {
    top: 1px;
    left: 0;
    width: 122px;
    min-width: 122px;
    height: 32px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    cursor: grab;
    user-select: none;
    overflow: hidden;
    transform: none;
    will-change: left;
    transition: left 0.16s ease-out, transform 0.2s ease;
    z-index: 2;
}

.missions-scroll-thumb:active,
.missions-scroll-thumb.is-dragging {
    cursor: grabbing;
    transform: scale(1.03);
}
.category-tabs,
.missions-grid {
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar,
.missions-grid::-webkit-scrollbar {
    display: none;
}
.project-panel {
    /* Override absolute widths for grid context if necessary, 
       but keeping .comic-panel styles is usually fine for cards */
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(260px, 82vw, 360px);
    scroll-snap-align: none;
}

.project-panel p,
.project-panel .tech-stack {
    transition: opacity 0.3s ease;
}

/* Desktop: hide description by default, show on hover */
@media (min-width: 900px) {

    .project-panel {
        flex: 0 0 min(360px, calc((100% - 60px) / 3));
    }

    .project-panel p,
    .project-panel .tech-stack {
        opacity: 0;
        pointer-events: none;
    }

    .project-panel:hover p,
    .project-panel:hover .tech-stack {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Grid Layout overrides for Vertical Categories */
.missions-grid.layout-grid {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
}

body.dark-mode .missions-grid.layout-grid::-webkit-scrollbar,
.missions-grid.layout-grid::-webkit-scrollbar {
    display: none; /* Usually vertical scrolling goes to the document instead */
}

.missions-grid.layout-grid .project-panel {
    scroll-snap-align: none;
    flex: 0 0 clamp(260px, 82vw, 360px); 
    margin: 0 auto; /* Center on mobile */
}

@media (min-width: 900px) {
    .missions-grid.layout-grid .project-panel {
        /* Take up exactly one third minus gap spacing */
        flex: 0 0 calc((100% - 60px) / 3);
        margin: 0;
    }
}

.project-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    background: var(--placeholder-bg);
    margin: 10px 0;
    overflow: hidden;
    border: 2px solid #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.project-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.loading-text,
.empty-state {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    padding: 40px;
    flex: 0 0 100%;
}

@media (max-width: 768px) {
    body {
        /* Shift entire site left by reducing left padding significantly */
        padding-left: 5px;
        padding-right: 15px;
    }
}

/* --- Social & Contact Footer --- */
.social-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed var(--ink-color);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    color: var(--ink-color);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--panel-bg);
    box-shadow: 0px 4px 8px var(--shadow-color);
    position: relative;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px dashed var(--stitch-color);
    border-radius: 50%;
    pointer-events: none;
}

.social-icon:hover {
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0px 6px 12px var(--shadow-color);
    background: var(--accent-color);
    color: #fff;
}

.social-icon:hover::before {
    border-color: var(--btn-stitch);
}

/* Specific brand colors on hover if preferred, but overriding generic hover above */
.social-icon.instagram:hover {
    background: #E1306C;
}

.social-icon.linkedin:hover {
    background: #0077b5;
}

.social-icon.youtube:hover {
    background: #ff0000;
}

.social-icon.rareusername:hover {
    background: #02b8d7;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.social-link {
    color: var(--ink-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px dashed transparent;
    border-radius: 5px;
    pointer-events: none;
    transition: border-color 0.2s;
}

.social-link:hover {
    background: var(--panel-bg);
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0px 4px 8px var(--shadow-color);
}

.social-link:hover::before {
    border-color: var(--stitch-color);
}

/* Mission Link Icon */
.mission-link-icon {
    font-size: 0.7em;
    /* Slightly smaller than the title */
    margin-left: 8px;
    color: var(--ink-color);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    vertical-align: middle;
}

.mission-link-icon:hover {
    color: var(--accent-color);
    transform: scale(1.2) rotate(-10deg);
}

/* --- Game Modal Styles --- */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 450px;
    /* Phone-ish width */
    height: 85vh;
    /* Tall portrait */
    background: var(--panel-bg);
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
    border: none;
    transition: max-width 0.3s ease, height 0.3s ease;
}

.modal-container::after {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 2px dashed var(--stitch-color);
    border-radius: 18px;
    pointer-events: none;
}

.modal-container.landscape {
    max-width: 90vw;
    /* Wide screen */
    height: 90vh;
    border-radius: 18px;
    /* Slightly less rounded for monitor look */
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-family: var(--font-title);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 6px var(--shadow-color);
}

.modal-close-btn::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px dashed var(--btn-stitch);
    border-radius: 50%;
    pointer-events: none;
}

.modal-close-btn:hover {
    transform: scale(1.1);
    background: #ff6b81;
    box-shadow: 0px 6px 10px var(--shadow-color);
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.modal-container.landscape .iframe-wrapper {
    border-radius: 10px;
}

#game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
    display: block;
}

/* Play Button on Mission Card */
.play-btn-icon {
    font-size: 0.9em;
    margin-left: 8px;
    color: var(--ink-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.play-btn-icon:hover {
    color: var(--accent-color);
    transform: scale(1.2) rotate(10deg);
}

/* --- Toggle Switch Styles --- */
.cursor-toggle-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toggle-group > div {
    font-family: var(--font-title) !important;
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
    color: var(--ink-color) !important;
    text-shadow: 0 1px 1px var(--shadow-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--panel-bg);
    box-shadow: 0px 3px 6px var(--shadow-color), inset 0px 1px 3px rgba(255, 255, 255, 0.35);
    transition: background 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.slider::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1.5px dashed var(--stitch-color);
    border-radius: 999px;
    pointer-events: none;
    transition: border-color 0.25s ease;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 5px;
    bottom: 5px;
    background: var(--paper-color);
    box-shadow: 0px 2px 4px var(--shadow-color), inset 0px 1px 2px rgba(255, 255, 255, 0.4);
    transition: transform 0.25s ease, background 0.25s ease;
    z-index: 1;
}

input:checked+.slider {
    background: var(--accent-color);
}

input:checked+.slider::after {
    border-color: var(--btn-stitch);
}

input:checked+.slider:before {
    -webkit-transform: translateX(30px);
    -ms-transform: translateX(30px);
    transform: translateX(30px);
}

.slider.round {
    border-radius: 999px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Skeleton Loading --- */
@keyframes skeletonLoading {
    0% { background-color: #e0e0e0; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #e0e0e0; }
}

body.dark-mode @keyframes skeletonLoading {
    0% { background-color: #2d2d2d; }
    50% { background-color: #3d3d3d; }
    100% { background-color: #2d2d2d; }
}

.skeleton-loading {
    animation: skeletonLoading 1.5s infinite;
    background-size: 200% 100%;
}
.skeleton-loading img {
    opacity: 0; /* Hide image until loaded */
}