:root {
    --primary: #00d2ff;
    --primary-rgb: 0, 210, 255;
    --accent: #3a7bd5;
    --bg-dark: #0a0b10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', sans-serif;
}

/* Theme Variations */
body.theme-codm { --primary: #00d2ff; --primary-rgb: 0, 210, 255; --accent: #004e92; }
body.theme-ff { --primary: #ff9d00; --primary-rgb: 255, 157, 0; --accent: #ff4e00; }
body.theme-roblox { --primary: #ff003c; --primary-rgb: 255, 0, 60; --accent: #990024; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 210, 255, 0.12), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(255, 157, 0, 0.10), transparent 26%),
        radial-gradient(circle at 50% 85%, rgba(255, 0, 60, 0.10), transparent 30%),
        linear-gradient(135deg, #090a10 0%, #121521 46%, #07080d 100%);
    z-index: -1;
    transition: all 0.5s ease;
    overflow: hidden;
}

.bg-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        rgba(5, 6, 10, 0.42);
    background-size: 72px 72px;
}

.bg-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    transform: translateX(-65%);
    animation: ambientSweep 14s ease-in-out infinite;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.subtitle-bar {
    height: 4px;
    width: 60%;
    background: var(--primary);
    margin: 0 auto;
    box-shadow: 0 0 15px var(--primary);
    border-radius: 2px;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 7rem;
}

.route-loader {
    align-items: center;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(12px);
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 900;
}

.route-loader.active {
    display: flex;
}

.route-loader-card {
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.22), transparent 52%),
        rgba(16, 19, 27, 0.92);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
    min-width: 280px;
    padding: 1.4rem;
    text-align: center;
    animation: zoomIn 0.24s ease;
}

.route-loader-card img {
    border-radius: 22px;
    height: 82px;
    margin-bottom: 0.8rem;
    object-fit: cover;
    width: 82px;
}

.route-loader-card span {
    color: rgba(255, 255, 255, 0.58);
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.route-loader-card strong {
    color: #fff;
    display: block;
    font-size: 1.35rem;
    margin: 0.2rem 0 1rem;
}

.route-loader-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.route-loader-bar i {
    animation: routeLoad 0.52s ease forwards;
    background: linear-gradient(90deg, var(--primary), #27c93f);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: 0%;
}

/* Selection Screen */
#selection-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding-top: 1.5vh;
}

#selection-screen.active {
    display: flex;
    animation: fadeIn 0.8s ease forwards;
}

.selection-hero {
    align-items: stretch;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) 340px;
    text-align: left;
    width: 100%;
}

header {
    text-align: center;
}

.hero-copy {
    background:
        radial-gradient(circle at 8% 10%, rgba(0, 210, 255, 0.16), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.75rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.7), transparent);
}

header h1 {
    font-size: clamp(3.1rem, 5.2vw, 4rem);
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.2rem;
    max-width: 720px;
    opacity: 0.68;
}

.hero-status-board {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
}

.hero-status-board div {
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
}

.hero-status-board span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-status-board strong {
    color: #fff;
    font-size: 1.08rem;
}

.category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    width: 100%;
}

.category-strip span {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0.55rem 0.85rem;
    text-transform: uppercase;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 100%;
}

.game-card {
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
}

.card-inner {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.game-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    left: 0;
    padding: 0.85rem 0.95rem;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 2;
}

.game-card-top span,
.game-card-top em {
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 900;
    padding: 0.35rem 0.55rem;
    text-transform: uppercase;
}

.game-card-top em {
    color: #27c93f;
    border-color: rgba(39, 201, 63, 0.34);
}

.game-card img {
    width: 100%;
    height: 210px;
    object-fit: contain;
    padding: 36px;
    background:
        radial-gradient(circle at 50% 35%, rgba(var(--primary-rgb), 0.18), transparent 58%),
        rgba(255, 255, 255, 0.035);
    filter: brightness(0.92) contrast(1.08);
    transition: filter 0.4s ease;
}

.game-card:hover img {
    filter: brightness(1) contrast(1.12);
}

