/* Shared styles for the STEAM angle playground and all five mini-games. */
:root {
    --bg-cream: #fef6ea;
    --bg-sun: #ffd166;
    --bg-sky: #85d7ff;
    --bg-ocean: #2a9d8f;
    --card-ink: #17324d;
    --card-soft: rgba(255, 255, 255, 0.82);
    --line-soft: rgba(23, 50, 77, 0.12);
    --danger: #ef476f;
    --success: #1f9d55;
    --warning: #ffb703;
    --shadow-xl: 0 28px 60px rgba(16, 42, 67, 0.16);
    --shadow-lg: 0 18px 36px rgba(16, 42, 67, 0.14);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --font-display: "Malgun Gothic", "Trebuchet MS", sans-serif;
    --font-body: "Segoe UI", "Malgun Gothic", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--card-ink);
    background:
        radial-gradient(circle at top left, rgba(255, 209, 102, 0.9), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(133, 215, 255, 0.9), transparent 22%),
        linear-gradient(180deg, #fffdf7 0%, #fef2dc 48%, #ffe7c2 100%);
}

body.modal-open {
    overflow: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto auto 5% -8%;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: rgba(42, 157, 143, 0.1);
    filter: blur(8px);
    z-index: -1;
}

body::after {
    inset: 14% -10% auto auto;
    background: rgba(255, 183, 3, 0.12);
}

.page-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 18px 18px 42px;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.hero-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-copy,
.hero-panel,
.section-block,
.game-card {
    background: var(--card-soft);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-xl);
}

.hero-copy,
.hero-panel,
.section-block {
    border-radius: var(--radius-xl);
}

.hero-copy {
    padding: 24px;
}

.eyebrow,
.section-kicker,
.panel-kicker,
.card-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(23, 50, 77, 0.65);
}

.hero h1,
.hero-panel h2,
.section-heading h2,
.screen h3 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.05;
}

.hero h1 {
    font-size: clamp(2rem, 3.8vw, 3.3rem);
    letter-spacing: -0.03em;
}

.hero .eyebrow {
    margin-bottom: 0;
}

.hero-art {
    width: 180px;
    flex: 0 0 180px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 28px rgba(16, 42, 67, 0.08);
}

.hero-art svg {
    display: block;
    width: 100%;
    height: auto;
}

.hero-text,
.hero-panel p,
.section-note,
.stage-intro span,
.card-description,
.meta-row {
    line-height: 1.7;
    font-size: 1rem;
}

.hero-text {
    max-width: 520px;
    margin: 12px 0 0;
    font-size: 0.95rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.hero-badges span,
.card-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(23, 50, 77, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    background:
        linear-gradient(180deg, rgba(39, 153, 245, 0.14), rgba(255, 255, 255, 0.86)),
        var(--card-soft);
}

.hero-panel h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    margin-top: 0;
}

.panel-note {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.section-block {
    padding: 20px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.section-note {
    max-width: 260px;
    margin: 0;
    font-size: 0.9rem;
    color: rgba(23, 50, 77, 0.82);
}

.lobby-section {
    padding: 18px;
}

.title-list {
    display: grid;
    gap: 10px;
}

.title-button {
    --title-accent: #ff8c42;
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9)),
        rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 12px 24px rgba(16, 42, 67, 0.08);
    color: var(--card-ink);
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.title-button::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--title-accent);
}

.title-button:hover {
    transform: translateY(-1px);
    border-color: var(--title-accent);
    box-shadow: 0 16px 28px rgba(16, 42, 67, 0.12);
}

.title-button-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.title-button-top {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-button-index {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--title-accent);
    color: white;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 18px rgba(16, 42, 67, 0.12);
}

.title-button-title {
    display: block;
    font-size: 1rem;
    line-height: 1.25;
}

.title-button-credit {
    display: block;
    padding-left: 52px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    color: rgba(23, 50, 77, 0.62);
}

.title-button-visual {
    width: 104px;
    flex: 0 0 104px;
    display: block;
}

.preview-svg {
    display: block;
    width: 100%;
    height: auto;
}

.preview-emoji {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-left: auto;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 10px 18px rgba(16, 42, 67, 0.08);
    font-size: 2rem;
    line-height: 1;
}

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.46);
    backdrop-filter: blur(8px);
}

.modal-home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(23, 50, 77, 0.1);
    color: var(--card-ink);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.18);
    font-size: 0.95rem;
    font-weight: 800;
}

.modal-home-button:hover {
    transform: translateY(-1px);
}

.game-modal-card {
    position: relative;
    width: min(1120px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 18px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 255, 0.94)),
        rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 28px 60px rgba(16, 42, 67, 0.28);
}

.game-modal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(90deg, var(--modal-accent, #ff8c42), rgba(255, 255, 255, 0));
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.modal-subtitle {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: rgba(23, 50, 77, 0.74);
}

.modal-credit {
    display: inline-flex;
    align-items: center;
    margin: 8px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.06);
    border: 1px solid rgba(23, 50, 77, 0.08);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.1;
    color: rgba(23, 50, 77, 0.72);
}

.modal-illustration {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(243, 248, 255, 0.92)),
        rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-svg {
    max-width: 240px;
}

.placeholder-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 360px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(240, 247, 255, 0.95));
    border: 1px solid rgba(23, 50, 77, 0.08);
    text-align: center;
    padding: 20px;
}

.placeholder-icon {
    font-size: 3rem;
}

.placeholder-panel h3 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-display);
}

.placeholder-panel p {
    margin: 0;
    color: rgba(23, 50, 77, 0.7);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.game-card {
    position: relative;
    padding: 18px;
    border-radius: 22px;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    isolation: isolate;
    border-top: 6px solid var(--card-accent);
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.92) 0%, transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.9));
    z-index: -1;
}

