:root {
    color-scheme: dark;
    --bg: #05070d;
    --panel: #0b0e17;
    --card: #111522;
    --muted: #a5a7b3;
    --purple: #8b5cff;
    --hot: #b65cff;
    --line: rgba(255, 255, 255, .10);
    --shadow: 0 32px 90px rgba(0, 0, 0, .42);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: #fff;
    background:
        radial-gradient(circle at 72% 28%, rgba(139, 92, 255, .22), transparent 34%),
        radial-gradient(circle at 16% 18%, rgba(76, 45, 180, .18), transparent 30%),
        linear-gradient(180deg, #070911 0%, var(--bg) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .24;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at 50% 42%, #000, transparent 72%);
}

button, input { font: inherit; }

.tgh-shell {
    position: relative;
    min-height: calc(100dvh - 42px);
    margin: 21px;
    padding: 26px 34px;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 20%, rgba(139, 92, 255, .17), transparent 35%),
        linear-gradient(145deg, rgba(12, 15, 25, .98), rgba(5, 7, 13, .98));
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
}

.tgh-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, transparent 0 36%, rgba(255,255,255,.035) 38%, transparent 44%),
        radial-gradient(circle at 90% 88%, rgba(182, 92, 255, .16), transparent 30%);
}

.tgh-header, .tgh-actions, .tgh-brand, .tgh-user, .tgh-stats, .tgh-section-head, .tgh-mission {
    display: flex;
    align-items: center;
}

.tgh-header {
    position: relative;
    z-index: 2;
    justify-content: space-between;
}

.tgh-brand {
    gap: 14px;
    color: #fff;
    text-decoration: none;
}

.tgh-logo {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    background: #fff;
    border-radius: 8px;
}

.tgh-logo span {
    width: 23px;
    height: 23px;
    border: 6px solid #111;
    border-radius: 50%;
}

.tgh-brand strong {
    font-size: 18px;
    font-weight: 820;
}

.tgh-actions {
    gap: 12px;
}

