/* FT Revival Theme Styles */
@import url('/assets/fonts/fonts.css');

:root {
    --ft-primary: #ff9100;
    /* Fire Dragon Slayer Magic Orange */
    --ft-secondary: #800080;
    /* Dark Magic Purple */
    --ft-accent: #ffd700;
    /* Gold */
    --ft-bg-dark: #1a0524;
    /* Deep dark purple/black */
    --ft-text-light: #f8e7d0;
    --ft-panel-bg: rgba(26, 5, 36, 0.85);
    --ft-border-color: rgba(255, 215, 0, 0.3);
}

html,
body {
    height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Lato', 'Segoe UI', sans-serif;
    color: var(--ft-text-light);
    background-color: #08010a;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center top;
    overflow-y: auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 3, 27, 0.92), rgba(91, 23, 23, 0.88));
    backdrop-filter: blur(2px);
    z-index: -1;
}

object:focus {
    outline: none;
}

#flashContent {
    display: none;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 3, 18, 0.65);
}

/* Header & Brand */
.site-header {
    padding: 2.5rem 5vw 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(80, 0, 0, 0.9) 0%, rgba(40, 6, 41, 0.0) 100%);
    border-bottom: 2px solid var(--ft-accent);
    box-shadow: 0 0 20px rgba(255, 145, 0, 0.2);
}

.brand h1 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ft-accent);
    text-shadow: 0 0 10px rgba(255, 69, 0, 0.8), 2px 2px 0px #8b0000;
    text-align: center;
}

.brand-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: center;
}

/* Navigation */
.main-nav {
    position: relative;
    display: flex;
    gap: 2rem;
    padding: 1rem 5vw 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 0.6rem;
}

/* Tab links centered; the auth control is pinned to the right (see .nav-auth). */
.nav-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.main-nav a {
    color: var(--ft-text-light);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.main-nav a::before {
    content: "✦";
    margin-right: 5px;
    color: var(--ft-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ft-accent), transparent);
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--ft-accent);
    text-shadow: 0 0 8px var(--ft-primary);
}

.main-nav a:hover::before {
    opacity: 1;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Active tab */
.main-nav a.is-active {
    color: var(--ft-accent);
    text-shadow: 0 0 8px var(--ft-primary);
}

.main-nav a.is-active::before {
    opacity: 1;
}

.main-nav a.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Main Content */
main {
    flex: 1;
    padding: 1.5rem 5vw 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.game-panel {
    background: var(--ft-panel-bg);
    border: 2px solid var(--ft-border-color);
    border-radius: 4px;
    /* Slightly sharper corners for a scroll/parchment feel */
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: calc(1250px + 3.5rem);
    margin: 0 auto;
    position: relative;
}

/* Decorative corners */
.game-panel::before,
.game-panel::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--ft-accent);
    transition: all 0.3s ease;
}

.game-panel::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.game-panel::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    padding-bottom: 1rem;
}

.panel-title {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ft-accent);
    font-size: 1.5rem;
    text-shadow: 0 0 5px rgba(255, 145, 0, 0.5);
}

.launch-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--ft-accent);
    background: linear-gradient(135deg, #4b0082, #2e0854);
    color: var(--ft-accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    min-width: 48px;
    min-height: 48px;
}

.action-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
}

.action-button:hover {
    background: linear-gradient(135deg, #6a0dad, #4b0082);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.action-button:active {
    transform: translateY(0);
}

/* Tooltip */
.action-button::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--ft-accent);
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--ft-accent);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: 'Lato', sans-serif;
}

.action-button:hover::after {
    opacity: 1;
    transform: translate(-50%, -5px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.game-player {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 145, 0, 0.2);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    /* Removed padding to let game fill space */
    width: 100%;
    margin: 0 auto;
}

#flashContent,
#flashContent p {
    margin: 0;
    color: var(--ft-text-light);
    text-align: center;
}

#flashContent {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 1250px;
    min-height: 650px;
    /* Ensure height for loading screen */
}

#flashContent p {
    margin: 0;
    color: var(--ft-text-light);
    text-align: center;
    padding: 1rem;
}

#flashContent strong {
    font-weight: 700;
    color: var(--ft-primary);
    border-bottom: 1px dashed var(--ft-accent);
}

#flashContent a:hover {
    color: #fff;
    border-bottom-style: solid;
}