.card-content {
    padding: 1.25rem;
    text-align: left;
    border-top: 1px solid var(--border);
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.card-content span {
    font-size: 0.9rem;
    opacity: 0.62;
}

.game-reward-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.game-reward-tags b {
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 999px;
    color: #fff;
    font-size: 0.68rem;
    padding: 0.35rem 0.5rem;
    text-transform: uppercase;
}

.social-proof {
    width: 100%;
    margin-top: 0.5rem;
}

.social-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-kicker {
    color: var(--primary);
    display: block;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1.8px;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.social-header h2 {
    font-size: 1.65rem;
    line-height: 1.1;
}

.live-pill {
    align-items: center;
    background: rgba(39, 201, 63, 0.12);
    border: 1px solid rgba(39, 201, 63, 0.36);
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.live-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27c93f;
    box-shadow: 0 0 12px #27c93f;
}

.activity-wall {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.activity-feed-panel,
.comments-panel {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    padding: 1rem;
    backdrop-filter: blur(16px);
}

.activity-feed-panel h3,
.comments-panel h3 {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
    text-transform: uppercase;
}

.activity-feed,
.comment-feed {
    display: grid;
    gap: 0.75rem;
}

.activity-feed-item,
.comment-item {
    animation: feedIn 0.35s ease both;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
}

.activity-feed-item {
    align-items: center;
    grid-template-columns: 44px 1fr auto;
}

.activity-feed-item img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(var(--primary-rgb), 0.24));
}

.activity-feed-item strong,
.comment-meta strong {
    color: #fff;
    display: block;
    font-size: 0.9rem;
}

.activity-feed-item span,
.activity-feed-item em,
.comment-meta span,
.comment-item p {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-style: normal;
}

.activity-feed-item em {
    color: var(--primary);
    font-weight: 800;
    text-align: right;
}

.comment-item {
    grid-template-columns: 38px 1fr;
}

.comment-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.comment-meta {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.2rem;
}

.comment-meta span {
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    text-transform: uppercase;
}

/* Generator Screen */
#generator-screen {
    display: none;
    animation: slideUp 0.6s ease forwards;
}

#generator-screen.active {
    display: block;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
    margin-bottom: 2rem;
}

.back-btn:hover {
    opacity: 1;
}

.generator-container {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 30px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.45rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.unified-layout {
    align-items: start;
    display: grid;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1fr) 260px;
}

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

.flow-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.55rem;
}

.flow-step {
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.52);
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.45rem;
    justify-content: center;
    padding: 0.7rem 0.45rem;
    text-transform: uppercase;
}

.flow-step span {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.flow-step.active {
    border-color: rgba(var(--primary-rgb), 0.62);
    color: #fff;
    box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.12);
}

.flow-step.done span {
    background: #27c93f;
    color: #fff;
}

.game-header h2 {
    text-align: center;
    font-size: 1.85rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-transform: uppercase;
}

.game-header p {
    text-align: center;
    opacity: 0.68;
    margin-bottom: 1.45rem;
}

.game-header img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
    object-position: center;
    border-radius: 28px;
    margin: 0 auto 1.1rem;
    border: 1px solid var(--border);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
    filter: brightness(0.96) contrast(1.08) saturate(1.05);
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-wrapper {
    display: flex;
    gap: 10px;
}

.search-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.search-results-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: none; /* Hidden by default */
}

.search-results-box.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.search-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.search-header .percent {
    color: var(--primary);
    font-weight: 700;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.1s linear;
}

.search-steps {
    list-style: none;
    font-size: 0.9rem;
    opacity: 0.8;
}

.search-steps li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-steps li.done {
    color: #27c93f;
    opacity: 1;
}

.action-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.action-btn {
    width: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin-top: 1rem;
}

.resource-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.resource-section.locked {
    opacity: 0.42;
    pointer-events: none;
}

.resource-section h3 {
    font-size: 1rem;
    opacity: 0.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.featured-reward {
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.16), rgba(255, 215, 0, 0.08)),
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(var(--primary-rgb), 0.34);
    border-radius: 18px;
    color: #fff;
    cursor: pointer;
    display: grid;
    font: inherit;
    grid-template-columns: 42% 1fr;
    margin-bottom: 1rem;
    min-height: 150px;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-align: left;
    width: 100%;
}

.featured-reward::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    opacity: 0;
    transform: translateX(-65%);
    transition: opacity 0.25s;
}

.featured-reward:hover::after {
    opacity: 1;
    animation: featuredSweep 1s ease;
}

.featured-reward img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.featured-reward div {
    align-self: end;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.featured-reward span {
    color: var(--primary);
    display: block;
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 1px;
    margin-bottom: 0.38rem;
    text-transform: uppercase;
}

.featured-reward strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1.02;
}

.featured-reward em {
    color: rgba(255, 255, 255, 0.62);
    display: block;
    font-size: 0.82rem;
    font-style: normal;
    margin-top: 0.42rem;
}

.reward-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.reward-tab {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 900;
    padding: 0.8rem 0.45rem;
    text-transform: uppercase;
    transition: border-color 0.25s, color 0.25s, transform 0.25s, background 0.25s;
}

.reward-tab:hover,
.reward-tab.active {
    background: rgba(var(--primary-rgb), 0.14);
    border-color: rgba(var(--primary-rgb), 0.68);
    color: #fff;
    transform: translateY(-2px);
}