.game-card.active {
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--card-accent);
    color: white;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 12px 22px rgba(23, 50, 77, 0.18);
}

.card-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.08);
    font-size: 0.76rem;
    font-weight: 800;
}

.card-status.ready {
    background: rgba(31, 157, 85, 0.14);
    color: #0d6f3e;
}

.card-status.pending {
    background: rgba(255, 183, 3, 0.2);
    color: #8e6200;
}

.game-card h3 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.3;
    font-family: var(--font-display);
}

.card-description {
    margin: 0;
    color: rgba(23, 50, 77, 0.86);
    font-size: 0.92rem;
    line-height: 1.45;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-action {
    margin-top: auto;
}

.meta-row {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(23, 50, 77, 0.62);
}

button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.primary-btn,
.secondary-btn,
.success-btn,
.ghost-btn,
.play-card-btn {
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.success-btn:hover,
.ghost-btn:hover,
.play-card-btn:hover {
    transform: translateY(-2px);
}

.primary-btn {
    color: #17324d;
    background: linear-gradient(180deg, #ffd166, #ffb703);
    box-shadow: 0 12px 0 #d08700;
}

.primary-btn:active,
.secondary-btn:active,
.success-btn:active,
.play-card-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.secondary-btn {
    color: white;
    background: linear-gradient(180deg, #4c6fff, #2b50ff);
    box-shadow: 0 12px 0 #1737be;
}

.success-btn {
    color: white;
    background: linear-gradient(180deg, #34c759, #1f9d55);
    box-shadow: 0 12px 0 #11753b;
}

.ghost-btn {
    background: rgba(23, 50, 77, 0.08);
    color: var(--card-ink);
}

.light-ghost {
    background: rgba(255, 255, 255, 0.24);
    color: white;
}

.play-card-btn {
    width: 100%;
    background: var(--card-accent);
    color: white;
    box-shadow: 0 12px 22px rgba(23, 50, 77, 0.18);
}

.play-card-btn:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: rgba(23, 50, 77, 0.12);
    color: rgba(23, 50, 77, 0.45);
}

.game-stage-section {
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

.stage-heading {
    align-items: center;
}

.stage-intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stage-intro div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line-soft);
}

.stage-intro strong {
    font-size: 0.82rem;
}

.game-panel {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    padding: 18px;
}

.game-wrapper {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 26px 52px rgba(16, 42, 67, 0.26);
    border: 8px solid rgba(255, 255, 255, 0.14);
    background: #87ceeb;
}

.game-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #87ceeb;
}

.ui-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    pointer-events: none;
    z-index: 10;
}

.ui-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.pill-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.status-pill,
.stage-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(5, 20, 40, 0.62);
    color: white;
    box-shadow: 0 12px 24px rgba(5, 20, 40, 0.18);
}

.compact-pill {
    font-weight: 700;
}

.pill-symbol {
    font-size: 1.3rem;
}

.heart-track,
.puzzle-track {
    display: flex;
    gap: 4px;
}

.pill-value {
    font-size: 1.28rem;
    font-weight: 800;
}

.accent-cyan {
    color: #73f4ff;
}

.accent-yellow {
    color: #ffe16b;
}

.stage-badge {
    font-weight: 800;
}

#stage-indicator {
    color: #7dffb3;
}

.puzzle-dot {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.12);
    transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.puzzle-dot.collected {
    background: #ffd166;
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.78);
}

.stage-up-banner {
    position: absolute;
    top: 34%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    color: white;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.7);
    animation: float-bounce 1s infinite;
}

.interactive {
    pointer-events: auto;
}

.quiz-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 360px);
    padding: 18px 18px 16px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 22px 44px rgba(16, 42, 67, 0.24);
    border: 6px solid #2c7df0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
}

.quiz-tag {
    margin-top: -34px;
    padding: 8px 18px;
    border-radius: 999px;
    background: #2c7df0;
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(44, 125, 240, 0.28);
}

.quiz-preview {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 12px;
    border-radius: 18px;
    background: #f1f5f9;
    box-shadow: inset 0 2px 10px rgba(71, 85, 105, 0.12);
}

#quizCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.options-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.btn-option {
    padding: 12px 10px;
    border-radius: 16px;
    border: 3px solid #e2e8f0;
    background: white;
    color: #334155;
    font-size: 1.45rem;
    font-weight: 800;
    box-shadow: 0 8px 14px rgba(148, 163, 184, 0.14);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-option:hover {
    transform: scale(1.04);
    border-color: #2c7df0;
    background: #ebf8ff;
}

.feedback-text {
    min-height: 28px;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    text-align: center;
    z-index: 12;
}

.screen-emoji {
    font-size: clamp(3.4rem, 8vw, 6rem);
    margin-bottom: 8px;
}

.screen h3 {
    font-size: clamp(2rem, 5vw, 4.2rem);
    margin-bottom: 12px;
}

.screen-copy {
    margin: 0;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.5;
}

.screen-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.credit-text {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.dark-credit {
    color: rgba(23, 50, 77, 0.72);
}

.start-screen {
    color: white;
    background: linear-gradient(135deg, #1476f2 0%, #1b4db3 48%, #153177 100%);
}

.end-screen {
    background: linear-gradient(180deg, #ffe16b 0%, #ffbf4d 100%);
    color: #17324d;
}

.gameover-screen {
    background: rgba(214, 48, 49, 0.95);
    color: white;
}

.star-rating {
    display: flex;
    gap: 10px;
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin: 6px 0 8px;
}

.timestamp-display {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 800;
    color: #21456d;
}

.final-puzzle-view {
    width: min(320px, 74vw);
    aspect-ratio: 4 / 3;
    border-radius: 28px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 8px solid white;
    box-shadow: 0 20px 40px rgba(23, 50, 77, 0.18);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.boost-pop {
    transform: scale(1.1);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes float-bounce {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 8px)); }
}

.monster-stage-section {
    margin-top: 10px;
}

.monster-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 28px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 249, 255, 0.96));
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.12);
}