.tgh-round-button, .tgh-user, .tgh-category, .tgh-section-head button, .start-button, .dialog-primary {
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.tgh-round-button {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #fff;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(16px);
}

.tgh-bars {
    width: 18px;
    height: 18px;
    background: linear-gradient(90deg, transparent 0 14%, #fff 14% 27%, transparent 27% 43%, #fff 43% 56%, transparent 56% 72%, #fff 72% 85%, transparent 85%);
}

.tgh-user {
    gap: 10px;
    height: 48px;
    padding: 0 14px 0 8px;
    color: #fff;
    background: transparent;
    border-color: transparent;
    border-radius: 999px;
}

.tgh-user span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #0d0f18;
    background: linear-gradient(135deg, #fff, #a99bff);
    border-radius: 50%;
    font-weight: 900;
}

.tgh-user b { font-size: 14px; }
.tgh-user i { color: var(--muted); font-style: normal; }

.tgh-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(420px, .92fr) minmax(440px, 1fr);
    align-items: center;
    gap: 30px;
    min-height: 430px;
    padding: 28px 46px 18px;
}

.tgh-hero-copy h1 {
    margin: 0;
    font-size: clamp(46px, 5.4vw, 78px);
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -0.08em;
    font-style: italic;
    text-shadow: 0 16px 46px rgba(0,0,0,.45);
}

.tgh-hero-copy em {
    color: transparent;
    background: linear-gradient(135deg, #7d4dff, #d875ff);
    -webkit-background-clip: text;
    background-clip: text;
    font-style: inherit;
}

.tgh-hero-copy p {
    margin: 18px 0 28px;
    color: var(--muted);
    font-size: 18px;
}

.tgh-stats {
    width: min(540px, 100%);
    min-height: 82px;
    padding: 12px 18px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(18px);
}

.tgh-stats div {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    flex: 1;
    padding: 0 20px;
}

.tgh-stats div + div { border-left: 1px solid rgba(255,255,255,.08); }
.tgh-stats i { grid-row: 1 / span 2; display: grid; width: 34px; height: 34px; place-items: center; color: #b65cff; background: rgba(139,92,255,.16); border-radius: 50%; font-style: normal; }
.tgh-stats strong { font-size: 24px; }
.tgh-stats span { color: var(--muted); font-size: 12px; }

.tgh-cassette-hero {
    position: relative;
    min-height: 380px;
}

.tgh-orbit {
    position: absolute;
    inset: 16px 42px;
    border: 1px solid rgba(139,92,255,.32);
    border-radius: 50%;
    transform: rotate(-8deg);
}

.tgh-wave {
    position: absolute;
    left: 2%;
    right: 2%;
    top: 48%;
    height: 96px;
    opacity: .42;
    background: repeating-linear-gradient(90deg, transparent 0 12px, rgba(139,92,255,.85) 12px 15px, transparent 15px 26px);
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    animation: pulseWave 3.6s ease-in-out infinite;
}

.tgh-hero-tape {
    position: absolute;
    right: 6%;
    top: 56px;
    width: min(500px, 90%);
    aspect-ratio: 1.72 / 1;
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.12), rgba(85,72,116,.10)),
        rgba(18, 20, 33, .78);
    border: 1px solid rgba(170, 150, 255, .26);
    border-radius: 18px;
    box-shadow: 0 34px 70px rgba(0,0,0,.48), 0 0 58px rgba(139,92,255,.16), inset 0 1px 0 rgba(255,255,255,.14);
    transform: rotate(8deg);
    animation: floatTape 5s ease-in-out infinite;
}

.tgh-tape-title {
    color: rgba(255,255,255,.45);
    font-size: 34px;
    font-weight: 950;
    font-style: italic;
    letter-spacing: .04em;
    text-align: center;
}

.tgh-tape-window {
    position: absolute;
    left: 95px;
    right: 95px;
    top: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 22px;
    background: rgba(0,0,0,.66);
    border: 2px solid rgba(255,255,255,.12);
    border-radius: 999px;
}

.tgh-tape-window span {
    width: 58px;
    height: 58px;
    background: radial-gradient(circle, transparent 0 34%, rgba(255,255,255,.72) 35% 43%, transparent 44%), conic-gradient(from 0deg, #242736, #bfc2d6, #272a39, #9d8dff, #242736);
    border: 7px solid rgba(255,255,255,.16);
    border-radius: 50%;
}

.tgh-tape-window b {
    position: absolute;
    left: 80px;
    right: 80px;
    height: 45px;
    background: repeating-linear-gradient(90deg, #111 0 5px, #25202f 5px 10px);
    border-radius: 10px;
}

.tgh-tape-line {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 54px;
    height: 12px;
    background: linear-gradient(90deg, transparent, rgba(139,92,255,.8), transparent);
    border-radius: 999px;
}

.tgh-screw {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.28);
    border-radius: 50%;
}

.s1 { left: 14px; top: 14px; } .s2 { right: 14px; top: 14px; } .s3 { left: 14px; bottom: 14px; } .s4 { right: 14px; bottom: 14px; }

.tgh-play-orb {
    position: absolute;
    right: 54px;
    bottom: 24px;
    display: grid;
    width: 94px;
    height: 94px;
    place-items: center;
    color: #fff;
    background: radial-gradient(circle at 35% 25%, rgba(182,92,255,.35), rgba(5,7,13,.92));
    border: 1px solid rgba(182,92,255,.74);
    border-radius: 50%;
    box-shadow: 0 0 34px rgba(139,92,255,.46), inset 0 1px 0 rgba(255,255,255,.16);
    font-style: italic;
    transform: rotate(-8deg);
    cursor: pointer;
}

.tgh-play-orb span { color: #b65cff; font-size: 13px; }
.tgh-play-orb b { margin-top: -16px; font-size: 24px; }

@keyframes floatTape { 0%,100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-12px) rotate(5deg); } }
@keyframes pulseWave { 0%,100% { opacity: .22; transform: scaleX(1); } 50% { opacity: .58; transform: scaleX(1.04); } }

.tgh-category-section {
    position: relative;
    z-index: 2;
}

.tgh-section-head {
    justify-content: space-between;
    margin: 6px 4px 20px;
}

.tgh-section-head h2 {
    margin: 0;
    padding-left: 16px;
    border-left: 4px solid var(--hot);
    font-size: 24px;
}

.tgh-section-head p {
    margin: 8px 0 0 20px;
    color: var(--muted);
}

.tgh-section-head button {
    padding: 12px 20px;
    color: #fff;
    background: rgba(255,255,255,.055);
    border-radius: 999px;
}

.tgh-categories {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.tgh-category {
    position: relative;
    display: grid;
    align-content: center;
    height: 300px;
    overflow: hidden;
    padding: 30px;
    color: #fff;
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    text-align: left;
}

.tgh-category::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--art);
    transition: transform 240ms ease;
}

