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

.betaNotice {
  width: 100%;
  height: 22px;
  line-height: 22px;
  background: rgba(79, 142, 247, 0.13);
  color: rgba(180, 210, 255, 0.75);
  border-bottom: 1px solid rgba(79, 142, 247, 0.2);
  padding: 0 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  font-family: "Space Grotesk", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
.betaNoticeLink {
  color: rgba(122, 167, 255, 0.9);
  text-decoration: underline;
}
.betaNoticeLink:hover {
  color: rgba(180, 210, 255, 1);
}

:root {
    --bg:           #070b14;
    --nav-bg:       rgba(7,11,20,0.82);
    --surface:      rgba(255,255,255,0.042);
    --surface-h:    rgba(255,255,255,0.07);
    --border:       rgba(255,255,255,0.075);
    --border-h:     rgba(255,255,255,0.18);
    --text:         #dde3f5;
    --muted:        #58698e;
    --dice:         #4f8ef7;
    --dice-glow:    rgba(79,142,247,0.2);
    --madn:         #9b6ef3;
    --madn-glow:    rgba(155,110,243,0.2);
    --sudoku:       #e8a23a;
    --swim:         #e05252;
    --swim-glow:    rgba(224,82,82,0.2);
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background */
.bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
}
.bg-orb-1 {
    width: 700px; height: 700px;
    top: -200px; left: -200px;
    background: radial-gradient(circle, rgba(79,142,247,0.09) 0%, transparent 65%);
}
.bg-orb-2 {
    width: 600px; height: 600px;
    bottom: -180px; right: -180px;
    background: radial-gradient(circle, rgba(155,110,243,0.09) 0%, transparent 65%);
}

/* Nav */
nav {
    position: sticky; top: 0; z-index: 100;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex; align-items: center; gap: 0.55rem;
    text-decoration: none; color: var(--text);
}
.nav-logo-icon { font-size: 1.2rem; line-height: 1; }
.nav-logo-name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.1rem; font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
}

.nav-right { display: flex; align-items: center; }

.discord-login-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.42rem 0.95rem;
    border-radius: 100px;
    background: #5865F2; color: #fff;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.8rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    white-space: nowrap;
}
.discord-login-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.discord-profile {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.28rem 0.65rem 0.28rem 0.28rem;
    border-radius: 100px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.8rem; font-weight: 500; color: var(--text);
    cursor: default;
    transition: border-color 0.18s;
}
.discord-profile img {
    width: 24px; height: 24px;
    border-radius: 50%; object-fit: cover;
}
.profile-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-logout-btn {
    font-size: 0.7rem; color: var(--muted);
    background: none; border: none; cursor: pointer;
    padding: 0 0 0 0.15rem;
    font-family: inherit;
    transition: color 0.15s;
}
.discord-logout-btn:hover { color: var(--text); }

/* Main */
main {
    position: relative; z-index: 1;
    max-width: 1060px; margin: 0 auto;
    padding: 4.5rem 1.5rem 5rem;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3.75rem;
}

.status-pill {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.28rem 0.75rem;
    border-radius: 100px;
    background: rgba(61,220,132,0.07);
    border: 1px solid rgba(61,220,132,0.18);
    font-size: 10.5px; font-weight: 600;
    color: rgba(61,220,132,0.82);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.status-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #3ddc84;
    box-shadow: 0 0 6px rgba(61,220,132,0.9);
}

.hero h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.03em;
    text-wrap: balance;
    margin-bottom: 1.1rem;
    background: linear-gradient(140deg, #dde3f5 25%, #7c9ef5 65%, #9b6ef3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 0.975rem; color: var(--muted);
    line-height: 1.7; max-width: 380px; margin: 0 auto;
}

/* Grid */
.games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(295px, 1fr));
    gap: 1.1rem;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.card:not(.sudoku):hover { transform: translateY(-4px); }