.monster-card-art {
    font-size: 3rem;
}

.monster-card h3 {
    margin: 0;
    font-size: 2rem;
}

.monster-card-copy {
    margin: 0;
    max-width: 560px;
    line-height: 1.65;
}

.monster-game-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
}

.monster-sidebar,
.monster-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.monster-panel {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.1);
}

.hero-panel-card {
    background: linear-gradient(180deg, rgba(255, 248, 229, 0.95), rgba(255, 255, 255, 0.95));
}

.monster-hero-figure,
.monster-foe-figure,
.monster-scene-art {
    display: flex;
    align-items: center;
    justify-content: center;
}

.monster-hero-figure svg,
.monster-foe-figure svg,
.monster-scene-art svg,
.monster-win-allies svg {
    display: block;
    width: 100%;
    height: auto;
}

.monster-hero-figure {
    width: 160px;
    margin: 0 auto 8px;
}

.monster-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.monster-stat-box {
    padding: 10px 8px;
    border-radius: 16px;
    background: rgba(23, 50, 77, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.monster-stat-box span {
    font-size: 0.8rem;
    color: rgba(23, 50, 77, 0.62);
}

.monster-stat-box strong {
    font-size: 1rem;
}

.monster-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.monster-panel-head h4,
.monster-foe-name-row h4 {
    margin: 0;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.monster-small-copy {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(23, 50, 77, 0.68);
    line-height: 1.5;
}

.monster-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.monster-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.08);
    font-size: 0.86rem;
    font-weight: 700;
}

.monster-chip.empty {
    color: rgba(23, 50, 77, 0.54);
}

.monster-chip button {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.1);
    color: var(--card-ink);
    font-size: 0.78rem;
    font-weight: 700;
}

.monster-main {
    min-width: 0;
}

.monster-scene {
    min-height: 220px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(23, 50, 77, 0.08);
    position: relative;
    padding: 14px;
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.12);
}

.monster-scene.scene-day {
    background: linear-gradient(180deg, #9ee5ff 0%, #dff7ff 52%, #ffe8bd 100%);
}

.monster-scene.scene-volcano {
    background: linear-gradient(180deg, #46566f 0%, #7b5d59 50%, #f1cf9e 100%);
}

.monster-scene-art {
    width: 100%;
    height: 100%;
}

.battle-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.monster-foe-figure {
    width: 120px;
    flex: 0 0 120px;
    padding: 8px;
    border-radius: 22px;
    background: rgba(23, 50, 77, 0.04);
}

.monster-foe-meta {
    flex: 1;
    min-width: 0;
}

.monster-foe-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.monster-hp-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.1);
    overflow: hidden;
    margin-bottom: 10px;
}

.monster-hp-fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8c42, #ffb347);
    transition: width 0.2s ease;
}

.monster-angle-wrap {
    padding: 14px;
    border-radius: 24px;
    background: rgba(247, 250, 252, 0.98);
    border: 1px solid rgba(23, 50, 77, 0.06);
    display: flex;
    justify-content: center;
}

#monster-angle-canvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.monster-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.monster-option-btn {
    padding: 12px 8px;
    border-radius: 16px;
    background: white;
    border: 2px solid rgba(23, 50, 77, 0.1);
    font-size: 1rem;
    font-weight: 800;
    color: var(--card-ink);
    box-shadow: 0 8px 16px rgba(16, 42, 67, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.monster-option-btn:hover {
    transform: translateY(-1px);
    border-color: #2a9d8f;
}

.monster-feedback {
    min-height: 28px;
    font-weight: 800;
}

.monster-feedback.good {
    color: #16864c;
}

.monster-feedback.bad {
    color: #d64545;
}

.monster-feedback.info {
    color: #1c5f9d;
}

.monster-win-allies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.ghost-stage-section {
    margin-top: 10px;
}

.ghost-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(17, 25, 43, 0.96), rgba(35, 45, 74, 0.96));
    color: #eef4ff;
    border: 1px solid rgba(158, 185, 255, 0.2);
    box-shadow: 0 22px 40px rgba(12, 18, 31, 0.28);
}

.ghost-card-art {
    font-size: 3rem;
}

.ghost-card h3 {
    margin: 0;
    font-size: 2rem;
}

.ghost-card-copy {
    margin: 0;
    max-width: 560px;
    line-height: 1.7;
    color: rgba(238, 244, 255, 0.88);
}

.ghost-game-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
}

.ghost-sidebar,
.ghost-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ghost-main {
    min-width: 0;
}

.ghost-panel {
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.96));
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.1);
}

.ghost-panel h4 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.ghost-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(69, 123, 157, 0.08);
}

.ghost-stat-row + .ghost-stat-row {
    margin-top: 8px;
}

.ghost-small-copy {
    margin: 12px 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(23, 50, 77, 0.7);
}

.ghost-found-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ghost-found-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(69, 123, 157, 0.12);
    color: var(--card-ink);
    font-size: 0.88rem;
    font-weight: 700;
}

.ghost-found-chip.empty {
    color: rgba(23, 50, 77, 0.56);
}

