:root {
    --platform-bg: #07080a;
    --platform-surface: #101216;
    --platform-surface-raised: #171a20;
    --platform-line: rgba(210, 27, 65, 0.28);
    --platform-line-strong: rgba(238, 34, 76, 0.56);
    --platform-text: #f5f1f2;
    --platform-muted: #b7a4a9;
    --platform-accent: #d21b41;
    --platform-accent-bright: #f02b54;
    --platform-gold: #cfa85c;
    --platform-good: #38bd82;
    --platform-header: rgba(7, 8, 10, 0.93);
    --platform-shadow: 0 18px 52px rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] {
    --platform-bg: #f7f5f5;
    --platform-surface: #ffffff;
    --platform-surface-raised: #f2eded;
    --platform-line: rgba(157, 21, 48, 0.2);
    --platform-line-strong: rgba(190, 23, 57, 0.42);
    --platform-text: #1e1618;
    --platform-muted: #66545a;
    --platform-accent: #bd1739;
    --platform-accent-bright: #d82047;
    --platform-gold: #946523;
    --platform-header: rgba(255, 255, 255, 0.94);
    --platform-shadow: 0 14px 40px rgba(34, 15, 20, 0.1);
}

.platform-page {
    min-height: 100vh;
    margin: 0;
    background: var(--platform-bg);
    color: var(--platform-text);
    font-family: Arial, sans-serif;
}

.platform-page::before,
.platform-page::after {
    display: none;
}

.platform-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 20px;
    padding: 10px clamp(16px, 4vw, 34px);
    border-bottom: 1px solid var(--platform-line);
    background: var(--platform-header);
    backdrop-filter: blur(12px);
}

.platform-brand,
.platform-nav,
.platform-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 25px;
    height: 25px;
    margin-right: 8px;
    flex: 0 0 auto;
    border: 1px solid var(--platform-line-strong);
    border-radius: 999px;
    background: linear-gradient(145deg, var(--platform-accent), #32070f);
    background-position: center;
    background-size: cover;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
}

.platform-brand {
    gap: 11px;
    font-weight: 700;
    color: var(--platform-text);
    text-decoration: none;
    white-space: nowrap;
}

.platform-brand-mark {
    display: block;
    width: 31px;
    height: 35px;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(165deg, #f22a53, #b40e30 62%, #700a21);
}

.platform-brand-word {
    font-size: 1rem;
    text-transform: uppercase;
}

.platform-brand-word span {
    color: var(--platform-accent-bright);
}

.platform-link,
.platform-button,
.platform-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--platform-muted);
    background: transparent;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.platform-link:hover,
.platform-link.is-active,
.platform-account-button:hover {
    border-color: var(--platform-line);
    color: var(--platform-text);
    background: var(--platform-surface);
}

.platform-button {
    border-color: var(--platform-line-strong);
    color: #fff;
    background: var(--platform-accent);
    font-weight: 700;
}

.platform-button.secondary {
    color: var(--platform-text);
    background: var(--platform-surface);
    border-color: var(--platform-line);
}

.platform-page [hidden] {
    display: none;
}

.platform-dashboard {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(24px, 5vh, 46px) 0 40px;
}

.platform-hero {
    position: relative;
    min-height: min(48vh, 470px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 1px solid var(--platform-line);
    background:
        linear-gradient(90deg, rgba(7, 8, 10, 0.98) 0%, rgba(7, 8, 10, 0.86) 45%, rgba(7, 8, 10, 0.45) 100%),
        linear-gradient(135deg, #171a20 0%, #090a0c 45%, #230b12 100%);
}

.platform-hero::after {
    content: "";
    position: absolute;
    right: 8%;
    bottom: -18%;
    width: min(42vw, 410px);
    height: min(48vw, 460px);
    clip-path: polygon(50% 0%, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
    border: 1px solid rgba(210, 27, 65, 0.34);
    background: rgba(210, 27, 65, 0.05);
}

.platform-hero-content {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(34px, 6vw, 62px) 0;
}

.platform-label {
    margin: 0 0 12px;
    color: var(--platform-gold);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.platform-title {
    margin: 0 0 14px;
    max-width: 720px;
    color: var(--platform-text);
    font-size: 4.8rem;
    line-height: 0.98;
    font-weight: 800;
}

.platform-title span {
    color: var(--platform-accent-bright);
}

.platform-description {
    max-width: 510px;
    margin: 0 0 26px;
    color: var(--platform-muted);
    line-height: 1.55;
}

.platform-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.platform-section {
    padding: 27px 0 0;
}

.platform-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.platform-section h2 {
    margin: 0;
    color: var(--platform-text);
    font-size: 1.35rem;
}

.platform-state {
    color: var(--platform-muted);
    font-size: 0.9rem;
}

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

.game-tile {
    display: grid;
    gap: 13px;
    min-height: 180px;
    padding: 18px;
    border: 1px solid var(--platform-line);
    border-radius: 8px;
    background: var(--platform-surface);
}

.game-tile.is-locked {
    opacity: 0.8;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.game-status {
    padding: 4px 8px;
    border: 1px solid var(--platform-line);
    border-radius: 4px;
    color: var(--platform-muted);
    font-size: 0.73rem;
    text-transform: uppercase;
}

.game-tile.is-open .game-status {
    color: var(--platform-good);
    border-color: rgba(56, 189, 130, 0.35);
}

.game-tile h3 {
    margin: 0;
    color: var(--platform-text);
    font-size: 1.1rem;
}

.game-tile p {
    margin: 0;
    color: var(--platform-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.game-tile .platform-button {
    margin-top: auto;
    width: max-content;
}

.platform-account-menu {
    position: relative;
}

.platform-account-menu summary {
    list-style: none;
}

.platform-account-menu summary::-webkit-details-marker {
    display: none;
}

.platform-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--platform-line);
    border-radius: 8px;
    background: var(--platform-surface);
    box-shadow: var(--platform-shadow);
}

.platform-dropdown .platform-link {
    width: 100%;
    justify-content: flex-start;
}

.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--platform-good);
    color: #08140d;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

.notification-badge[hidden] {
    display: none !important;
}

@media (max-width: 860px) {
    .platform-header {
        flex-wrap: wrap;
    }

    .platform-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

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

    .platform-title {
        font-size: 3.1rem;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .platform-header {
        min-height: 56px;
        padding-block: 6px;
    }

    .platform-hero {
        min-height: 280px;
    }

    .platform-hero-content {
        padding-block: 28px;
    }

    .platform-title {
        font-size: 2.5rem;
    }

    .game-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
        overflow-x: auto;
    }
}