/* Info Panel */
.info-panel {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: calc(1250px + 3.5rem);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin: 0 auto;
}

.info-card {
    background: var(--ft-panel-bg);
    border-radius: 4px;
    padding: 1.5rem;
    border: 1px solid var(--ft-border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: var(--ft-accent);
}

.info-card h3 {
    margin: 0 0 1rem;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.25rem;
    color: var(--ft-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.info-card p {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.info-card a {
    color: var(--ft-accent);
    text-decoration: none;
    font-weight: bold;
}

.info-card a:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px var(--ft-primary);
}

/* Footer */
.site-footer {
    padding: 2rem 5vw;
    border-top: 2px solid var(--ft-border-color);
    background: linear-gradient(0deg, #0f0214 0%, rgba(17, 3, 27, 0.8) 100%);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-links {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-label {
    font-weight: 600;
    color: var(--ft-accent);
    margin-right: 0.3rem;
}

.footer-links a {
    color: var(--ft-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 720px) {
    .site-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .brand h1 {
        font-size: 2.5rem;
    }

    .main-nav {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

#GameWrok,
.game-player ruffle-player,
.game-player ruffle-player>object {
    width: 100%;
    max-width: 1250px;
    aspect-ratio: 1250 / 650;
    height: auto;
    min-height: 650px;
}

/* Shop Panel */
.shop-panel {
    background: var(--ft-panel-bg);
    border: 2px solid var(--ft-border-color);
    border-radius: 4px;
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: calc(1250px + 3.5rem);
    margin: 0 auto;
    position: relative;
}

.shop-panel::before,
.shop-panel::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--ft-accent);
    transition: all 0.3s ease;
}

.shop-panel::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.shop-panel::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.shop-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.shop-card {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.4), rgba(46, 8, 84, 0.6));
    border: 1px solid var(--ft-border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.shop-card:hover {
    transform: translateY(-5px);
    border-color: var(--ft-accent);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.shop-card-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
}

.shop-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.shop-card-info {
    padding: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.shop-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--ft-accent);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px rgba(255, 145, 0, 0.5);
}

.shop-card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.shop-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ft-primary);
    margin-top: auto;
    padding-top: 0.5rem;
}

.shop-loading,
.shop-error,
.shop-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    color: var(--ft-text-light);
}

.shop-error {
    color: #ff6b6b;
}

/* ===== Top-up (Пополнение) panel ===== */
.topup-intro {
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-size: 1rem;
    max-width: 70ch;
}

.topup-intro strong {
    color: var(--ft-accent);
}

.topup-card {
    text-align: center;
}

.topup-badge {
    display: inline-block;
    margin: 0.5rem auto 0;
    padding: 0.15rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a0524;
    background: linear-gradient(135deg, var(--ft-accent), var(--ft-primary));
    border-radius: 999px;
}

.topup-cta {
    margin-top: 0.7rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--ft-primary);
    opacity: 0.85;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.topup-card:hover .topup-cta,
.topup-card:focus .topup-cta {
    color: var(--ft-accent);
    opacity: 1;
}

.topup-card:focus-visible {
    outline: 2px solid var(--ft-accent);
    outline-offset: 2px;
}

.topup-note {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--ft-border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    line-height: 1.6;
}

.topup-note a {
    color: var(--ft-accent);
    font-weight: 700;
    text-decoration: none;
}

.topup-note a:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px var(--ft-primary);
}

/* Payment methods block (provider-neutral; PayAnyWay branding added at go-live) */
.topup-pay {
    margin-top: 1.5rem;
    text-align: center;
}