.ghost-scene {
    --flash-x: 52%;
    --flash-y: 50%;
    position: relative;
    min-height: 320px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(23, 50, 77, 0.08);
    background: linear-gradient(180deg, #1c2237 0%, #252c4a 54%, #372738 100%);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.18);
    isolation: isolate;
}

.ghost-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle 150px at var(--flash-x) var(--flash-y),
            rgba(255, 246, 200, 0.06) 0%,
            rgba(255, 246, 200, 0.14) 20%,
            rgba(18, 24, 40, 0.2) 38%,
            rgba(8, 12, 22, 0.78) 62%,
            rgba(4, 6, 12, 0.96) 100%);
}

.ghost-scene-art,
.ghost-hotspots {
    position: absolute;
    inset: 0;
}

.ghost-scene-art {
    z-index: 0;
}

.ghost-scene-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ghost-hotspots {
    z-index: 3;
}

.ghost-hotspot {
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, 0.76);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    box-shadow: 0 10px 20px rgba(5, 7, 12, 0.24);
    transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.16s ease;
}

.ghost-hotspot::after {
    content: "?";
    font-size: 1.4rem;
    font-weight: 900;
}

.ghost-hotspot:hover {
    transform: scale(1.05);
    border-color: #ffe08a;
}

.ghost-hotspot.is-active {
    transform: scale(1.06);
    border-color: #8fd3ff;
    background: rgba(143, 211, 255, 0.16);
}

.ghost-hotspot.is-cleared {
    opacity: 0.22;
    transform: scale(0.92);
}

.hotspot-locker {
    left: 11%;
    top: 19%;
}

.hotspot-desk {
    right: 11%;
    top: 42%;
}

.hotspot-bag {
    left: 23%;
    bottom: 13%;
}

.ghost-door-button {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 3;
    transform: translateX(-50%);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #19253d;
    border: 1px solid rgba(25, 37, 61, 0.12);
    box-shadow: 0 14px 24px rgba(8, 12, 22, 0.24);
    font-weight: 800;
}

.ghost-quiz-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ghost-angle-wrap {
    padding: 14px;
    border-radius: 24px;
    background: rgba(245, 248, 255, 0.98);
    border: 1px solid rgba(23, 50, 77, 0.06);
    display: flex;
    justify-content: center;
}

#ghost-angle-canvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.ghost-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ghost-choice-btn {
    padding: 12px 8px;
    border-radius: 16px;
    background: white;
    border: 2px solid rgba(23, 50, 77, 0.1);
    color: var(--card-ink);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(16, 42, 67, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.ghost-choice-btn:hover {
    transform: translateY(-1px);
    border-color: #457b9d;
}

.ghost-feedback {
    min-height: 28px;
    font-weight: 800;
}

.ghost-feedback.good {
    color: #16864c;
}

.ghost-feedback.bad {
    color: #d64545;
}

.ghost-feedback.info {
    color: #1c5f9d;
}

.cannon-stage-section {
    margin-top: 10px;
}

.cannon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 247, 242, 0.98), rgba(255, 239, 230, 0.98));
    color: var(--card-ink);
    border: 1px solid rgba(231, 111, 81, 0.14);
    box-shadow: 0 22px 40px rgba(110, 64, 46, 0.14);
}

.cannon-card-art {
    font-size: 3rem;
}

.cannon-card h3 {
    margin: 0;
    font-size: 2rem;
}

.cannon-card-copy,
.cannon-summary-text {
    margin: 0;
    max-width: 560px;
    line-height: 1.7;
}

.cannon-summary-text {
    font-weight: 800;
    color: #b04b31;
}

.cannon-game-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
}

.cannon-sidebar,
.cannon-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cannon-main {
    min-width: 0;
}

.cannon-panel {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.1);
}

.cannon-panel h4 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.cannon-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(231, 111, 81, 0.08);
}

.cannon-stat-row + .cannon-stat-row {
    margin-top: 8px;
}

.cannon-small-copy {
    margin: 12px 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(23, 50, 77, 0.7);
}

.cannon-token-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cannon-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.cannon-token.alive {
    background: rgba(255, 191, 105, 0.22);
    color: #7f421f;
}

.cannon-token.lost {
    background: rgba(23, 50, 77, 0.08);
    color: rgba(23, 50, 77, 0.52);
}

.cannon-fleet-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.cannon-ship-chip {
    min-height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(23, 50, 77, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
    color: rgba(23, 50, 77, 0.64);
}

.cannon-ship-chip.hit {
    background: rgba(31, 157, 85, 0.16);
    color: #167544;
}

.cannon-ship-chip.miss {
    background: rgba(239, 71, 111, 0.14);
    color: #c53d60;
}

.cannon-scene {
    position: relative;
    min-height: 320px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(23, 50, 77, 0.08);
    background: linear-gradient(180deg, #dff5ff 0%, #9bdcff 55%, #ffe7c8 100%);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.14);
}

.cannon-scene-art,
.cannon-options {
    position: absolute;
    inset: 0;
}

.cannon-scene-art {
    z-index: 0;
}

.cannon-scene-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

.cannon-options {
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    padding-top: 18px;
    pointer-events: none;
}

.cannon-option-btn {
    width: 90px;
    height: 90px;
    border-radius: 999px;
    border: 4px solid rgba(255, 255, 255, 0.92);
    background: #25354c;
    color: white;
    font-size: 1.08rem;
    font-weight: 900;
    box-shadow: 0 16px 24px rgba(23, 50, 77, 0.18);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    pointer-events: auto;
}

.cannon-option-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 18px 28px rgba(23, 50, 77, 0.22);
}

.cannon-angle-wrap {
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 250, 245, 0.98);
    border: 1px solid rgba(23, 50, 77, 0.06);
    display: flex;
    justify-content: center;
}