.player-found-card {
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    animation: slideIn 0.5s ease;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.p-name {
    font-weight: 800;
    color: #fff;
    font-size: 1.1rem;
}

.p-detail {
    font-size: 0.8rem;
    opacity: 0.7;
}

.p-region {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
}

.status-badge {
    background: #27c93f;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 0 10px #27c93f;
}

.validation-error-card {
    background:
        linear-gradient(135deg, rgba(255, 189, 46, 0.14), transparent 48%),
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 189, 46, 0.45);
    border-radius: 12px;
    color: #fff;
    margin-top: 10px;
    padding: 1rem;
    animation: slideIn 0.35s ease;
}

.validation-error-card strong {
    color: #ffbd2e;
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.validation-error-card span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Resource Grid Updated to Reference */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 2rem;
    max-height: 440px;
    overflow-y: auto;
    padding: 5px;
}

.res-card {
    background:
        radial-gradient(circle at 50% 35%, rgba(var(--primary-rgb), 0.24), transparent 55%),
        #11131b;
    border: 2px solid #3a3f4b;
    border-radius: 12px;
    min-height: 184px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    color: #fff;
    font: inherit;
    text-align: left;
    padding: 18px 18px 14px;
}

.resource-grid .res-card {
    opacity: 0;
    transform: translateY(12px);
}

.resource-grid.grid-loaded .res-card {
    animation: rewardCardIn 0.42s ease forwards;
    animation-delay: var(--card-delay, 0ms);
}

.res-card:hover {
    transform: scale(1.05);
    border-color: #ffd700;
}

.res-card.active {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.rarity-standard { --rarity: rgba(255, 255, 255, 0.2); }
.rarity-rare { --rarity: rgba(0, 210, 255, 0.65); }
.rarity-epic { --rarity: rgba(176, 87, 255, 0.72); }
.rarity-legendary { --rarity: rgba(255, 189, 46, 0.84); }

.res-card {
    box-shadow: inset 0 0 0 1px transparent;
}

.res-card.rarity-rare,
.res-card.rarity-epic,
.res-card.rarity-legendary,
.featured-reward.rarity-rare,
.featured-reward.rarity-epic,
.featured-reward.rarity-legendary {
    border-color: var(--rarity);
    box-shadow: 0 0 22px color-mix(in srgb, var(--rarity), transparent 72%);
}

.res-card.active::after {
    content: "Seleccionado";
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    background: #ffd700;
    border-radius: 999px;
    color: #080a10;
    font-size: 0.68rem;
    font-weight: 950;
    padding: 0.38rem 0.62rem;
    text-transform: uppercase;
}

.res-card.picked {
    animation: cardPick 0.42s ease;
}

.res-card.media-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 36%),
        #10131b;
    min-height: 282px;
    padding: 0;
}

.res-card.media-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(180deg, transparent 36%, rgba(7, 9, 14, 0.88) 61%, rgba(7, 9, 14, 0.98)),
        radial-gradient(circle at 20% 80%, rgba(var(--primary-rgb), 0.22), transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.res-card .card-bg-img {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 138px;
    height: 138px;
    object-fit: contain;
    padding: 0;
    filter: brightness(0.92) contrast(1.1);
    transform: translateY(-50%);
    transition: filter 0.3s;
}

.res-card .card-bg-img.wide {
    top: 0;
    right: 0;
    width: 54%;
    height: 100%;
    object-fit: cover;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 10px 10px 0;
    opacity: 0.94;
    transform: none;
    filter: brightness(0.72) contrast(1.16) saturate(1.08);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
}

.res-card.media-card .card-bg-img.wide {
    left: 0;
    right: auto;
    width: 100%;
    height: 63%;
    border-left: none;
    border-radius: 10px 10px 0 0;
    opacity: 1;
    object-fit: cover;
    transform: none;
    filter: brightness(0.9) contrast(1.1) saturate(1.08);
    -webkit-mask-image: none;
    mask-image: none;
}

.res-card.active .card-bg-img.wide,
.res-card:hover .card-bg-img.wide {
    filter: brightness(0.92) contrast(1.12) saturate(1.14);
}

.res-card:hover .card-bg-img {
    filter: brightness(1);
}

.res-card:hover .card-bg-img.wide {
    filter: brightness(0.92) contrast(1.12) saturate(1.14);
}

.package-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 148px;
}

.card-bg-img.wide + .package-copy {
    padding-right: 49%;
}

.media-card .card-bg-img.wide + .package-copy,
.media-card .package-badge + .card-bg-img.wide + .package-copy {
    justify-content: flex-end;
    min-height: 282px;
    padding: 164px 18px 16px;
    width: 100%;
}

.package-channel {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72) !important;
    display: inline-flex;
    font-size: 0.62rem !important;
    font-weight: 900;
    letter-spacing: 0 !important;
    line-height: 1;
    margin-bottom: 0.35rem;
    padding: 0.32rem 0.5rem;
    text-transform: uppercase !important;
}