.topup-pay-accept {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.topup-pay-accept a {
    color: var(--ft-accent);
    text-decoration: none;
}

.topup-pay-accept a:hover {
    text-decoration: underline;
}

.topup-rk {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topup-rk:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.topup-rk img {
    display: block;
    height: 24px;
    width: auto;
}

.topup-pay-methods {
    margin: 0.8rem auto 0;
    max-width: 60ch;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
}
.topup-pay-methods a { color: rgba(255, 255, 255, 0.8); }
.topup-pay-security {
    margin: 0.5rem auto 0;
    max-width: 60ch;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.55;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #1a0524, #2e0854);
    border: 2px solid var(--ft-accent);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--ft-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--ft-text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--ft-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 0.8rem;
    color: var(--ft-text-light);
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body strong {
    color: var(--ft-accent);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #ff9100, #ff6600);
    border: 1px solid var(--ft-accent);
    color: #1a0524;
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #ffaa33, #ff9100);
    box-shadow: 0 0 15px rgba(255, 145, 0, 0.5);
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid var(--ft-border-color);
    color: var(--ft-text-light);
}

.modal-btn-secondary:hover {
    border-color: var(--ft-accent);
    color: var(--ft-accent);
}

@media (max-width: 720px) {
    .shop-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .shop-card-title {
        font-size: 1rem;
    }

    .shop-card-price {
        font-size: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
        text-align: center;
    }
}

/* Cart Button */
.cart-button {
    position: relative;
    background: transparent;
    border: 1px solid var(--ft-border-color);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--ft-text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-button:hover {
    border-color: var(--ft-accent);
    color: var(--ft-accent);
}

.cart-button svg {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--ft-primary);
    color: #1a0524;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Panel Header with Cart */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

/* Item Modal */
.item-modal-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.item-modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Cart Modal */
.modal-content-wide {
    max-width: 600px;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 4px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-family: 'Cinzel', serif;
    color: var(--ft-accent);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--ft-primary);
    font-weight: 700;
}

.cart-item-remove {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: #ff4444;
    color: white;
}

.cart-total {
    padding: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    text-align: right;
    font-size: 1.2rem;
    color: var(--ft-text-light);
}

.cart-total span {
    color: var(--ft-primary);
    font-weight: 700;
}

.cart-empty {
    text-align: center;
    padding: 3rem;
    color: var(--ft-text-light);
    font-size: 1.1rem;
}

/* Danger Button */
.modal-btn-danger {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
}

.modal-btn-danger:hover {
    background: #ff4444;
    color: white;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #1a0524, #2e0854);
    border: 1px solid var(--ft-accent);
    color: var(--ft-text-light);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 720px) {
    .cart-items {
        max-height: 300px;
    }

    .cart-item {
        padding: 0.75rem;
    }

    .cart-item-image {
        width: 40px;
        height: 40px;
    }
}

/* Document Modal Styles */
.modal-content-document {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.modal-body-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-body-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: var(--ft-border-color);
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--ft-accent);
}

.modal-body-scroll h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--ft-primary);
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 0.5rem;
}

.modal-body-scroll h4:first-child {
    margin-top: 0.5rem;
}

.modal-body-scroll ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
}

.modal-body-scroll li {
    color: var(--ft-text-light);
    line-height: 1.6;
    margin-bottom: 0.3rem;
}