.tgh-category::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0 42%, rgba(0,0,0,.58) 72%, rgba(12,14,24,.95));
}

.tgh-category:hover,
.tgh-category.is-selected {
    border-color: rgba(139,92,255,.72);
    box-shadow: 0 32px 80px rgba(139,92,255,.22);
    transform: translateY(-6px);
}

.tgh-category:hover::before { transform: scale(1.06); }
.tgh-categories:has(.is-selected) .tgh-category:not(.is-selected) { opacity: .72; }

.tgh-category strong, .tgh-category em, .tgh-category small, .selected-tag {
    position: relative;
    z-index: 1;
}

.tgh-category strong {
    align-self: end;
    font-size: 28px;
    font-weight: 950;
    font-style: italic;
    letter-spacing: -.05em;
    text-shadow: 0 8px 20px rgba(0,0,0,.48);
}

.tgh-category em {
    margin-top: 4px;
    color: #b65cff;
    font-style: normal;
    font-weight: 840;
    letter-spacing: .06em;
}

.tgh-category small {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 0 24px;
    color: rgba(255,255,255,.78);
    background: rgba(13,15,25,.82);
    font-size: 14px;
}

.tgh-category small b {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
    font-size: 24px;
}

.selected-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    display: none;
    padding: 6px 10px;
    color: #fff;
    background: rgba(139,92,255,.72);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.is-selected .selected-tag { display: inline-flex; }

.pop { --art: radial-gradient(circle at 78% 20%, rgba(139,92,255,.65), transparent 36%), linear-gradient(135deg, rgba(38,20,95,.92), rgba(4,7,25,.78)), repeating-linear-gradient(120deg, transparent 0 22px, rgba(255,255,255,.06) 22px 23px); }
.chinese { --art: radial-gradient(circle at 30% 10%, rgba(255,94,61,.65), transparent 35%), linear-gradient(135deg, rgba(93,22,14,.95), rgba(21,7,12,.82)), repeating-linear-gradient(90deg, transparent 0 44px, rgba(255,180,100,.12) 45px 46px); }
.jpop { --art: radial-gradient(circle at 48% 18%, rgba(151,194,255,.82), transparent 28%), linear-gradient(135deg, rgba(25,51,103,.95), rgba(9,14,25,.80)), radial-gradient(circle at 72% 58%, rgba(255,160,202,.55), transparent 32%); }
.kpop { --art: radial-gradient(circle at 70% 30%, rgba(255,65,202,.58), transparent 34%), linear-gradient(135deg, rgba(88,24,109,.94), rgba(11,12,26,.82)), repeating-linear-gradient(110deg, transparent 0 24px, rgba(255,255,255,.06) 24px 25px); }
.mix { --art: radial-gradient(circle at 50% 35%, rgba(255,255,255,.44), transparent 28%), linear-gradient(135deg, rgba(31,31,38,.96), rgba(2,3,8,.9)), conic-gradient(from 20deg, rgba(139,92,255,.36), transparent, rgba(255,255,255,.18), transparent); }

.tgh-mission {
    position: relative;
    z-index: 2;
    gap: 20px;
    margin-top: 18px;
    padding: 16px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
}