.package-copy strong {
    font-size: 1.75rem;
    line-height: 1;
}

.media-card .package-copy strong {
    font-size: 1.52rem;
    max-width: 94%;
}

.package-copy span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.package-copy .package-bonus {
    color: var(--primary);
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: none;
}

.package-copy em {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.75rem;
    font-style: normal;
    line-height: 1.25;
    margin-top: 0.45rem;
    max-width: 180px;
}

.media-card .package-copy em {
    max-width: 92%;
}

.package-meta {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.58rem;
}

.package-meta b {
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 800;
}

.package-meta i {
    background: rgba(39, 201, 63, 0.14);
    border: 1px solid rgba(39, 201, 63, 0.35);
    border-radius: 999px;
    color: #27c93f;
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 900;
    padding: 0.22rem 0.46rem;
    text-transform: uppercase;
}

.package-meta mark {
    background: color-mix(in srgb, var(--rarity, rgba(255,255,255,0.28)), transparent 76%);
    border: 1px solid color-mix(in srgb, var(--rarity, rgba(255,255,255,0.28)), transparent 48%);
    border-radius: 999px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 950;
    padding: 0.2rem 0.42rem;
    text-transform: uppercase;
}

.generator-live-rail {
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.12), transparent 42%),
        rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
    position: sticky;
    top: 1rem;
}

.rail-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.rail-header span,
.rail-feed-title {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rail-header strong {
    color: var(--primary);
    font-size: 0.86rem;
    text-align: right;
}

.rail-stat {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
}

.rail-stat span {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.75rem;
}

.rail-stat strong {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.45rem;
}

.rail-meter {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    height: 7px;
    margin: 0.8rem 0 1rem;
    overflow: hidden;
}

.rail-meter i {
    animation: railPulse 2.7s ease-in-out infinite;
    background: linear-gradient(90deg, var(--primary), #27c93f);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: 64%;
}

.generator-feed-mini {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.generator-feed-mini .activity-feed-item {
    grid-template-columns: 34px 1fr;
    padding: 0.55rem;
}

.generator-feed-mini .activity-feed-item img {
    height: 34px;
    width: 34px;
}

.generator-feed-mini .activity-feed-item span,
.generator-feed-mini .activity-feed-item em {
    font-size: 0.68rem;
}

.generator-feed-mini .activity-feed-item em {
    grid-column: 2;
    text-align: left;
}

.rail-note {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 1rem;
    padding-top: 0.85rem;
}

.package-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.18);
    border: 1px solid rgba(var(--primary-rgb), 0.5);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.package-badge + .card-bg-img + .package-copy {
    padding-top: 26px;
}

.media-card .package-badge + .card-bg-img + .package-copy {
    padding-top: 164px;
}

.order-summary,
.receipt-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-summary {
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), transparent 44%),
        rgba(0, 0, 0, 0.34);
}

.summary-head {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.8rem;
}

.summary-head strong {
    color: var(--primary);
    font-size: 0.82rem;
    text-align: right;
    text-transform: uppercase;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.summary-preview {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), transparent 52%),
        rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.85rem;
    padding: 0.75rem;
}

.summary-preview img {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    height: 64px;
    object-fit: cover;
    opacity: 0.38;
    width: 88px;
}

.summary-preview:not(.active) img {
    display: none;
}

.summary-preview.active img {
    display: block;
    opacity: 1;
}

.summary-preview div {
    min-width: 0;
}

.summary-preview strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-preview em {
    color: rgba(255, 255, 255, 0.52);
    display: block;
    font-size: 0.76rem;
    font-style: normal;
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-summary span,
.receipt-preview span {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.78rem;
    margin-bottom: 3px;
}

.order-summary strong,
.receipt-preview strong {
    color: #fff;
    font-size: 1rem;
}

.checkout-box {
    text-align: left;
}

.checkout-box h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
}

.checkout-media {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), transparent 55%),
        rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--primary-rgb), 0.24);
    border-radius: 18px;
    display: grid;
    gap: 1rem;
    grid-template-columns: 150px 1fr;
    margin-bottom: 1rem;
    overflow: hidden;
    padding: 0.85rem;
}

.checkout-media img {
    border-radius: 14px;
    height: 96px;
    object-fit: cover;
    width: 150px;
}

.checkout-media span {
    color: var(--primary);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 0.28rem;
    text-transform: uppercase;
}

.checkout-media strong {
    color: #fff;
    display: block;
    font-size: 1.45rem;
    line-height: 1.05;
}

.checkout-media em {
    color: rgba(255, 255, 255, 0.58);
    display: block;
    font-size: 0.86rem;
    font-style: normal;
    margin-top: 0.35rem;
}

.receipt-preview {
    grid-template-columns: 1fr;
}

.receipt-preview div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
}