.card.dice:hover  { border-color: rgba(79,142,247,0.45);  box-shadow: 0 12px 48px var(--dice-glow); }
.card.madn:hover  { border-color: rgba(155,110,243,0.45); box-shadow: 0 12px 48px var(--madn-glow); }
.card.sudoku      { opacity: 0.45; cursor: default; pointer-events: none; }
.card.swim:hover  { border-color: rgba(224,82,82,0.45);  box-shadow: 0 12px 48px var(--swim-glow); }

/* Preview area */
.card-preview {
    height: 116px;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; flex-shrink: 0;
}
.card.dice .card-preview   { background: linear-gradient(155deg, #091226 0%, #0b1d40 100%); }
.card.madn .card-preview   { background: linear-gradient(155deg, #0d0820 0%, #170f35 100%); }
.card.sudoku .card-preview { background: linear-gradient(155deg, #140e05 0%, #1c1306 100%); }
.card.swim .card-preview   { background: linear-gradient(155deg, #1a0808 0%, #2d0f0f 100%); }

/* Subtle grid overlay on preview */
.card-preview::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Dice visual */
.dice-vis { position: relative; width: 128px; height: 68px; }
.die {
    position: absolute;
    font-size: 2.1rem; line-height: 1;
    filter: drop-shadow(0 2px 10px rgba(79,142,247,0.45));
    user-select: none;
}
.die:nth-child(1) { left: 4px;  top: 14px; transform: rotate(-14deg); font-size: 2.3rem; }
.die:nth-child(2) { left: 44px; top: 6px;  transform: rotate(4deg);   opacity: 0.75; }
.die:nth-child(3) { left: 83px; top: 16px; transform: rotate(20deg);  opacity: 0.5; font-size: 1.85rem; }

/* MADN pawn visual */
.madn-vis { display: flex; align-items: flex-end; gap: 9px; padding-bottom: 4px; }
.pawn {
    width: 20px;
    border-radius: 50% 50% 28% 28% / 55% 55% 45% 45%;
    position: relative;
    flex-shrink: 0;
}
.pawn::after {
    content: '';
    position: absolute;
    width: 13px; height: 13px;
    border-radius: 50%;
    top: -7px; left: 50%; transform: translateX(-50%);
    background: inherit;
    filter: brightness(1.25);
}
.pawn-r { height: 32px; background: #d95555; box-shadow: 0 0 14px rgba(217,85,85,0.55); }
.pawn-b { height: 38px; background: var(--dice); box-shadow: 0 0 14px var(--dice-glow); }
.pawn-g { height: 30px; background: #3ddc84; box-shadow: 0 0 14px rgba(61,220,132,0.45); }
.pawn-y { height: 34px; background: #e8c23a; box-shadow: 0 0 14px rgba(232,194,58,0.45); }

/* Sudoku visual */
.sudoku-vis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 80px;
}
.sc {
    width: 18px; height: 18px;
    border-radius: 3px;
    background: rgba(232,162,58,0.06);
    border: 1px solid rgba(232,162,58,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 600;
    color: rgba(232,162,58,0.35);
    font-variant-numeric: tabular-nums;
}
.sc.f { background: rgba(232,162,58,0.13); color: rgba(232,162,58,0.75); }

/* Card body */
.card-body {
    padding: 1.35rem 1.5rem 1.5rem;
    display: flex; flex-direction: column; gap: 0.8rem;
    flex: 1;
}

.card-top {
    display: flex; align-items: center; justify-content: space-between;
}
.card-title {
    font-size: 1.15rem; font-weight: 700;
    letter-spacing: -0.01em; color: var(--text);
}
.card-badge {
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 100px;
    white-space: nowrap;
}
.card.dice  .card-badge  { background: rgba(79,142,247,0.1);  border: 1px solid rgba(79,142,247,0.25);  color: #7ab0fa; }
.card.madn  .card-badge  { background: rgba(155,110,243,0.1); border: 1px solid rgba(155,110,243,0.25); color: #b48ef5; }
.card.sudoku .card-badge { background: rgba(232,162,58,0.1);  border: 1px solid rgba(232,162,58,0.25);  color: var(--sudoku); }
.card.swim  .card-badge  { background: rgba(224,82,82,0.1);   border: 1px solid rgba(224,82,82,0.25);   color: #f07878; }

.card-desc {
    font-size: 0.84rem; color: var(--muted); line-height: 1.65;
}

.card-tags {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.tag {
    font-size: 11px; font-weight: 500;
    padding: 3px 9px; border-radius: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.cta {
    font-size: 0.84rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.4rem;
}
.card.dice  .cta { color: var(--dice); }
.card.madn  .cta { color: var(--madn); }
.card.sudoku .cta { color: var(--muted); }
.card.swim  .cta { color: var(--swim); }

/* Swim card visual */
.swim-vis { display: flex; align-items: center; gap: 10px; }
.swim-mini {
    width: 38px; height: 54px; background: #fff; border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; font-size: 0.72rem; font-weight: 800;
    line-height: 1.2; padding: 3px;
}
.swim-mini.red { color: #cc2222; }
.swim-mini.black { color: #111; }
.swim-mini:nth-child(1) { transform: rotate(-12deg) translateY(6px); }
.swim-mini:nth-child(3) { transform: rotate(10deg) translateY(5px); }

.cta-arrow {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid currentColor; opacity: 0.5;
    font-size: 0.75rem;
    transition: transform 0.18s, opacity 0.18s;
}
.card:not(.sudoku):hover .cta-arrow { transform: translateX(4px); opacity: 0.9; }

/* Footer */
footer {
    position: relative; z-index: 1;
    text-align: center;
    padding: 1rem 1.5rem 2.5rem;
    font-size: 0.76rem; color: rgba(221,227,245,0.2);
}
footer a { color: inherit; text-decoration: none; transition: color 0.15s; }
footer a:hover { color: rgba(221,227,245,0.45); }

/* Entrance */
@keyframes up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero            { animation: up 0.45s ease both; }
.discord-section { animation: up 0.45s 0.08s ease both; }
.games           { animation: up 0.45s 0.16s ease both; }

@media (prefers-reduced-motion: reduce) {
    .hero, .discord-section, .games { animation: none; }
}

@media (max-width: 520px) {
    main { padding: 3rem 1rem 4rem; }
    nav  { padding: 0 1rem; }
    .games { grid-template-columns: 1fr; }
}

/* Discord Section */
.discord-section { margin-top: 1.5rem; }

.discord-connect-card,
.discord-connected-card {
    background: rgba(88,101,242,0.08);
    border: 1px solid rgba(88,101,242,0.22);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.discord-connect-left {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex: 1;
}

.discord-icon-wrap {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(88,101,242,0.18);
    border: 1px solid rgba(88,101,242,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: #7289da;
    flex-shrink: 0;
}

.discord-connect-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem; font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.discord-connect-sub {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 0.8rem;
    max-width: 380px;
}

.discord-benefits {
    list-style: none;
    display: flex; flex-direction: column; gap: 0.25rem;
}

.discord-benefits li {
    font-size: 0.82rem;
    color: rgba(221,227,245,0.65);
    display: flex; align-items: center; gap: 0.5rem;
}

.benefit-check {
    color: #5865F2;
    font-weight: 700;
}

.discord-connect-right {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.6rem;
    flex-shrink: 0;
}

.discord-cta-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    background: #5865F2; color: #fff;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.92rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    white-space: nowrap;
}
.discord-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.discord-hint {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.discord-connected-left {
    display: flex; align-items: center; gap: 1rem;
}

.discord-section-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
}

.discord-connected-label {
    font-size: 0.75rem;
    color: rgba(88,101,242,0.8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.discord-connected-name {
    font-size: 1rem; font-weight: 700;
}

.discord-disconnect-btn {
    padding: 0.45rem 1rem;
    border-radius: 100px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.discord-disconnect-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }

@media (max-width: 600px) {
    .discord-connect-card,
    .discord-connected-card { flex-direction: column; }
    .discord-connect-right { width: 100%; }
    .discord-cta-btn { width: 100%; justify-content: center; }
}