/**
 * GAME OF HISTORY - STYLE LIVRE IMMERSIF
 * Design parchemin / bibliothèque ancienne
 * Version améliorée - footer en bas
 */

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    min-height: 100vh;
}

body {
    background: #2c1810;
    color: #c4b59a;
    font-family: 'Georgia', 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== WRAPPER PRINCIPAL ===== */
.game-wrapper {
    flex: 1;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ===== LIVRE / PARCHEMIN ===== */
.game-container {
    flex: 1;
    background: #f5eedb;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(200, 180, 150, 0.1) 0%, transparent 70%),
        repeating-linear-gradient(0deg, rgba(180, 160, 130, 0.05) 0px, rgba(180, 160, 130, 0.05) 2px, transparent 2px, transparent 4px);
    border-radius: 12px;
    box-shadow:
        0 10px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 100px rgba(180, 160, 130, 0.2);
    min-height: 600px;
    border: 1px solid #c4b59a;
    padding: 20px 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Décoration livre - bandes dorées */
.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, transparent, #8b7355, #c4b59a, #8b7355, transparent);
}

.game-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, transparent, #8b7355, #c4b59a, #8b7355, transparent);
}

/* Coin décoratif livre */
.game-container .corner-deco {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: #8b7355;
    opacity: 0.3;
}
.game-container .corner-deco.tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.game-container .corner-deco.tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.game-container .corner-deco.bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.game-container .corner-deco.br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

/* ===== EN-TÊTE ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 15px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.3);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.game-header .title-area h1 {
    font-size: 1.6rem;
    color: #3d2b1f;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.game-header .title-area h1 .gold {
    color: #c9a84c;
}

.game-header .title-area .creativity-badge {
    font-size: 0.7rem;
    color: #8b7355;
    background: rgba(139, 115, 85, 0.15);
    padding: 2px 12px;
    border-radius: 20px;
    font-family: 'Segoe UI', sans-serif;
    display: inline-block;
    margin-left: 6px;
    border: 1px solid rgba(139, 115, 85, 0.1);
}

.game-header .header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== BOUTONS PARCHEMIN ===== */
.btn-parchment {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #8b7355;
    background: rgba(139, 115, 85, 0.1);
    color: #3d2b1f;
    font-size: 0.75rem;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.btn-parchment::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.5s ease;
    transform: translate(-50%, -50%);
}

.btn-parchment:hover::after {
    width: 200px;
    height: 200px;
}

.btn-parchment:hover {
    background: #8b7355;
    color: #f5eedb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.btn-parchment.primary {
    background: #8b7355;
    color: #f5eedb;
}

.btn-parchment.primary:hover {
    background: #6d5a42;
    border-color: #6d5a42;
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.4);
}

.btn-parchment.gold {
    background: linear-gradient(135deg, #c9a84c, #b8962e);
    color: #2c1810;
    border-color: #b8962e;
}

.btn-parchment.gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #dbb95a, #c9a84c);
    color: #1a0e08;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
    transform: translateY(-2px);
}

.btn-parchment.gold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-parchment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== CONTENU ===== */
.game-content {
    flex: 1;
    min-height: 300px;
    max-height: calc(100vh - 380px);
    overflow-y: auto;
    padding: 10px 15px;
    margin: 0 -10px;
    scroll-behavior: smooth;
}

.game-content::-webkit-scrollbar {
    width: 5px;
}

.game-content::-webkit-scrollbar-track {
    background: rgba(139, 115, 85, 0.08);
    border-radius: 4px;
}

.game-content::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
    transition: background 0.3s;
}

.game-content::-webkit-scrollbar-thumb:hover {
    background: #6d5a42;
}

/* ===== SIDEBAR DES HISTOIRES ===== */
.story-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 15px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.story-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 14px;
    border-radius: 8px;
    background: rgba(139, 115, 85, 0.08);
    border: 1px solid rgba(139, 115, 85, 0.12);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-size: 0.8rem;
    color: #3d2b1f;
    font-family: 'Segoe UI', sans-serif;
    position: relative;
}

.story-card:hover {
    background: rgba(139, 115, 85, 0.18);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.15);
}

.story-card.active {
    background: #8b7355;
    color: #f5eedb;
    border-color: #8b7355;
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.3);
}