.receipt-preview div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.checkout-checks {
    display: grid;
    gap: 0.55rem;
    list-style: none;
    margin: 0 0 1rem;
}

.checkout-checks li {
    align-items: center;
    background: rgba(39, 201, 63, 0.07);
    border: 1px solid rgba(39, 201, 63, 0.18);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    font-size: 0.86rem;
    gap: 0.65rem;
    padding: 0.72rem;
}

.checkout-checks span {
    background: #27c93f;
    border-radius: 999px;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 950;
    padding: 0.25rem 0.42rem;
}

.delivery-box {
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.18), transparent 45%),
        rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    border-radius: 22px;
    padding: 1.4rem;
    box-shadow: inset 0 0 40px rgba(var(--primary-rgb), 0.05);
}

.delivery-hero {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.4rem;
}

.delivery-hero img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 8px;
    filter: drop-shadow(0 14px 24px rgba(var(--primary-rgb), 0.24));
    animation: prizeFloat 2.4s ease-in-out infinite;
}

.delivery-eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.delivery-hero h3 {
    font-size: 1.55rem;
    line-height: 1.1;
    margin-bottom: 0.45rem;
}

.delivery-hero p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
}

.delivery-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: -0.45rem 0 1.15rem;
}

.delivery-meta div {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 12px;
    padding: 0.72rem;
    min-width: 0;
}

.delivery-meta span {
    display: block;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.delivery-meta strong {
    display: block;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-meter {
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.delivery-progress {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, var(--primary), #27c93f),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.18) 0 8px, transparent 8px 16px);
    box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.55);
    transition: width 0.12s linear;
}

.delivery-percent {
    text-align: right;
    color: var(--primary);
    font-weight: 900;
    margin: 0.55rem 0 1rem;
    font-family: var(--font-mono);
}

.delivery-steps {
    list-style: none;
    display: grid;
    gap: 0.72rem;
    margin-bottom: 1.2rem;
}

.delivery-steps li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem;
    transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.delivery-steps li span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 900;
}

.delivery-steps li.active {
    color: #fff;
    border-color: rgba(var(--primary-rgb), 0.48);
    transform: translateX(4px);
}

.delivery-steps li.done span {
    background: #27c93f;
    color: #fff;
    box-shadow: 0 0 14px rgba(39, 201, 63, 0.42);
}

.delivery-log {
    background:
        linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), transparent),
        rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 16px;
    margin: 0.4rem 0 1.2rem;
    overflow: hidden;
}

.delivery-log-header {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    font-size: 0.72rem;
    font-weight: 900;
    gap: 0.45rem;
    letter-spacing: 0.6px;
    padding: 0.75rem 0.9rem;
    text-transform: uppercase;
}

.delivery-log-header span {
    background: #27c93f;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(39, 201, 63, 0.65);
    height: 8px;
    width: 8px;
}

.delivery-log-lines {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    max-height: 128px;
    overflow-y: auto;
    padding: 0.8rem 0.9rem;
}

.delivery-log-line {
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.35;
}

.delivery-log-line span {
    color: var(--primary);
    display: inline-block;
    margin-right: 0.5rem;
}

.delivery-log-line.muted {
    color: rgba(255, 255, 255, 0.52);
}

.delivery-log-line.success {
    color: #27c93f;
}

/* Custom Scrollbar for Grid */
.resource-grid::-webkit-scrollbar {
    width: 6px;
}
.resource-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.resource-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Success Box */
.success-box {
    text-align: center;
}

.checkmark {
    width: 80px;
    height: 80px;
    background: #27c93f;
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 0 30px rgba(39, 201, 63, 0.4);
}

.verify-btn {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 2rem;
}

.verify-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: white;
    mix-blend-mode: lighten;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    width: 100%;
    background: var(--bg-dark);
    clip: rect(0, 0, 0, 0);
}

.glitch::before {
    left: -2px;
    text-shadow: 2px 0 #ff00c1;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: 2px;
    text-shadow: -2px 0 #00fff9;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    20% { clip: rect(80px, 9999px, 70px, 0); }
    40% { clip: rect(10px, 9999px, 50px, 0); }
    60% { clip: rect(50px, 9999px, 30px, 0); }
    80% { clip: rect(20px, 9999px, 90px, 0); }
    100% { clip: rect(60px, 9999px, 40px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    20% { clip: rect(40px, 9999px, 20px, 0); }
    40% { clip: rect(90px, 9999px, 10px, 0); }
    60% { clip: rect(20px, 9999px, 50px, 0); }
    80% { clip: rect(70px, 9999px, 30px, 0); }
    100% { clip: rect(30px, 9999px, 60px, 0); }
}

/* Live Activity Ticker */
.live-activity {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    min-width: 350px;
    animation: slideUpActivity 0.5s ease-out;
}

.activity-icon {
    background: var(--primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 0 10px var(--primary);
}

.activity-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.activity-text b {
    color: var(--primary);
}

@keyframes slideUpActivity {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 16px; opacity: 1; }
}

@keyframes prizeFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.03); }
}