#cannon-angle-canvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.cannon-feedback {
    min-height: 28px;
    font-weight: 800;
}

.cannon-feedback.good {
    color: #16864c;
}

.cannon-feedback.bad {
    color: #d64545;
}

.cannon-feedback.info {
    color: #b04b31;
}

.school-stage-section {
    margin-top: 10px;
}

.school-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(243, 250, 239, 0.98), rgba(232, 242, 226, 0.98));
    color: var(--card-ink);
    border: 1px solid rgba(108, 154, 53, 0.16);
    box-shadow: 0 22px 40px rgba(47, 84, 33, 0.12);
}

.school-card-art {
    font-size: 3rem;
}

.school-card h3 {
    margin: 0;
    font-size: 2rem;
}

.school-card-copy,
.school-summary-text {
    margin: 0;
    max-width: 580px;
    line-height: 1.7;
}

.school-summary-text {
    font-weight: 800;
    color: #4d7f1f;
}

.school-game-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
}

.school-sidebar,
.school-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.school-main {
    min-width: 0;
}

.school-panel {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.1);
}

.school-panel h4 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.school-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(108, 154, 53, 0.08);
}

.school-stat-row + .school-stat-row {
    margin-top: 8px;
}

.school-hp-track {
    display: flex;
    gap: 4px;
}

.school-item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.school-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.08);
    color: var(--card-ink);
    font-size: 0.84rem;
    font-weight: 800;
}

.school-item-chip button {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(108, 154, 53, 0.14);
    color: #486d1c;
    font-size: 0.75rem;
    font-weight: 800;
}

.school-item-chip.empty {
    color: rgba(23, 50, 77, 0.54);
}

