/* --- Common Components --- */

/* Privacy Badge */
.privacy-badge {
    font-family: var(--font-tech);
    font-weight: normal;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2px 10px;
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.8) 0%, rgba(10, 12, 18, 0.9) 100%);
}

/* FUT Card (Base) */
.fut-card {
    position: relative;
    z-index: 1;
    --card-border-color: var(--card-border);
    --cut-size: 25px;
    border-radius: 12px;
    -webkit-mask-image: linear-gradient(135deg, black calc(100% - var(--cut-size)), transparent calc(100% - var(--cut-size)));
    mask-image: linear-gradient(135deg, black calc(100% - var(--cut-size)), transparent calc(100% - var(--cut-size)));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, --card-border-color 0.3s ease, filter 0.3s ease;
    background: rgba(15, 19, 25, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.fut-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, transparent calc(100% - var(--cut-size) - 2px), var(--card-border-color) calc(100% - var(--cut-size) - 2px), var(--card-border-color) calc(100% - var(--cut-size) + 2px), transparent calc(100% - var(--cut-size) + 2px));
}

.fut-card:hover {
    transform: translateY(-5px);
}

/* Buttons */
.btn-start {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
    background: var(--action-primary-bg) !important;
    /* Flat green, no bright gradient */
    color: #ffffff;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.2rem;
    /* Reduced size */
    text-transform: uppercase;
    font-style: italic;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    /* Removed heavy glowing shadows, keeping only subtle depth */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.btn-start:hover {
    background: var(--action-primary-hover) !important;
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-start:active {
    transform: translateY(1px) translateZ(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-start>span,
.btn-start .btn-icon,
.btn-secondary>span,
.btn-secondary .btn-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* No scaling on hover */

.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 50px;
    color: #fff !important;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    font-style: italic;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-2px) translateZ(0);
}

.btn-secondary:active {
    transform: translateY(1px) scale(0.98) translateZ(0);
}

/* Back Arrow Button */
.btn-back-arrow {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

@media (max-width: 900px) {
    .btn-back-arrow {
        width: 42px;
        height: 42px;
    }
}

/* --- Virtual Coin Icon --- */
.coin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.85em;
    height: 0.85em;
    border-radius: 50%;
    background-color: #E79645;
    vertical-align: -0.06em;
    margin-left: 0.35em !important;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.coin-icon::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background-color: #F8B855;
    z-index: 1;
}
.coin-icon::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    background-image: url('/static/images/coin-ball.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 768px) {
    .btn-back-arrow {
        width: 38px;
        height: 38px;
        top: 1rem;
        left: 1rem;
    }
}

.btn-back-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(35, 139, 78, 0.3);
}

.btn-back-arrow:active {
    transform: translateX(-1px) scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.btn-back-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Global Rules / Broadcast Match Centre --- */
.rules-modal-overlay {
    padding: 16px;
    background: rgba(1, 7, 4, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 180ms var(--ease-ui-out), visibility 0s linear 180ms;
}

.rules-modal-overlay:not(.hidden) {
    transition-delay: 0s;
}

.rules-broadcast {
    width: min(960px, 100%);
    height: min(700px, calc(100dvh - 32px));
    min-height: 480px;
    display: grid;
    grid-template-rows: 64px minmax(0, 1fr) 68px;
    overflow: hidden;
    color: var(--broadcast-text);
    background: var(--broadcast-bg);
    border: 1px solid var(--broadcast-line);
    border-radius: var(--broadcast-radius);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 180ms var(--ease-ui-out), transform 220ms var(--ease-ui-out);
}

.rules-modal-overlay.hidden .rules-broadcast {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
}

.rules-broadcast-header {
    min-width: 0;
    padding: 0 14px 0 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--broadcast-line);
    background: #08130f;
}

.rules-title-lockup {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.rules-live-mark {
    width: 9px;
    height: 9px;
    flex: none;
    border-radius: 50%;
    background: var(--broadcast-accent);
    box-shadow: 0 0 0 4px rgba(43, 217, 120, 0.12);
}

.rules-title-lockup h2 {
    min-width: 0;
    margin: 0;
    padding-inline: 0.28em 0.08em;
    overflow: visible;
    color: var(--broadcast-text);
    font-family: var(--font-head);
    font-size: 1.45rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    text-overflow: clip;
    text-wrap: balance;
    white-space: nowrap;
}

.rules-header-meta {
    min-width: 54px;
    color: var(--broadcast-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.btn-close-rules {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--broadcast-muted);
    background: transparent;
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, transform 120ms var(--ease-ui-out);
}

.btn-close-rules svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.btn-close-rules:focus-visible,
.rules-mode-tab:focus-visible,
.rules-nav-button:focus-visible {
    outline: 2px solid var(--broadcast-accent);
    outline-offset: -2px;
}

.btn-close-rules:active,
.rules-mode-tab:active,
.rules-nav-button:active {
    transform: scale(0.97);
}

.rules-broadcast-body {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
}

.rules-mode-nav {
    min-width: 0;
    min-height: 0;
    padding: 9px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3px;
    overflow-y: auto;
    border-right: 1px solid var(--broadcast-line);
    background: #07110d;
}

.rules-mode-tab {
    width: 100%;
    min-height: 52px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 7px;
    color: #a9b7af;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, transform 120ms var(--ease-ui-out);
}

.rules-tab-code {
    width: 36px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    color: #819087;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    transition: color 160ms ease, background-color 160ms ease;
}

.rules-tab-coin .coin-icon {
    width: 15px;
    height: 15px;
    margin: 0 !important;
}

.rules-mode-tab.active {
    color: var(--broadcast-text);
    background: var(--broadcast-surface-strong);
}

.rules-mode-tab.active .rules-tab-code {
    color: #06110b;
    background: var(--broadcast-accent);
}

.rules-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
    background: var(--broadcast-surface);
}

.rules-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(6, 16, 12, 0.98), rgba(6, 16, 12, 0.8) 56%, rgba(6, 16, 12, 0.9)),
        url('../../images/bg_stadium_cyan.webp') center 68% / cover no-repeat;
}

.rules-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(12px);
    transition:
        opacity 160ms var(--ease-ui-out),
        transform 190ms var(--ease-ui-out),
        visibility 0s linear 190ms;
}

.rules-slide.active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
}