@keyframes ambientSweep {
    0%, 100% { transform: translateX(-65%); opacity: 0.15; }
    50% { transform: translateX(65%); opacity: 0.35; }
}

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

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

@keyframes feedIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardPick {
    0% { transform: scale(1); }
    45% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

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

@keyframes featuredSweep {
    from { transform: translateX(-70%); }
    to { transform: translateX(90%); }
}

@keyframes railPulse {
    0%, 100% { width: 46%; opacity: 0.72; }
    50% { width: 82%; opacity: 1; }
}

@keyframes routeLoad {
    to { width: 100%; }
}

@keyframes winFade {
    0% { opacity: 0; }
    12% { opacity: 1; }
    78% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes winAura {
    0% { transform: scale(0.82); filter: blur(20px); }
    40% { transform: scale(1); filter: blur(2px); }
    100% { transform: scale(1.18); filter: blur(12px); }
}

@keyframes winTitle {
    0% { opacity: 0; transform: scale(0.82) translateY(20px); letter-spacing: 0; }
    18% { opacity: 1; transform: scale(1.04) translateY(0); letter-spacing: 1px; }
    72% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(1.08) translateY(-10px); }
}

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

.modal-overlay.active {
    display: flex;
}

.fullscreen-win {
    align-items: center;
    display: none;
    inset: 0;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 1001;
}

.fullscreen-win.active {
    display: flex;
    animation: winFade 2.4s ease forwards;
}

.win-aura {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 50% 45%, rgba(39, 201, 63, 0.42), transparent 28%),
        radial-gradient(circle at 50% 55%, rgba(255, 189, 46, 0.28), transparent 36%),
        rgba(0, 0, 0, 0.18);
    animation: winAura 2.4s ease forwards;
}

.win-copy {
    max-width: min(900px, 92vw);
    position: relative;
    text-align: center;
    text-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(-2vh);
}

.win-copy span {
    background: rgba(39, 201, 63, 0.18);
    border: 1px solid rgba(39, 201, 63, 0.45);
    border-radius: 999px;
    color: #27c93f;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 950;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    padding: 0.55rem 0.95rem;
    text-transform: uppercase;
}

.win-copy strong {
    color: #fff;
    display: block;
    font-size: clamp(3rem, 9vw, 7.5rem);
    font-weight: 950;
    line-height: 0.9;
    text-transform: uppercase;
    animation: winTitle 2.4s ease forwards;
}

.win-copy em {
    color: rgba(255, 255, 255, 0.78);
    display: block;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-style: normal;
    font-weight: 800;
    margin-top: 1.1rem;
}