.school-scene {
    position: relative;
    min-height: 340px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(23, 50, 77, 0.08);
    background: linear-gradient(180deg, #e5f3dd 0%, #f7fbf2 50%, #ede1c5 100%);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.14);
}

.school-scene-art,
.school-room-grid {
    position: absolute;
    inset: 0;
}

.school-scene-art {
    z-index: 0;
}

.school-scene-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

.school-room-grid {
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 26px 20px 20px;
    align-content: start;
}

.school-room-btn {
    min-height: 72px;
    padding: 10px 8px;
    border-radius: 18px;
    border: 2px solid rgba(23, 50, 77, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: var(--card-ink);
    text-align: center;
    box-shadow: 0 10px 18px rgba(16, 42, 67, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.school-room-btn:hover {
    transform: translateY(-1px);
    border-color: #6c9a35;
}

.school-room-btn strong,
.school-room-btn small {
    display: block;
}

.school-room-btn strong {
    font-size: 0.96rem;
}

.school-room-btn small {
    margin-top: 4px;
    font-size: 0.72rem;
    color: rgba(23, 50, 77, 0.62);
    line-height: 1.35;
}

.school-room-btn.is-cleared {
    background: rgba(108, 154, 53, 0.12);
    border-color: rgba(108, 154, 53, 0.28);
}

.school-room-btn.needs-cure {
    background: rgba(255, 209, 102, 0.22);
    border-color: rgba(255, 183, 3, 0.42);
}

.school-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.school-question-head h4 {
    margin: 0;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.school-angle-wrap {
    padding: 14px;
    border-radius: 24px;
    background: rgba(249, 252, 247, 0.98);
    border: 1px solid rgba(23, 50, 77, 0.06);
    display: flex;
    justify-content: center;
}

#school-angle-canvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.school-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.school-option-btn {
    padding: 12px 8px;
    border-radius: 16px;
    background: white;
    border: 2px solid rgba(23, 50, 77, 0.1);
    color: var(--card-ink);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(16, 42, 67, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.school-option-btn:hover {
    transform: translateY(-1px);
    border-color: #6c9a35;
}

.school-feedback {
    min-height: 28px;
    margin-top: 12px;
    font-weight: 800;
}

.school-feedback.good {
    color: #16864c;
}

.school-feedback.bad {
    color: #d64545;
}

.school-feedback.info {
    color: #486d1c;
}

@media (max-width: 980px) {
    .hero {
        margin-bottom: 12px;
    }

    .hero-heading {
        align-items: flex-start;
    }
}

@media (max-width: 780px) {
    .page-shell {
        padding: 14px 12px 32px;
    }

    .hero-copy,
    .hero-panel,
    .section-block {
        padding: 18px;
    }

    .game-modal {
        padding: 10px;
    }

    .modal-home-button {
        top: 12px;
        left: 12px;
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .game-modal-card {
        padding: 14px;
        border-radius: 22px;
    }

    .modal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .monster-game-shell {
        grid-template-columns: 1fr;
    }

    .ghost-game-shell {
        grid-template-columns: 1fr;
    }

    .cannon-game-shell {
        grid-template-columns: 1fr;
    }

    .school-game-shell {
        grid-template-columns: 1fr;
    }

    .monster-foe-row {
        flex-direction: column;
        align-items: stretch;
    }

    .monster-foe-figure {
        width: 100%;
        flex-basis: auto;
    }

    .ghost-scene {
        min-height: 280px;
    }

    .ghost-options {
        grid-template-columns: 1fr;
    }

    .ghost-hotspot {
        width: 64px;
        height: 64px;
    }

    .cannon-option-btn {
        width: 76px;
        height: 76px;
        font-size: 0.96rem;
    }

    .cannon-fleet-track {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .school-scene {
        min-height: 320px;
    }

    .school-room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 18px 14px 14px;
    }

    .school-question-head {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-art {
        width: 100%;
        flex-basis: auto;
    }

    .title-button {
        padding: 10px 12px;
        gap: 10px;
    }

    .title-button-index {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 12px;
        font-size: 0.8rem;
    }

    .title-button-title {
        font-size: 0.92rem;
    }

    .title-button-visual {
        width: 82px;
        flex-basis: 82px;
    }

    .section-heading,
    .ui-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pill-column {
        align-items: flex-start;
    }

    .game-panel {
        padding: 10px;
    }

    .game-wrapper {
        border-width: 6px;
        border-radius: 22px;
    }

    .ui-layer {
        padding: 12px;
    }

    .status-pill,
    .stage-badge {
        padding: 9px 12px;
        border-radius: 16px;
    }

    .pill-symbol {
        font-size: 1.1rem;
    }

    .puzzle-dot {
        width: 15px;
        height: 15px;
    }

    .feedback-text {
        font-size: 1rem;
    }
}

/* Modal-first layout refinements for all game stages */
.game-modal-card {
    height: min(920px, calc(100vh - 24px));
    overflow: hidden;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.modal-head {
    justify-content: flex-end;
    gap: 0;
    margin: 0;
    min-height: 0;
}

.modal-head > div,
.modal-illustration {
    display: none;
}

#close-modal-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(23, 50, 77, 0.1);
    box-shadow: 0 10px 20px rgba(16, 42, 67, 0.1);
    font-size: 0;
}

#close-modal-button::before {
    content: "×";
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.game-stage-section,
.monster-stage-section,
.ghost-stage-section,
.cannon-stage-section,
.school-stage-section,
.game6-stage-section {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    overflow: auto;
    scrollbar-width: none;
}

.game-stage-section::-webkit-scrollbar,
.monster-stage-section::-webkit-scrollbar,
.ghost-stage-section::-webkit-scrollbar,
.cannon-stage-section::-webkit-scrollbar,
.school-stage-section::-webkit-scrollbar,
.game6-stage-section::-webkit-scrollbar,
.monster-sidebar::-webkit-scrollbar,
.monster-main::-webkit-scrollbar,
.ghost-sidebar::-webkit-scrollbar,
.ghost-main::-webkit-scrollbar,
.cannon-sidebar::-webkit-scrollbar,
.cannon-main::-webkit-scrollbar,
.school-sidebar::-webkit-scrollbar,
.school-main::-webkit-scrollbar,
.game6-sidebar::-webkit-scrollbar,
.game6-main::-webkit-scrollbar {
    display: none;
}

.stage-intro {
    display: none;
}

.game-panel {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.monster-stage-section,
.ghost-stage-section,
.cannon-stage-section,
.school-stage-section,
.game6-stage-section {
    display: flex;
    flex-direction: column;
}

.monster-card,
.ghost-card,
.cannon-card,
.school-card,
.game6-card {
    min-height: 100%;
    justify-content: center;
    padding: 24px 22px;
}

.monster-game-shell,
.ghost-game-shell,
.cannon-game-shell,
.school-game-shell,
.game6-game-shell {
    min-height: 100%;
}

.monster-sidebar,
.monster-main,
.ghost-sidebar,
.ghost-main,
.cannon-sidebar,
.cannon-main,
.school-sidebar,
.school-main,
.game6-sidebar,
.game6-main {
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
}

@media (max-width: 780px) {
    .game-modal-card {
        height: calc(100vh - 12px);
        padding: 10px;
    }

    #close-modal-button {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Game 2 focus tuning */
.monster-scene {
    display: none;
}

.monster-game-shell {
    grid-template-columns: 248px minmax(0, 1fr);
}

.monster-panel.battle-panel {
    padding: 20px 22px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 255, 0.96)),
        rgba(255, 255, 255, 0.96);
}

.monster-foe-row {
    align-items: stretch;
    gap: 20px;
}

.monster-foe-figure {
    width: 200px;
    flex: 0 0 200px;
    padding: 14px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(42, 157, 143, 0.12), rgba(255, 255, 255, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.monster-emoji-figure {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.monster-emoji-figure span {
    display: block;
    line-height: 1;
}

.monster-hero-figure .monster-emoji-figure span {
    font-size: 4.6rem;
}

.monster-foe-figure .monster-emoji-figure span {
    font-size: 7.2rem;
    filter: drop-shadow(0 12px 18px rgba(23, 50, 77, 0.18));
}

.monster-foe-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 780px) {
    .monster-foe-figure {
        width: 100%;
        flex-basis: auto;
        max-width: 220px;
        margin: 0 auto;
    }

    .monster-foe-figure .monster-emoji-figure span {
        font-size: 6rem;
    }
}

/* Game 3 classroom focus */
.ghost-game-shell {
    grid-template-columns: 212px minmax(0, 1fr);
}

.ghost-sidebar {
    gap: 10px;
}

.ghost-main {
    position: relative;
}

.ghost-panel {
    padding: 14px;
}

.ghost-scene {
    min-height: clamp(420px, 68vh, 620px);
}

.ghost-hotspot {
    width: 84px;
    height: 84px;
}

.ghost-trap {
    border-style: solid;
    border-color: rgba(255, 124, 124, 0.86);
    background: rgba(255, 84, 84, 0.12);
}

.ghost-trap::after {
    content: "!";
}

.ghost-hotspot.is-triggered {
    opacity: 0.28;
    transform: scale(0.92);
}

.hotspot-window {
    right: 8%;
    top: 18%;
}

.hotspot-shadow {
    right: 21%;
    bottom: 18%;
}

.ghost-quiz-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;
    width: min(92%, 430px);
    transform: translate(-50%, -50%);
    gap: 14px;
    box-shadow: 0 24px 44px rgba(8, 12, 22, 0.34);
    backdrop-filter: blur(10px);
}

.ghost-modal-art {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    padding: 14px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 26, 45, 0.96), rgba(39, 51, 84, 0.96));
    color: #eef4ff;
}

.ghost-jumpscare {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ghost-jumpscare-emoji {
    font-size: 4.8rem;
    line-height: 1;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.28));
}

.ghost-jumpscare strong {
    font-size: 1.3rem;
}

.ghost-jumpscare p {
    margin: 0;
    line-height: 1.6;
    color: rgba(238, 244, 255, 0.9);
}

.ghost-info-card .ghost-jumpscare-emoji {
    font-size: 4rem;
}

@media (max-width: 780px) {
    .ghost-game-shell {
        grid-template-columns: 1fr;
    }

    .ghost-sidebar {
        order: 2;
    }

    .ghost-main {
        order: 1;
    }

    .ghost-scene {
        min-height: 400px;
    }

    .ghost-hotspot {
        width: 68px;
        height: 68px;
    }

    .ghost-quiz-panel {
        width: min(94%, 360px);
    }
}

/* Game 4 layout polish */
.cannon-game-shell {
    grid-template-columns: 224px minmax(0, 1fr);
}

.cannon-sidebar {
    gap: 10px;
}

.cannon-main {
    position: relative;
    gap: 0;
}

.cannon-scene {
    min-height: clamp(360px, 58vh, 500px);
    border-radius: 30px;
}

.cannon-options {
    align-items: flex-start;
    padding-top: 22px;
}

.cannon-option-btn {
    width: 96px;
    height: 96px;
    font-size: 1.12rem;
}

.cannon-main > .cannon-panel {
    width: min(100%, 460px);
    margin: -54px auto 0;
    position: relative;
    z-index: 4;
    padding: 16px 18px 14px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(255, 240, 232, 0.96)),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 36px rgba(77, 45, 32, 0.16);
}

.cannon-angle-wrap {
    padding: 10px 12px;
    border-radius: 20px;
}

#cannon-angle-canvas {
    width: min(100%, 280px);
}

.cannon-feedback {
    min-height: 24px;
    margin-top: 10px;
    text-align: center;
    line-height: 1.45;
}

@media (max-width: 780px) {
    .cannon-game-shell {
        grid-template-columns: 1fr;
    }

    .cannon-sidebar {
        order: 2;
    }

    .cannon-main {
        order: 1;
    }

    .cannon-scene {
        min-height: 330px;
    }

    .cannon-option-btn {
        width: 78px;
        height: 78px;
        font-size: 0.96rem;
    }

    .cannon-main > .cannon-panel {
        width: calc(100% - 18px);
        margin-top: -34px;
    }
}

/* Game 5 boss stage */
.school-scene.is-boss-stage {
    background:
        radial-gradient(circle at top, rgba(255, 114, 114, 0.26), transparent 30%),
        linear-gradient(180deg, #2b1e33 0%, #46293e 46%, #201824 100%);
}

.school-boss-stage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff4f1;
    text-align: center;
}

.school-boss-badge {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.school-boss-monster {
    font-size: clamp(5rem, 10vw, 7.5rem);
    line-height: 1;
    filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.28));
}

.school-boss-name {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
}

.school-boss-hearts {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

.school-boss-copy {
    margin: 0;
    max-width: 320px;
    line-height: 1.6;
    color: rgba(255, 244, 241, 0.88);
}

.game6-stage-section {
    margin-top: 10px;
}

.game6-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(240, 244, 255, 0.99), rgba(228, 238, 255, 0.98));
    color: var(--card-ink);
    border: 1px solid rgba(91, 108, 255, 0.16);
    box-shadow: 0 22px 40px rgba(57, 73, 171, 0.14);
}

.game6-card-art {
    font-size: 3rem;
}

.game6-card h3 {
    margin: 0;
    font-size: 2rem;
}

.game6-card-copy,
.game6-summary-text {
    margin: 0;
    max-width: 620px;
    line-height: 1.7;
}

.game6-summary-text {
    font-weight: 800;
    color: #3550d3;
}

.game6-game-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 16px;
}

.game6-sidebar,
.game6-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.game6-main {
    min-width: 0;
}

.game6-panel {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.1);
}