.modal-body-scroll em {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Footer Links Styling */
.footer-links a {
    margin: 0 0.5rem;
}

.footer-links a:not(:last-child)::after {
    content: "|";
    margin-left: 1rem;
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 720px) {
    .modal-content-document {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-body-scroll {
        max-height: 50vh;
    }

    .modal-body-scroll h4 {
        font-size: 1rem;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-links a:not(:last-child)::after {
        display: none;
    }
}

/* ===== Header auth control ===== */
/* Pinned to the right so the nav-links stay truly centered in the bar. */
.nav-auth {
    position: absolute;
    right: 5vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.auth-login-btn,
.auth-user-btn {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-login-btn {
    padding: 0.5rem 1.4rem;
    color: #1a0524;
    background: linear-gradient(135deg, #ff9100, #ff6600);
    border: 1px solid var(--ft-accent);
    border-radius: 4px;
}

.auth-login-btn:hover {
    background: linear-gradient(135deg, #ffaa33, #ff9100);
    box-shadow: 0 0 15px rgba(255, 145, 0, 0.5);
}

.auth-user {
    position: relative;
}

.auth-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    color: var(--ft-text-light);
    background: var(--ft-panel-bg);
    border: 1px solid var(--ft-border-color);
    border-radius: 4px;
}

.auth-user-btn:hover {
    border-color: var(--ft-accent);
    color: var(--ft-accent);
}

.auth-user-avatar {
    color: var(--ft-primary);
}

.auth-user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-caret {
    font-size: 0.75rem;
    opacity: 0.8;
}

.auth-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: linear-gradient(135deg, #1a0524, #2e0854);
    border: 1px solid var(--ft-accent);
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1100;
}

.auth-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.8rem 1.2rem;
    color: var(--ft-text-light);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-menu-item:hover {
    background: rgba(255, 145, 0, 0.15);
    color: var(--ft-accent);
}

.auth-menu-item + .auth-menu-item {
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

/* ===== Auth modal forms ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-field span {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--ft-accent);
    text-transform: uppercase;
}

.auth-field input {
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--ft-border-color);
    border-radius: 4px;
    color: var(--ft-text-light);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--ft-accent);
    box-shadow: 0 0 10px rgba(255, 145, 0, 0.35);
}

.auth-submit {
    width: 100%;
    margin-top: 0.4rem;
}

.auth-foot {
    margin-top: 1.1rem;
    text-align: center;
    color: var(--ft-text-light);
    font-size: 0.95rem;
}

.auth-foot a {
    color: var(--ft-primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-foot a:hover {
    color: var(--ft-accent);
    text-decoration: underline;
}

.auth-msg {
    padding: 0.7rem 0.9rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.auth-msg-err {
    background: rgba(180, 30, 30, 0.25);
    border: 1px solid rgba(255, 80, 80, 0.5);
    color: #ffb3b3;
}

.auth-msg-ok {
    background: rgba(30, 140, 60, 0.22);
    border: 1px solid rgba(80, 220, 120, 0.5);
    color: #b6f5c8;
}

@media (max-width: 900px) {
    /* Below this width the 4 tabs + auth button would overlap, so drop the auth
       control out of absolute positioning onto its own centered row. */
    .nav-auth {
        position: static;
        transform: none;
        right: auto;
        top: auto;
        width: 100%;
        justify-content: center;
    }

    .auth-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== Server selection list ===== */
.server-list {
    width: 100%;
    align-self: stretch;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.server-list-intro {
    text-align: center;
    color: var(--ft-text-light);
    font-size: 1rem;
    opacity: 0.85;
    margin: 0;
}

.server-list-loading {
    text-align: center;
    color: var(--ft-text-light);
    padding: 3rem;
    font-size: 1.1rem;
}

.server-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.server-card {
    position: relative;
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.4), rgba(46, 8, 84, 0.6));
    border: 1px solid var(--ft-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
}

.server-card-window {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--ft-border-color);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--ft-accent);
    cursor: pointer;
    transition: all 0.2s ease;
}

.server-card-window svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.server-card-window:hover,
.server-card-window:focus-visible {
    border-color: var(--ft-accent);
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    outline: none;
}

.server-card:hover,
.server-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--ft-accent);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    outline: none;
}

.server-card--offline {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.4);
}

.server-card--offline:hover {
    transform: none;
    border-color: var(--ft-border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.server-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--ft-accent);
    text-shadow: 0 0 5px rgba(255, 145, 0, 0.5);
}

.server-card-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

/* Живой счётчик игроков рядом со статусом; пустой (API ещё не ответил) — не занимает места. */
.server-card-online {
    color: var(--ft-accent);
    font-variant-numeric: tabular-nums;
}

.server-card-online:empty {
    display: none;
}

/* Суммарный онлайн проекта — приписка к строке над плашками.
   nowrap: на узких экранах приписка переносится целиком, а не рвётся по словам. */
.server-list-total {
    margin-left: 0.5rem;
    color: var(--ft-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.server-list-total:empty {
    display: none;
}

.server-card-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #888;
    box-shadow: 0 0 6px currentColor;
}

.server-card-status.is-online .server-card-dot {
    background: #3ad13a;
    color: #3ad13a;
}

.server-card-status.is-offline .server-card-dot {
    background: #c9a13a;
    color: #c9a13a;
}

.server-card-cta {
    margin-top: 0.25rem;
    font-weight: 700;
    color: var(--ft-primary);
    letter-spacing: 0.05em;
}


/* ft-fps-mobile-minheight — FPS на мобильных: снять min-height:650px.
   Ruffle рендерит canvas в физ. пикселях = CSS-size × devicePixelRatio.
   min-height:650px на узком экране раздувает backing store в разы.
   Пусть высота следует aspect-ratio 1250/650. Фуллскрин (mobile-fs.js) не затрагивается. */
@media (max-width: 720px) {
  #flashContent,
  #GameWrok,
  .game-player ruffle-player,
  .game-player ruffle-player > object {
    min-height: 0 !important;
  }
}