.modal-content {
    background:
        radial-gradient(circle at 50% 4%, rgba(39, 201, 63, 0.24), transparent 22%),
        radial-gradient(circle at 50% 0%, rgba(255, 189, 46, 0.2), transparent 38%),
        linear-gradient(160deg, #3d66dc, #274fc3 52%, #1d3aa0);
    width: 90%;
    max-width: 500px;
    border-radius: 25px;
    padding: 2.5rem;
    position: relative;
    text-align: center;
    color: #fff;
    box-shadow:
        0 0 40px rgba(42, 82, 190, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal-content::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -20%;
    width: 72%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(18deg);
    animation: modalSweep 3.2s ease-in-out infinite;
    pointer-events: none;
}

.modal-content::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 21%, rgba(255, 255, 255, 0.42), transparent 18%),
        radial-gradient(circle at 50% 32%, rgba(39, 201, 63, 0.22), transparent 32%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.modal-content.modal-complete {
    box-shadow:
        0 0 0 1px rgba(39, 201, 63, 0.35),
        0 0 55px rgba(39, 201, 63, 0.42),
        0 0 120px rgba(255, 189, 46, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.modal-content.modal-complete::after {
    animation: successFlash 1.05s ease forwards;
}

.success-burst {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 4;
}

.success-burst span {
    background: var(--burst-color);
    border-radius: 999px;
    box-shadow: 0 0 14px var(--burst-color);
    height: 14px;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 22%;
    transform: translate(-50%, -50%) scale(0.3);
    width: 6px;
}

.success-burst.active span {
    animation: successParticle 1.25s cubic-bezier(0.16, 0.9, 0.2, 1) forwards;
    animation-delay: var(--delay);
}

.modal-prize-stage {
    width: 178px;
    height: 150px;
    margin: 0 auto 0.8rem;
    position: relative;
    display: grid;
    place-items: center;
}

.modal-prize-stage::before {
    content: "";
    position: absolute;
    inset: 30px 42px;
    border-radius: 50%;
    background: rgba(39, 201, 63, 0.13);
    filter: blur(16px);
    animation: prizeCorePulse 1.4s ease-in-out infinite;
}

.stage-rays {
    position: absolute;
    inset: -30px 0 -18px;
    background:
        conic-gradient(from 0deg, transparent 0 10deg, rgba(255, 189, 46, 0.28) 10deg 16deg, transparent 16deg 34deg, rgba(39, 201, 63, 0.22) 34deg 40deg, transparent 40deg 60deg);
    border-radius: 50%;
    filter: blur(0.2px);
    opacity: 0.42;
    animation: ringSpin 9s linear infinite;
}

.modal-complete .stage-rays {
    opacity: 0.78;
    animation-duration: 4.5s;
}

.modal-prize-stage img {
    width: 104px;
    height: 82px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
    animation: modalPrizeLoad 1.8s ease-in-out infinite;
}

.reward-chip {
    position: absolute;
    z-index: 3;
    background: rgba(0, 0, 0, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 950;
    padding: 0.32rem 0.5rem;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.chip-left {
    left: 0;
    top: 58%;
    animation: chipFloat 2.2s ease-in-out infinite;
}

.chip-right {
    right: -2px;
    top: 30%;
    color: #27c93f;
    animation: chipFloat 2.2s ease-in-out 0.45s infinite;
}

.modal-success-ribbon {
    background: rgba(39, 201, 63, 0.13);
    border: 1px solid rgba(39, 201, 63, 0.32);
    border-radius: 999px;
    color: #27c93f;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    opacity: 0;
    padding: 0.42rem 0.72rem;
    position: relative;
    text-transform: uppercase;
    transform: translateY(8px);
    z-index: 1;
}

.modal-complete .modal-success-ribbon {
    animation: ribbonIn 0.5s ease forwards;
}

.stage-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.ring-one {
    inset: 20px 42px;
    border-top-color: #27c93f;
    border-right-color: #ffbd2e;
    animation: ringSpin 2.4s linear infinite;
}

.ring-two {
    inset: 8px 30px;
    border-bottom-color: rgba(0, 225, 255, 0.85);
    border-left-color: rgba(255, 255, 255, 0.08);
    animation: ringSpinReverse 3.3s linear infinite;
}

.stage-spark {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffbd2e;
    box-shadow: 0 0 16px rgba(255, 189, 46, 0.9);
    opacity: 0;
    z-index: 3;
    animation: stageSpark 1.6s ease-in-out infinite;
}

.spark-one { top: 22px; right: 26px; animation-delay: 0.1s; }
.spark-two { left: 20px; bottom: 35px; animation-delay: 0.55s; }
.spark-three { right: 18px; bottom: 18px; animation-delay: 0.95s; }

.modal-complete .modal-prize-stage img {
    animation: modalPrizeDone 0.85s ease forwards;
}

.modal-complete .modal-title {
    animation: successTitlePop 0.62s ease;
}

.modal-complete .ring-one,
.modal-complete .ring-two {
    border-color: rgba(39, 201, 63, 0.75);
    animation-duration: 1.2s;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
}

.modal-title {
    color: #ff9d00;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.modal-item {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.modal-check {
    background: #27c93f;
    min-width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 0 8px rgba(39, 201, 63, 0.16), 0 0 20px rgba(39, 201, 63, 0.58);
    animation: checkPop 0.35s ease;
}

.modal-spinner {
    min-width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #27c93f;
    animation: modalSpin 0.9s linear infinite, spinnerPulse 1.2s ease-in-out infinite;
}

.id-display-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-info {
    text-align: left;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
        rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
}

.info-row:last-child { margin-bottom: 0; }

.info-icon { font-size: 1.5rem; }

.modal-complete .modal-info {
    animation: receiptGlow 1.2s ease;
}

.info-text {
    display: flex;
    flex-direction: column;
}

.info-text strong { font-size: 0.8rem; opacity: 0.8; }

.modal-process {
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.modal-process-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    overflow: hidden;
}

.modal-progress {
    width: 0%;
    height: 100%;
    background:
        linear-gradient(90deg, #27c93f, #00d8ff, #ffbd2e),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.24) 0 8px, transparent 8px 16px);
    border-radius: inherit;
    box-shadow: 0 0 18px rgba(39, 201, 63, 0.45);
    background-size: 180% 100%, auto;
    animation: progressGlow 1.2s linear infinite;
    transition: width 0.12s linear;
}

.modal-percent {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 900;
    color: #ffbd2e;
    margin: 0.45rem 0 0.8rem;
}

.modal-process-steps {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    text-align: left;
}

.modal-process-steps li {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.86rem;
    padding-left: 1.4rem;
    position: relative;
}

.modal-process-steps li::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
}

.modal-process-steps li.active {
    color: #fff;
}

.modal-process-steps li.done::before {
    background: #27c93f;
    box-shadow: 0 0 10px rgba(39, 201, 63, 0.8);
}

.modal-btn {
    background: #3a7bd5;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-btn:hover { background: #2a52be; }

.modal-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes modalSpin {
    to { transform: rotate(360deg); }
}

@keyframes modalSweep {
    0%, 100% { transform: translateX(-55%) rotate(18deg); opacity: 0; }
    35%, 65% { opacity: 1; }
    100% { transform: translateX(190%) rotate(18deg); opacity: 0; }
}

@keyframes prizeCorePulse {
    0%, 100% { transform: scale(0.82); opacity: 0.55; }
    50% { transform: scale(1.18); opacity: 0.95; }
}

@keyframes modalPrizeLoad {
    0%, 100% { transform: translateY(0) scale(1) rotate(-1deg); }
    50% { transform: translateY(-8px) scale(1.08) rotate(1deg); }
}

@keyframes modalPrizeDone {
    0% { transform: scale(0.94); }
    45% { transform: translateY(-8px) scale(1.28); }
    100% { transform: translateY(-2px) scale(1.1); }
}

@keyframes ringSpin {
    to { transform: rotate(360deg); }
}

@keyframes ringSpinReverse {
    to { transform: rotate(-360deg); }
}

@keyframes stageSpark {
    0%, 100% { opacity: 0; transform: scale(0.4) translateY(6px); }
    45% { opacity: 1; transform: scale(1.2) translateY(-4px); }
}

@keyframes spinnerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39, 201, 63, 0.22); }
    50% { box-shadow: 0 0 0 8px rgba(39, 201, 63, 0); }
}

@keyframes progressGlow {
    to { background-position: 180% 0, 0 0; }
}

@keyframes checkPop {
    from { transform: scale(0.7); opacity: 0.4; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes successFlash {
    0% { opacity: 0; transform: scale(0.92); }
    18% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.18); }
}

@keyframes successParticle {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
    }
    16% {
        opacity: 1;
    }
    78% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--rot));
    }
}