.game6-panel h4 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-family: var(--font-display);
}

.game6-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(91, 108, 255, 0.08);
}

.game6-stat-row + .game6-stat-row {
    margin-top: 8px;
}

.game6-small-copy {
    margin: 12px 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(23, 50, 77, 0.7);
}

.game6-token-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game6-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.game6-token.active {
    background: rgba(91, 108, 255, 0.16);
    color: #3048c4;
}

.game6-token.lost {
    background: rgba(23, 50, 77, 0.08);
    color: rgba(23, 50, 77, 0.5);
}

.game6-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.game6-progress-chip {
    min-height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(23, 50, 77, 0.08);
    color: rgba(23, 50, 77, 0.68);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.25;
}

.game6-progress-chip.is-current {
    background: rgba(255, 209, 102, 0.28);
    color: #8b5a00;
}

.game6-progress-chip.is-cleared {
    background: rgba(31, 157, 85, 0.16);
    color: #167544;
}

.game6-scene-card {
    padding: 12px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.96));
    border: 1px solid rgba(23, 50, 77, 0.08);
    box-shadow: 0 18px 34px rgba(16, 42, 67, 0.14);
}

#game6-scene-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 22px;
}

.game6-bottom-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 14px;
}

.game6-controls {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.game6-controls.is-double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.game6-joint-card {
    padding: 12px;
    border-radius: 18px;
    background: rgba(91, 108, 255, 0.07);
    border: 1px solid rgba(91, 108, 255, 0.12);
}

.game6-joint-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
}