.mission-daily, .mission-progress, .mission-reward {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mission-daily { min-width: 220px; }
.mini-tape { width: 48px; height: 36px; background: linear-gradient(135deg, #3b2e68, #151725); border: 1px solid rgba(182,92,255,.34); border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.mission-daily strong, .mission-progress strong { display: block; }
.mission-daily small, .mission-reward span { color: var(--muted); }
.mission-progress { flex: 1; display: grid; gap: 8px; padding: 0 18px; border-left: 1px solid rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.08); }
.mission-progress div { display: flex; align-items: center; gap: 12px; }
.mission-progress span { color: #c79bff; }
.mission-progress b { flex: 1; height: 7px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 999px; }
.mission-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #6b35ff, #b65cff); border-radius: inherit; }
.mission-reward { min-width: 140px; display: grid; gap: 4px; }
.mission-reward strong { color: #b65cff; }

.start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 310px;
    min-height: 58px;
    margin-left: auto;
    color: #fff;
    background: linear-gradient(135deg, #6b35ff, #b65cff);
    border-color: transparent;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(139,92,255,.35);
    font-size: 18px;
    font-weight: 820;
    text-decoration: none;
}

.tgh-round-button:hover, .tgh-user:hover, .start-button:hover, .tgh-section-head button:hover, .tgh-play-orb:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(182,92,255,.56);
    box-shadow: 0 18px 44px rgba(139,92,255,.18);
}

.tgh-dialog {
    width: min(470px, calc(100vw - 36px));
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
}

.tgh-dialog:not([open]) { display: none; }
.tgh-dialog::backdrop { background: rgba(3,5,10,.58); backdrop-filter: blur(20px); }

.dialog-panel {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 28px;
    background: linear-gradient(145deg, rgba(22,25,39,.94), rgba(8,10,18,.94));
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    color: #fff;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
    border-radius: 50%;
}

.dialog-panel p, .dialog-panel h2 { margin: 0; }
.dialog-panel p { color: #b65cff; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.dialog-panel h2 { font-size: 34px; letter-spacing: -.05em; }
.dialog-panel span, .dialog-panel small { color: var(--muted); line-height: 1.7; }
.dialog-panel input { height: 52px; padding: 0 16px; color: #fff; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 14px; outline: 0; }
.dialog-primary { height: 52px; color: #fff; background: linear-gradient(135deg, #6b35ff, #b65cff); border: 0; border-radius: 14px; font-weight: 820; }

.leaderboard-list { display: grid; gap: 10px; }
.leaderboard-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px; background: rgba(255,255,255,.055); border-radius: 14px; }
.leaderboard-row b { display: grid; width: 34px; height: 34px; place-items: center; background: rgba(139,92,255,.18); border-radius: 50%; }
.leaderboard-row span { color: var(--muted); }

.tgh-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 40;
    padding: 12px 16px;
    color: #fff;
    background: rgba(8,10,18,.94);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    box-shadow: 0 18px 48px rgba(0,0,0,.34);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.tgh-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
    .tgh-hero { grid-template-columns: 1fr; padding-inline: 10px; }
    .tgh-cassette-hero { min-height: 330px; }
    .tgh-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tgh-mission { flex-wrap: wrap; }
    .start-button { width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
    .tgh-shell { margin: 0; min-height: 100dvh; padding: 18px; border-radius: 0; }
    .tgh-brand strong { display: none; }
    .tgh-user b, .tgh-user i { display: none; }
    .tgh-hero-copy h1 { font-size: 43px; }
    .tgh-stats { display: grid; gap: 10px; }
    .tgh-stats div, .tgh-stats div + div { border-left: 0; padding: 0; }
    .tgh-hero-tape { right: auto; left: 50%; width: 88vw; transform: translateX(-50%) rotate(6deg); }
    .tgh-play-orb { right: 8px; }
    .tgh-categories { grid-template-columns: 1fr; }
    .tgh-category { height: 210px; }
    .mission-progress { width: 100%; border: 0; padding: 0; }
    .mission-daily, .mission-reward { min-width: calc(50% - 10px); }
}