@keyframes successTitlePop {
    0% { transform: translateY(0) scale(1); }
    45% { transform: translateY(-4px) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
}

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

@keyframes ribbonIn {
    from { opacity: 0; transform: translateY(8px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes receiptGlow {
    0% { box-shadow: 0 0 0 rgba(39, 201, 63, 0); }
    35% { box-shadow: 0 0 32px rgba(39, 201, 63, 0.22); }
    100% { box-shadow: 0 0 0 rgba(39, 201, 63, 0); }
}

@media (max-width: 720px) {
    #app {
        padding: 1rem 1rem 6.5rem;
    }

    .game-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .selection-hero {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding: 1.35rem;
    }

    .flow-steps,
    .reward-tabs,
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-preview {
        grid-template-columns: 72px 1fr;
    }

    .summary-preview img {
        height: 56px;
        width: 72px;
    }

    .activity-wall {
        grid-template-columns: 1fr;
    }

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

    .activity-feed-item {
        grid-template-columns: 40px 1fr;
    }

    .activity-feed-item em {
        grid-column: 2;
        text-align: left;
    }

    header h1 {
        font-size: 2.4rem;
    }

    .generator-container {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .unified-layout {
        grid-template-columns: 1fr;
    }

    .generator-live-rail {
        position: static;
    }

    .featured-reward {
        grid-template-columns: 1fr;
    }

    .featured-reward img {
        height: 150px;
    }

    .game-header img {
        width: 112px;
        height: 112px;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .search-btn {
        padding: 1rem;
    }

    .live-activity {
        min-width: 0;
        width: calc(100% - 2rem);
        padding: 10px 16px;
    }

    .delivery-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .checkout-media {
        grid-template-columns: 1fr;
    }

    .checkout-media img {
        height: 140px;
        width: 100%;
    }

    .delivery-hero img {
        margin: 0 auto;
    }

    .delivery-meta {
        grid-template-columns: 1fr;
    }

    .delivery-log-lines {
        max-height: 150px;
    }

    .delivery-steps li.active {
        transform: none;
    }

    .res-card .card-bg-img {
        width: 112px;
        height: 112px;
        right: 14px;
    }

    .res-card .card-bg-img.wide {
        width: 58%;
        height: 100%;
        right: 0;
    }

    .res-card.media-card {
        min-height: 264px;
    }

    .res-card.media-card .card-bg-img.wide {
        width: 100%;
        height: 60%;
        right: auto;
    }

    .package-copy {
        padding-right: 122px;
    }

    .card-bg-img.wide + .package-copy {
        padding-right: 52%;
    }

    .media-card .card-bg-img.wide + .package-copy,
    .media-card .package-badge + .card-bg-img.wide + .package-copy {
        min-height: 264px;
        padding: 148px 16px 15px;
    }
}