.rules-slide.exit-left,
.rules-slide.from-left {
    transform: translateX(-12px);
}

.rules-slide.exit-right,
.rules-slide.from-right {
    transform: translateX(12px);
}

.rules-slide-inner {
    width: 100%;
    height: 100%;
    padding: 42px clamp(28px, 5vw, 64px) 48px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.rules-section-mark {
    width: fit-content;
    min-width: 54px;
    min-height: 42px;
    margin-bottom: 18px;
    padding: 0 10px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    color: #06110b;
    background: var(--broadcast-accent);
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.rules-section-word {
    font-size: 0.92rem;
}

.rules-section-coin {
    background: var(--broadcast-warning);
}

.rules-section-coin .coin-icon {
    width: 22px;
    height: 22px;
    margin: 0 !important;
}

.rules-slide-title {
    max-width: 20ch;
    margin: 0 0 20px;
    color: var(--broadcast-text);
    font-family: var(--font-head);
    font-size: 2.1rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-align: left;
    text-wrap: balance;
}

.rules-slide-text {
    max-width: 70ch;
    margin: 0;
    color: #c9d5ce;
    font-family: var(--font-body);
    font-size: 0.94rem;
    font-weight: 400;
    line-height: 1.66;
    text-align: left;
    text-wrap: pretty;
}

.rules-slide-text strong,
.rules-slide-text .fw-bold {
    color: var(--broadcast-text) !important;
    font-weight: 700;
}

.rules-slide-text .text-accent {
    color: #59e99a !important;
}

.rules-slide-text .text-muted,
.rules-slide-text em {
    color: #a5b5ac !important;
}

.rules-disclaimer {
    max-width: 70ch;
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--broadcast-line);
    color: var(--broadcast-muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

.rules-overview-line {
    max-width: 540px;
    margin-top: 34px;
    padding-top: 13px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(43, 217, 120, 0.28);
    color: var(--broadcast-muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.rules-overview-line span::before {
    content: '';
    width: 5px;
    height: 5px;
    margin: -16px auto 8px;
    display: block;
    border-radius: 50%;
    background: var(--broadcast-accent);
}

.rules-broadcast-footer {
    min-width: 0;
    padding: 11px 14px;
    display: grid;
    grid-template-columns: 122px minmax(80px, 1fr) 150px;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--broadcast-line);
    background: #08130f;
}

.rules-nav-button {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 7px;
    font-family: var(--font-action);
    font-size: 1rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-ui-out);
}

.rules-nav-back {
    border: 1px solid var(--broadcast-line);
    color: var(--broadcast-text);
    background: transparent;
}

.rules-nav-next {
    border: 1px solid var(--product-green-line);
    color: var(--action-primary-text);
    background: var(--action-primary-bg);
}

.rules-nav-button:disabled {
    border-color: rgba(255, 255, 255, 0.06);
    color: #637168;
    background: rgba(255, 255, 255, 0.025);
    cursor: default;
}

.rules-progress {
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.rules-progress span {
    width: 14.2857%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--broadcast-accent);
    transform-origin: left center;
    transition: width 190ms var(--ease-ui-out);
}

.rules-no-motion .rules-slide,
.rules-no-motion .rules-progress span {
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
}

@media (hover: hover) and (pointer: fine) {
    .btn-close-rules:hover {
        color: var(--broadcast-text);
        background: rgba(255, 255, 255, 0.06);
    }

    .rules-mode-tab:hover:not(.active) {
        color: var(--broadcast-text);
        background: rgba(255, 255, 255, 0.035);
    }

    .rules-nav-back:hover:not(:disabled) {
        border-color: rgba(43, 217, 120, 0.42);
        background: rgba(43, 217, 120, 0.06);
    }

    .rules-nav-next:hover:not(:disabled) {
        background: var(--action-primary-hover);
    }
}

@media (max-width: 700px) {
    .rules-modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .rules-broadcast {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        grid-template-rows: max(58px, env(safe-area-inset-top)) minmax(0, 1fr) max(68px, calc(58px + env(safe-area-inset-bottom)));
        border: 0;
        border-radius: 0;
    }

    .rules-broadcast-header {
        padding: max(6px, env(safe-area-inset-top)) 8px 6px 16px;
        grid-template-columns: minmax(0, 1fr) auto 44px;
        gap: 8px;
    }

    .rules-title-lockup h2 {
        font-size: 1.22rem;
    }

    .rules-header-meta {
        min-width: 44px;
        font-size: 0.8125rem;
    }

    .rules-broadcast-body {
        grid-template-columns: 1fr;
        grid-template-rows: 58px minmax(0, 1fr);
    }

    .rules-mode-nav {
        padding: 6px 10px;
        flex-direction: row;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--broadcast-line);
        scrollbar-width: none;
    }

    .rules-mode-nav::-webkit-scrollbar {
        display: none;
    }

    .rules-mode-tab {
        width: auto;
        min-width: max-content;
        min-height: 44px;
        padding: 5px 10px 5px 6px;
        grid-template-columns: 31px auto;
        gap: 7px;
        font-size: 0.875rem;
    }

    .rules-tab-code {
        width: 30px;
        height: 28px;
        font-size: 0.75rem;
    }

    .rules-slide-inner {
        padding: 24px 18px 34px;
        scrollbar-gutter: auto;
    }

    .rules-section-mark {
        min-width: 46px;
        min-height: 36px;
        margin-bottom: 15px;
        font-size: 1.12rem;
    }

    .rules-section-word {
        font-size: 0.78rem;
    }

    .rules-slide-title {
        max-width: 100%;
        margin-bottom: 16px;
        font-size: 1.48rem;
        line-height: 1.1;
    }

    .rules-slide-text {
        font-size: 0.9375rem;
        line-height: 1.58;
    }

    .rules-overview-line {
        margin-top: 28px;
    }

    .rules-broadcast-footer {
        padding: 8px 10px max(8px, env(safe-area-inset-bottom));
        grid-template-columns: minmax(82px, 0.8fr) minmax(46px, 0.45fr) minmax(104px, 1fr);
        gap: 8px;
    }

    .rules-nav-button {
        min-height: 44px;
        padding: 0 10px;
        font-size: 0.9rem;
    }
}

@media (max-height: 620px) and (max-width: 700px) {
    .rules-broadcast-body {
        grid-template-rows: 50px minmax(0, 1fr);
    }

    .rules-mode-nav {
        padding-block: 3px;
    }

    .rules-mode-tab {
        min-height: 44px;
    }

    .rules-slide-inner {
        padding-top: 17px;
    }

    .rules-section-mark {
        margin-bottom: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rules-modal-overlay,
    .rules-broadcast,
    .rules-slide,
    .rules-progress span,
    .btn-close-rules,
    .rules-mode-tab,
    .rules-nav-button {
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }

    .rules-modal-overlay.hidden .rules-broadcast,
    .rules-slide,
    .rules-slide.exit-left,
    .rules-slide.exit-right,
    .rules-slide.from-left,
    .rules-slide.from-right {
        transform: none;
    }
}