.story-card .card-title {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-card .card-count {
    font-size: 0.6rem;
    opacity: 0.5;
}

.story-card .card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-card:hover .card-actions {
    opacity: 1;
}

.story-card .card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.6rem;
    color: inherit;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.story-card .card-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.story-card.active .card-actions button {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== HISTOIRE ===== */
.story-entry {
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.08);
    animation: fadeIn 0.5s ease;
}

.story-entry:last-child {
    border-bottom: none;
}

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

.story-entry .entry-role {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 2px;
    font-weight: 600;
}

.story-entry .entry-role.narrator {
    color: #8b7355;
}

.story-entry .entry-role.player {
    color: #6d5a42;
}

.story-entry .entry-content {
    font-size: 1rem;
    line-height: 1.9;
    color: #3d2b1f;
    padding-left: 4px;
}

.story-entry .entry-content p {
    margin-bottom: 6px;
}

.story-entry .entry-content p:last-child {
    margin-bottom: 0;
}

.story-entry .entry-content strong {
    color: #5d3f2b;
}

.story-entry .entry-content em {
    color: #8b7355;
}

.story-entry .entry-content code {
    background: rgba(139, 115, 85, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.story-entry .entry-content pre {
    background: rgba(139, 115, 85, 0.08);
    padding: 10px 14px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 6px 0;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    border-left: 3px solid #8b7355;
}

/* ===== WELCOME ===== */
.welcome-story {
    text-align: center;
    padding: 60px 20px;
    color: #8b7355;
}

.welcome-story .icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.welcome-story h2 {
    color: #3d2b1f;
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.welcome-story p {
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 16px;
}

.welcome-story .creativity-info {
    padding: 10px 24px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 8px;
    display: inline-block;
    font-size: 0.9rem;
    border: 1px solid rgba(139, 115, 85, 0.2);
}

/* ===== INPUT ===== */
.game-input-area {
    padding: 15px 10px 10px;
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    margin: 0 -10px;
    flex-shrink: 0;
}

.game-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.game-input-wrapper input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #c4b59a;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.4);
    color: #3d2b1f;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.game-input-wrapper input:focus {
    border-color: #8b7355;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
}

.game-input-wrapper input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-input-wrapper input::placeholder {
    color: #b5a58a;
    font-style: italic;
}

.btn-choice {
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid #8b7355;
    background: linear-gradient(135deg, #8b7355, #7a6348);
    color: #f5eedb;
    font-size: 0.9rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.btn-choice:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a6348, #6d5a42);
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.3);
}

.btn-choice:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.game-status {
    text-align: center;
    font-size: 0.7rem;
    color: #8b7355;
    margin-top: 6px;
    font-family: 'Segoe UI', sans-serif;
}

.typing-indicator {
    display: none;
    padding: 6px 0;
    color: #8b7355;
    font-style: italic;
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ===== NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    border-radius: 10px;
    color: #f5eedb;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
    font-family: 'Segoe UI', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-info {
    background: linear-gradient(135deg, #6d5a42, #5a4a35);
}

.toast-success {
    background: linear-gradient(135deg, #2d6a4f, #1d4a35);
}

.toast-warning {
    background: linear-gradient(135deg, #c9a84c, #b8962e);
    color: #2c1810;
}

.toast-error {
    background: linear-gradient(135deg, #8b3a3a, #6d2a2a);
}

/* ===== POPUPS ===== */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    animation: overlayIn 0.3s ease;
}

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

.popup-overlay.show {
    display: flex;
}

.popup {
    background: #f5eedb;
    padding: 30px 35px 35px;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    border: 1px solid #c4b59a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: popupIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup .close-popup {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #8b7355;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup .close-popup:hover {
    color: #3d2b1f;
    background: rgba(139, 115, 85, 0.1);
    transform: rotate(90deg);
}

.popup h3 {
    color: #3d2b1f;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.popup p {
    color: #8b7355;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.popup label {
    display: block;
    color: #3d2b1f;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.popup .slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.popup .slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #b5a58a, #8b7355);
    outline: none;
}

.popup .slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b7355;
    cursor: pointer;
    border: 2px solid #f5eedb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.popup .slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.popup .slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b7355;
    cursor: pointer;
    border: 2px solid #f5eedb;
}

.popup .creativity-value {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #6d5a42;
    margin: 4px 0 8px;
}

.popup .popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.popup .popup-actions button {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    font-family: 'Segoe UI', sans-serif;
}

.popup .popup-actions .btn-cancel {
    background: rgba(139, 115, 85, 0.1);
    color: #8b7355;
}

.popup .popup-actions .btn-cancel:hover {
    background: rgba(139, 115, 85, 0.2);
    transform: scale(1.02);
}

.popup .popup-actions .btn-create {
    background: linear-gradient(135deg, #8b7355, #7a6348);
    color: #f5eedb;
}

.popup .popup-actions .btn-create:hover {
    background: linear-gradient(135deg, #7a6348, #6d5a42);
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.3);
}

/* ===== LOGIN REQUIRED ===== */
.login-required {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    min-height: 400px;
    flex: 1;
}

.login-required .lock-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.login-required h2 {
    color: #3d2b1f;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-required p {
    color: #8b7355;
    font-size: 1rem;
    max-width: 380px;
    margin-bottom: 20px;
}

.login-required .btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.login-required .btn-login {
    padding: 10px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #8b7355, #7a6348);
    color: #f5eedb;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.login-required .btn-login:hover {
    background: linear-gradient(135deg, #7a6348, #6d5a42);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.3);
}

.login-required .btn-register {
    padding: 10px 28px;
    border-radius: 10px;
    border: 1px solid #8b7355;
    background: transparent;
    color: #3d2b1f;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.login-required .btn-register:hover {
    background: rgba(139, 115, 85, 0.1);
    transform: scale(1.05);
}

/* ===== CONTEXTE ===== */
.context-banner {
    background: rgba(139, 115, 85, 0.08);
    border: 1px solid rgba(139, 115, 85, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    position: relative;
}

.context-banner .context-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b7355;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.context-banner .context-text {
    color: #3d2b1f;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
    padding-left: 4px;
    border-left: 2px solid rgba(139, 115, 85, 0.2);
    padding-left: 10px;
}

/* ===== PDF BANNER ===== */
.pdf-banner {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    background: rgba(139, 115, 85, 0.08);
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    border: 1px solid rgba(139, 115, 85, 0.1);
    flex-shrink: 0;
}

/* ===== BARRE DE FIN D'HISTOIRE ===== */
.story-finished-banner {
    text-align: center;
    padding: 12px 16px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    color: #8b7355;
    border: 1px dashed rgba(139, 115, 85, 0.2);
    flex-shrink: 0;
}

/* ===== FOOTER ===== */
footer {
    margin-top: auto;
    background: #1a0e08;
    color: #8b7355;
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(139, 115, 85, 0.15);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    width: 100%;
    flex-shrink: 0;
}

footer .footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

footer .footer-inner a {
    color: #8b7355;
    text-decoration: none;
    transition: color 0.3s;
}

footer .footer-inner a:hover {
    color: #c4b59a;
}

footer .footer-inner .footer-sep {
    color: #4a3a2a;
}

/* ===== SCROLLBAR POUR TOUT LE SITE ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(44, 24, 16, 0.05);
}

::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6d5a42;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .game-container {
        padding: 15px 18px;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .game-header .title-area h1 {
        font-size: 1.2rem;
    }

    .game-content {
        max-height: calc(100vh - 450px);
        min-height: 250px;
        padding: 8px 10px;
    }

    .story-sidebar .story-card .card-title {
        max-width: 80px;
    }

    .game-input-wrapper {
        flex-direction: column;
    }

    .btn-choice {
        width: 100%;
        justify-content: center;
    }

    .popup {
        padding: 22px 20px 26px;
    }

    .login-required {
        padding: 30px 20px;
        min-height: 300px;
    }

    .login-required h2 {
        font-size: 1.2rem;
    }

    footer .footer-inner {
        flex-direction: column;
        gap: 6px;
    }
    footer .footer-inner .footer-sep {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .game-header .title-area h1 {
        font-size: 1rem;
    }

    .game-header .title-area .creativity-badge {
        font-size: 0.55rem;
        padding: 1px 8px;
    }

    .btn-parchment {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    .story-entry .entry-content {
        font-size: 0.9rem;
        padding-left: 2px;
    }

    .story-sidebar .story-card {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .story-sidebar .story-card .card-title {
        max-width: 60px;
    }

    .story-sidebar .story-card .card-count {
        display: none;
    }

    .welcome-story {
        padding: 30px 15px;
    }

    .welcome-story .icon {
        font-size: 3rem;
    }

    .welcome-story h2 {
        font-size: 1.2rem;
    }

    .login-required .lock-icon {
        font-size: 2.5rem;
    }

    .login-required h2 {
        font-size: 1rem;
    }

    .login-required p {
        font-size: 0.85rem;
    }

    .login-required .btn-login,
    .login-required .btn-register {
        font-size: 0.85rem;
        padding: 8px 20px;
    }

    .popup {
        padding: 18px 16px 22px;
    }

    .popup h3 {
        font-size: 1rem;
    }

    .popup .creativity-value {
        font-size: 1.2rem;
    }

    .popup .popup-actions button {
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .pdf-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .game-input-wrapper .btn-parchment.gold {
        width: 100%;
        justify-content: center;
    }
}