.game6-control-label {
    margin-top: 10px;
    font-size: 0.76rem;
    font-weight: 800;
    color: rgba(23, 50, 77, 0.68);
}

.game6-joint-copy {
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(23, 50, 77, 0.66);
}

.game6-controls.is-double .game6-joint-card {
    padding: 10px;
}

.game6-controls.is-double .game6-control-label {
    margin-top: 8px;
    font-size: 0.72rem;
}

.game6-controls.is-double .game6-joint-copy {
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.35;
}

.game6-joint-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) 84px;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.game6-adjust-btn {
    padding: 10px 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 2px solid rgba(91, 108, 255, 0.14);
    color: var(--card-ink);
    font-size: 0.92rem;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(91, 108, 255, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.game6-controls.is-double .game6-joint-row {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: 6px;
}

.game6-controls.is-double .game6-adjust-btn {
    padding: 8px 6px;
    font-size: 0.78rem;
}

.game6-adjust-btn:hover {
    transform: translateY(-1px);
    border-color: #5b6cff;
    box-shadow: 0 12px 20px rgba(91, 108, 255, 0.14);
}

.game6-adjust-btn:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: rgba(23, 50, 77, 0.36);
    background: rgba(255, 255, 255, 0.7);
}

.game6-angle-pill {
    min-height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(227, 236, 255, 0.96));
    color: #3048c4;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.game6-controls.is-double .game6-angle-pill {
    min-height: 38px;
    font-size: 0.9rem;
}

.game6-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.game6-angle-wrap {
    padding: 10px 12px;
    border-radius: 20px;
    background: rgba(244, 247, 255, 0.98);
    border: 1px solid rgba(23, 50, 77, 0.06);
    display: flex;
    justify-content: center;
}

#game6-angle-canvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.game6-feedback {
    min-height: 52px;
    margin-top: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.game6-feedback.good {
    color: #16864c;
}

.game6-feedback.bad {
    color: #d64545;
}

.game6-feedback.info {
    color: #3550d3;
}

@media (max-width: 780px) {
    .game6-game-shell {
        grid-template-columns: 1fr;
    }

    .game6-sidebar {
        order: 2;
    }

    .game6-main {
        order: 1;
    }

    .game6-bottom-row {
        grid-template-columns: 1fr;
    }

    .game6-controls.is-double {
        grid-template-columns: 1fr;
    }

    .game6-joint-row {
        grid-template-columns: 72px minmax(0, 1fr) 72px;
}
}

/* ==========================================================================
   Student Planning PDF Feature Styles
   ========================================================================== */

/* Lobby Badge Styling */
.pdf-lobby-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 140, 66, 0.12);
    color: #ff7824;
    font-size: 0.68rem;
    font-weight: 800;
    border: 1px solid rgba(255, 140, 66, 0.2);
    vertical-align: middle;
}

/* Modal Credit & PDF button row */
.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.modal-meta-row .modal-credit {
    margin-top: 0;
}

/* Modal PDF Button */
.modal-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8c42, #ffb703);
    border: none;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.1;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 140, 66, 0.25);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.modal-pdf-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 140, 66, 0.4);
}

.modal-pdf-btn:active {
    transform: translateY(1px);
}

/* PDF Overlay Modal */
.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.6);
    backdrop-filter: blur(12px);
}

.pdf-modal-card {
    position: relative;
    width: min(1000px, 95vw);
    height: min(800px, 85vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 32px 72px rgba(16, 42, 67, 0.35);
    animation: pdfModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pdfModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.5);
}

.pdf-modal-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-modal-icon {
    font-size: 1.8rem;
}

.pdf-modal-title-area h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--card-ink);
}

.pdf-modal-subtitle {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: rgba(23, 50, 77, 0.6);
}

.pdf-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pdf-btn:hover {
    transform: translateY(-1px);
}

.pdf-btn-open {
    background: linear-gradient(180deg, #ffd166, #ffb703);
    color: #17324d;
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.25);
}

.pdf-btn-open:hover {
    box-shadow: 0 6px 16px rgba(255, 183, 3, 0.4);
}

.pdf-btn-close {
    background: rgba(23, 50, 77, 0.08);
    color: var(--card-ink);
    border: none;
    cursor: pointer;
}

.pdf-btn-close:hover {
    background: rgba(23, 50, 77, 0.14);
}

.pdf-modal-body {
    flex: 1;
    padding: 16px;
    background: rgba(23, 50, 77, 0.03);
    min-height: 0;
}

/* Floating PDF Tab on the Right Margin */
.floating-pdf-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg) translateY(-25px); /* Rotated vertical tab sticking out */
    transform-origin: right center;
    z-index: 150; /* Above backdrop but below the PDF modal itself */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.95), rgba(255, 183, 3, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: -4px 0 20px rgba(255, 140, 66, 0.28);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease;
}

.floating-pdf-tab:hover {
    transform: translateY(-50%) rotate(-90deg) translateY(-32px); /* slide out slightly */
    background: linear-gradient(135deg, #ff8c42, #ffb703);
    box-shadow: -6px 0 24px rgba(255, 140, 66, 0.45);
}

.floating-pdf-tab:active {
    transform: translateY(-50%) rotate(-90deg) translateY(-28px);
}

@media (max-width: 780px) {
    .floating-pdf-tab {
        top: auto;
        bottom: 0;
        right: 20px;
        transform: none !important;
        border-radius: 12px 12px 0 0;
        padding: 8px 16px;
        font-size: 0.78rem;
        box-shadow: 0 -4px 14px rgba(255, 140, 66, 0.25);
    }
    
    .floating-pdf-tab:hover {
        transform: translateY(-2px) !important;
    }
}
