* {
    font-family: -apple-system, "SF Pro Display", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
}

html, body {
    background-color: #0b0b12;
    overflow: hidden;
}

html, body, canvas {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

canvas {
    background: transparent;
}

div {
    -webkit-user-select: none; /* webkit (safari, chrome) browsers */
    -moz-user-select: none; /* mozilla browsers */
    -khtml-user-select: none; /* webkit (konqueror) browsers */
    -ms-user-select: none; /* IE10+ */
}

#split {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#feed {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#status {
    position: absolute;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: #FFF;
    font-size: 16.1px;
    top: 10px;
    right: 10px;
    font-weight: bold;
    text-align: center;
}

#status .title {
    font-size: 25px;
}

#status .me {
    color: #FF8888;
    font-size: 16.1px;
}

#status .lb-value {
    color: #33e07a;
}

.chatbox {
    position: absolute;
    width: 300px;
    height: 320px;
    background: rgba(22, 22, 22, 0.7);
    bottom: 5px;
    left: 5px;
    border-radius: 5px;
    pointer-events: none;
}

.chatbox .chat-list {
    padding: 5px;
    margin: 0;
    list-style: none;
    box-sizing: border-box;
    height: 285px;
    overflow: hidden;
}

.chatbox .chat-list li {
    padding: 2px;
    margin: 3px;
}

.chatbox .chat-list li.me b {
    color: #ea6153;
}

.chatbox .chat-list li.friend b {
    color: #6c5ce7;
}

.chatbox .chat-list li.system {
    color: #9b59b6;
    font-style: italic;
}

.chatbox .chat-list li.system:before {
    content: "» ";
}

.chatbox .chat-input {
    pointer-events: all;
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: none;
    border-top: 1px solid #DDD;
    outline: none;
}

#startMenu {
    position: relative;
    margin: auto;
    margin-top: 100px;
    width: 350px;
    padding: 20px;
    border-radius: 12px;
    -moz-border-radius: 12px;
    -webkit-border-radius: 12px;
    background-color: #1c1c28;
    color: #e8e8f0;
    border: 1px solid #2c2c40;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

/* ---- Entry menu redesign ---- */
#startMenu {
    position: relative;
    z-index: 3;
    width: 440px;
    max-width: 100%;
    margin: 0;
    max-height: none;
    padding: 26px 26px 22px;
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Step 2 (lobby choice) fades/slides in over step 1 (identity), which Play
   hides via the `hidden` attribute. */
#stepTier {
    animation: stepIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.tier-back {
    display: inline-flex;
    align-items: center;
    height: 28px;
    margin-bottom: 10px;
    padding: 0 10px 0 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9a9ac0;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.tier-back:hover { background: #1e1e2e; color: #fff; }

.brand {
    text-align: center;
    margin-bottom: 20px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #8f7bff 0%, #6c5ce7 45%, #4a37c0 100%);
    box-shadow: 0 0 0 6px rgba(108, 92, 231, 0.15), 0 6px 20px rgba(108, 92, 231, 0.45);
}

.brand h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #f4f4fb;
}

.brand .tagline {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #8a8aa8;
    letter-spacing: 0.1px;
}

/* Wallet buttons live in the top bar now — compact pill style */
.wallet-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 18px 0 10px;
    border: 1px solid #34344c;
    border-radius: 999px;
    background: #1a1a29;
    color: #d6d6ea;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.wallet-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex: 0 0 22px;
}

.wallet-btn:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.wallet-btn:active { transform: translateY(0); }

/* Deliberately NOT the filled-gradient treatment: Play is the one loud call
   to action on this screen. A filled "Connect Wallet" pill of the same
   weight competed with it for attention, so this stays an outline/ghost
   button — present, legible, but visually secondary. */
.wallet-btn.connect {
    padding: 0 20px;
    background: rgba(125, 111, 240, 0.08);
    border-color: rgba(125, 111, 240, 0.5);
    color: #cdc4ff;
    box-shadow: none;
}

.wallet-btn.connect:hover {
    background: rgba(125, 111, 240, 0.16);
    border-color: #8f7bff;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.25);
}

.wallet-menu {
    position: relative;
}

.wallet-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    min-width: 172px;
    border: 1px solid #34344c;
    border-radius: 14px;
    background: #17172a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    animation: menuIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wallet-options[hidden] { display: none; }

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

.wallet-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #d6d6ea;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.wallet-option:hover { background: #232338; color: #fff; }
.wallet-option .wallet-icon { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px; }

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    /* #71718f measured ~3.6:1 on this background, below the 4.5:1 AA floor
       for 11px text. #9a9ac0 clears ~6.2:1. */
    color: #9a9ac0;
    margin: 4px 2px 10px;
}

/* ---- Lobby tiers ---- */
.tiers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.tier {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 13px 4px 11px;
    border: 1px solid #26263a;
    border-radius: 12px;
    background: #131320;
    color: #e8e8f0;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s, background 0.15s;
}

.tier:hover { border-color: #45455f; transform: translateY(-1px); }

.tier.selected {
    border-color: #7d6ff0;
    background: linear-gradient(160deg, #26214a, #191830);
    box-shadow: 0 0 0 1px rgba(125, 111, 240, 0.7), 0 8px 20px rgba(108, 92, 231, 0.28);
}

.tier.selected::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8f7bff;
    box-shadow: 0 0 6px #8f7bff;
}

.tier-price { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.2; }
.tier-sub { font-size: 10px; font-weight: 600; color: #77779a; text-transform: uppercase; letter-spacing: 0.7px; }
.tier.selected .tier-sub { color: #a79dff; }

.tier-note {
    font-size: 11.5px;
    color: #9a9ac0;
    text-align: center;
    margin-bottom: 18px;
    min-height: 15px;
}

.tier-note.paid { color: #ffcf6b; }

/* ---- Skin picker ---- */
.skin-picker {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

#blobPreview {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 14px;
    background: #0e0e18;
    border: 1px solid #24243a;
}

.skin-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.skin-group { display: flex; flex-direction: column; gap: 8px; }

.skin-label {
    font-size: 10px;
    font-weight: 700;
    color: #84849f;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* One row: preset swatches, then a native color-wheel swatch, then a hex
   field — three ways to land on the same color, same visual language
   (circles), instead of stacking mismatched grids. */
.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.swatches {
    display: flex;
    gap: 8px;
}

.swatch {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.12s;
}

.swatch:hover { transform: scale(1.15); }
.swatch.selected { border-color: #0e0e18; box-shadow: 0 0 0 2px #8f7bff; }

.custom-color-swatch {
    position: relative;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    cursor: pointer;
    /* Conic gradient reads as "pick any color" (a mini color wheel) at a
       glance, distinct from the flat preset swatches next to it. */
    background: conic-gradient(from 0deg, red, yellow, lime, cyan, blue, magenta, red);
    box-shadow: 0 0 0 2px #1c1c28, 0 0 0 3px #34344c;
    transition: box-shadow 0.12s;
}

/* The wheel icon itself never changes appearance (it's not a preview of the
   picked color, just the "pick any color" affordance) — this ring is the
   only cue that a custom color is the currently active one, same visual
   language as .swatch.selected. */
.custom-color-swatch.selected {
    box-shadow: 0 0 0 2px #1c1c28, 0 0 0 4px #8f7bff;
}

.custom-color-swatch input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

.secondary-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#playerNameInput {
    width: 100%;
    text-align: center;
    padding: 10px;
    color: #e8e8f0;
    background-color: #12121c;
    border: solid 1px #2c2c40;
    transition: box-shadow 0.3s, border 0.3s;
    box-sizing: border-box;
    border-radius: 8px;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
    margin-bottom: 10px;
    outline: none;
}

#playerNameInput:focus, #playerNameInput.focus {
    border: solid 1px #6c5ce7;
    box-shadow: 0 0 6px 1px rgba(108, 92, 231, 0.5);
}

#startButton {
    position: relative;
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    box-sizing: border-box;
    font-size: 17px;
    font-weight: 700;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, #7d6ff0 0%, #6c5ce7 100%);
    border: 0;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(108, 92, 231, 0.4), inset 0 -2px #5546c4;
    border-radius: 12px;
}

#startButton:active, #startButton:hover {
    background: linear-gradient(180deg, #8a7cff 0%, #7565ee 100%);
    outline: none;
}

#startButton:active { transform: translateY(1px); }

/* Join Lobby: the actual "enter the game" action in step 2. Same visual
   weight as Play since exactly one of them is ever visible at a time. */
#joinButton {
    position: relative;
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    box-sizing: border-box;
    font-size: 17px;
    font-weight: 700;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, #7d6ff0 0%, #6c5ce7 100%);
    border: 0;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(108, 92, 231, 0.4), inset 0 -2px #5546c4;
    border-radius: 12px;
}

#joinButton:active, #joinButton:hover {
    background: linear-gradient(180deg, #8a7cff 0%, #7565ee 100%);
    outline: none;
}

#joinButton:active { transform: translateY(1px); }

#joinButton.confirming {
    font-size: 15px;
    background: linear-gradient(180deg, #ffcf6b 0%, #f0a93e 100%);
    box-shadow: 0 8px 22px rgba(240, 169, 62, 0.45), inset 0 -2px #c77f1f;
    color: #241a05;
    text-shadow: none;
    animation: confirmPulse 1.1s ease-in-out infinite;
}

#joinButton.confirming:hover {
    background: linear-gradient(180deg, #ffd985 0%, #f5b455 100%);
}

@keyframes confirmPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.015); }
}

#spectateButton, #settingsButton {
    position: relative;
    flex: 1;
    height: 40px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 600;
    color: #c9c9e0;
    text-align: center;
    background: #17172250;
    border: 1px solid #2c2c40;
    cursor: pointer;
    border-radius: 10px;
}

#spectateButton:active, #spectateButton:hover,
#settingsButton:active, #settingsButton:hover {
    background: #1e1e2e;
    border-color: #4a4a6a;
    color: #fff;
    outline: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}

#settings {
    -webkit-transition: max-height 1s;
    -moz-transition: max-height 1s;
    -ms-transition: max-height 1s;
    -o-transition: max-height 1s;
    transition: max-height 1s;
    overflow: hidden;
}

#settings {
    max-height: 0;
}

#startMenu h3 {
    padding-bottom: 0;
    margin: 4px 2px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #9a9ac0;
}

#startMenu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#startMenu .input-error {
    color: red;
    opacity: 0;
    font-size : 12px;
}

#startMenuWrapper {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px;
    box-sizing: border-box;
    background:
        radial-gradient(1100px 560px at 50% -12%, rgba(50, 40, 104, 0.55) 0%, rgba(42, 34, 88, 0) 62%),
        radial-gradient(820px 460px at 12% 112%, rgba(18, 32, 58, 0.6) 0%, rgba(20, 36, 63, 0) 55%),
        radial-gradient(700px 500px at 88% 8%, rgba(90, 40, 120, 0.28) 0%, rgba(90, 40, 120, 0) 60%),
        linear-gradient(160deg, #060609 0%, #050508 100%);
    transition: opacity 0.45s ease;
}

/* Live self-playing lobby simulation, painted full-viewport behind the card.
   Kept slightly dimmed so it reads as ambient background, not foreground. */
#fxCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#startMenuWrapper.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Soft animated glow behind the card */
#bgGlow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 620px;
    height: 620px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(108, 92, 231, 0.22) 0%, rgba(108, 92, 231, 0) 68%);
    filter: blur(10px);
    pointer-events: none;
    animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

/* Top bar: logo left, wallet right */
#topBar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 4;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #ececf6;
}

.topbar-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #8f7bff, #6c5ce7 60%, #4a37c0);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.7);
}

#walletBar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 12px;
    border: 1px solid #2c2c40;
    border-radius: 999px;
    background: rgba(20, 20, 32, 0.8);
    color: #cfeadd;
    font-size: 13px;
    font-weight: 600;
}

.wallet-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #46d98a;
    box-shadow: 0 0 8px #46d98a;
}

.wallet-chip button {
    background: transparent;
    border: none;
    color: #7a7a98;
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.wallet-chip .wallet-balance {
    padding-left: 8px;
    margin-left: 2px;
    border-left: 1px solid #2c2c40;
    color: #9ad9bd;
    font-variant-numeric: tabular-nums;
}
.wallet-chip .wallet-balance:empty { display: none; }

.wallet-chip .wallet-withdraw {
    color: #cfeadd;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border: 1px solid #2c2c40;
    border-radius: 999px;
}
.wallet-chip .wallet-withdraw:hover { color: #46d98a; border-color: #46d98a; }
.wallet-chip .wallet-withdraw:disabled { opacity: 0.5; cursor: default; }

.wallet-chip button:hover { color: #ff6b6b; }

.wallet-msg {
    position: fixed;
    top: 62px;
    right: 20px;
    z-index: 4;
    font-size: 12.5px;
    color: #9a9ab8;
    max-width: 280px;
    text-align: right;
}

.wallet-msg.error { color: #ff6b6b; }

#gameAreaWrapper {
    position: absolute !important;
    top: 0;
    left: 0;
    opacity: 0;
}

@media only screen  and (min-width : 1224px) {
#mobile {
display: none;
	}
}

@media only screen  and (max-width : 1224px) {
#chatbox {
display: none;
        }
}

input[type="image"]:focus {
    border: none;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid #8a7cff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ================= Menu footer links ================= */
#menuFooter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #1c1c2e;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9a9ac0;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.14s, background 0.14s, transform 0.14s;
}

.footer-link:hover { color: #fff; background: #17172a; transform: translateY(-1px); }
.footer-link .fl-ico { font-size: 13px; }
.footer-sep { width: 1px; height: 16px; background: #26263a; }

/* ================= Modals ================= */
body.modal-open { overflow: hidden; }

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(4, 4, 9, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: overlayIn 0.18s ease both;
}

.modal-overlay[hidden] { display: none; }

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    position: relative;
    width: 440px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 26px 22px;
    border-radius: 18px;
    background: linear-gradient(180deg, #17172a 0%, #121220 100%);
    border: 1px solid #2c2c44;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: #e8e8f0;
    animation: modalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-wide { width: 620px; }

@keyframes modalPop {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: #1e1e30;
    color: #9a9ac0;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.modal-close:hover { background: #2a2a42; color: #fff; }

.modal-head { text-align: center; margin-bottom: 20px; }
.modal-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #f4f4fb;
}
.modal-sub {
    margin: 7px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #8a8aa8;
    line-height: 1.5;
}

.modal-actions { margin-top: 22px; }

.modal-primary {
    display: block;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #7d6ff0 0%, #6c5ce7 100%);
    box-shadow: 0 8px 22px rgba(108, 92, 231, 0.4), inset 0 -2px #5546c4;
    transition: background 0.14s, transform 0.1s;
}
.modal-primary:hover { background: linear-gradient(180deg, #8a7cff 0%, #7565ee 100%); }
.modal-primary:active { transform: translateY(1px); }

/* ---- How to Play: game-manual layout (progression band + size rule + keys) ---- */
.guide { display: flex; flex-direction: column; gap: 22px; }

/* Numbered section header, shared by every guide block for a top-to-bottom read */
.gsec { display: flex; flex-direction: column; gap: 10px; }
.gsec-head { display: flex; align-items: center; gap: 9px; }
.gsec-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; flex: 0 0 20px;
    border-radius: 6px;
    background: rgba(143, 123, 255, 0.16);
    color: #a99bff;
    font-size: 11px; font-weight: 800;
}
.gsec-head h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #c9c9e4;
}

/* shared blob colors for the inline SVGs */
.blob { stroke-width: 2.5; }
.you    { fill: #6c5ce7; stroke: #a99bff; }
.prey   { fill: #46d98a; stroke: #93f0c1; }
.threat { fill: #ff5f6d; stroke: #ff9aa2; }
.you.win { fill: #ffb347; stroke: #ffd591; }
.dot { fill: #cfe9ff; animation: dotPulse 1.7s ease-in-out infinite; }
.dot:nth-of-type(2) { animation-delay: 0.3s; }
.dot:nth-of-type(3) { animation-delay: 0.6s; }
@keyframes dotPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.arrow-good { stroke: #46d98a; stroke-width: 3.5; fill: none; }
.arrow-bad  { stroke: #ff5f6d; stroke-width: 3.5; fill: none; stroke-dasharray: 6 4; }

/* 1. Core-loop progression band */
.loop-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 16px 12px;
    border-radius: 16px;
    background:
        radial-gradient(360px 120px at 100% 50%, rgba(255, 179, 71, 0.1), rgba(255, 179, 71, 0) 70%),
        radial-gradient(340px 140px at 0% 50%, rgba(108, 92, 231, 0.14), rgba(108, 92, 231, 0) 70%),
        #0e0e1a;
    border: 1px solid #22223a;
}
.loop-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.lsvg { width: 56px; height: 56px; overflow: visible; }
.lsvg .blob { filter: drop-shadow(0 0 7px rgba(108, 92, 231, 0.5)); animation: stagePulse 2.4s ease-in-out infinite; }
.lsvg .you.win { filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.65)); }
@keyframes stagePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.loop-cap { font-size: 11px; font-weight: 700; color: #b6b6d0; white-space: nowrap; }
.loop-cap.win { color: #ffca7a; }
.loop-chev { color: #43436a; font-size: 22px; font-weight: 400; flex: 0 0 auto; margin-top: -14px; }

/* 2. The size rule: two stacked outcome rows (no VS divider) */
.rule-rows { display: flex; flex-direction: column; gap: 10px; }
.rule-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid #22223a;
}
.rule-row.good { background: linear-gradient(90deg, rgba(70, 217, 138, 0.09), rgba(70, 217, 138, 0.02) 60%); }
.rule-row.bad  { background: linear-gradient(90deg, rgba(255, 95, 109, 0.09), rgba(255, 95, 109, 0.02) 60%); }
.rrsvg { width: 116px; height: 44px; flex: 0 0 116px; overflow: visible; }
.rrsvg .blob { filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.35)); }
.rule-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rule-copy p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #b0b0cc; }

.guide-badge {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}
.guide-badge.good { background: rgba(70, 217, 138, 0.16); color: #57e39a; }
.guide-badge.bad  { background: rgba(255, 95, 109, 0.16); color: #ff7c88; }
.guide-badge.win  { background: rgba(255, 179, 71, 0.18); color: #ffc06a; }

/* 3. Cash out block */
.cashout-block {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background:
        radial-gradient(300px 120px at 12% 50%, rgba(255, 179, 71, 0.12), rgba(255, 179, 71, 0) 70%),
        #0e0e1a;
    border: 1px solid #2c2740;
}
.cashout-beacon { position: relative; flex: 0 0 72px; width: 72px; height: 72px; }
.cosvg { width: 72px; height: 72px; transform: rotate(-90deg); }
.cosvg .co-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 4; }
.cosvg .co-arc {
    fill: none; stroke: #ffb347; stroke-width: 4; stroke-linecap: round;
    stroke-dasharray: 176; stroke-dashoffset: 176;
    filter: drop-shadow(0 0 5px rgba(255, 179, 71, 0.7));
    animation: coFill 8s linear infinite;
}
@keyframes coFill { 0% { stroke-dashoffset: 176; } 90%, 100% { stroke-dashoffset: 0; } }
.cosvg .you.win { filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.6)); transform-origin: 36px 36px; }
.cashout-timer {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #241a05;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.25);
    pointer-events: none;
}
.cashout-txt p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #b6b6d0; }
.cashout-txt b { color: #ffd591; font-weight: 700; }

/* 4. Controls: physical keycap legend */
.controls {
    display: flex;
    justify-content: flex-start;
    gap: 12px 22px;
    flex-wrap: wrap;
    padding-top: 2px;
}
.ctrl { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #a6a6c4; font-weight: 600; }
.keycap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a2a40 0%, #1d1d30 100%);
    border: 1px solid #3a3a56;
    box-shadow: 0 2px 0 #14141f, inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #e8e8f5;
    font-size: 12px;
    font-weight: 700;
}
.keycap.wide { min-width: 52px; }
.keycap.win { background: linear-gradient(180deg, #4a3a1a 0%, #362a12 100%); border-color: #6a5220; color: #ffca7a; box-shadow: 0 2px 0 #1a1408, inset 0 1px 0 rgba(255, 210, 120, 0.15); }

/* ---- Mode selector: tall illustrated cards, FFA live + rest coming soon ---- */
.mode-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}

.mode-card {
    --art: #4a4a6a;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 132px;
    padding: 14px 6px 12px;
    border: 1px solid #22223a;
    border-radius: 16px;
    background: #10101c;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.mode-art { display: flex; align-items: center; justify-content: center; flex: 1; width: 100%; }
.mode-art svg { width: 66px; height: 66px; }
.mode-art circle { fill: var(--art); }
.mode-art path { fill: var(--art); }
.mode-art .blade { stroke: var(--art); stroke-width: 9; stroke-linecap: round; }
.mode-art .ring  { fill: none; stroke: var(--art); stroke-width: 3.5; stroke-dasharray: 7 8; opacity: 0.75; }
.mode-art .ring2 { fill: none; stroke: var(--art); stroke-width: 4; }

.mode-name {
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.2px;
    color: #d6d6ea;
    text-align: center;
}

/* FFA — the one live, loud card. Keeps id #startButton for existing JS wiring. */
#startButton.mode-card {
    width: auto;
    height: 132px;
    margin-top: 0;
}
#startButton.mode-card.ffa {
    --art: #ffffff;
    border-color: transparent;
    background: linear-gradient(165deg, #8a7cff 0%, #6c5ce7 52%, #5546c4 100%);
    box-shadow: 0 10px 26px rgba(108, 92, 231, 0.42);
}
#startButton.mode-card.ffa .mode-name { color: #fff; }
#startButton.mode-card.ffa:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(108, 92, 231, 0.5); }
#startButton.mode-card.ffa:active { transform: translateY(0); }

/* Battle Royale — live, cyan accent echoing the safe-zone ring. */
.mode-card.br {
    --art: #5ac8ff;
    border-color: #22405a;
    background: linear-gradient(165deg, #14202e 0%, #0e1622 100%);
}
.mode-card.br .mode-name { color: #cdeaff; }
.mode-card.br:hover { transform: translateY(-2px); border-color: #5ac8ff; box-shadow: 0 12px 28px rgba(90, 200, 255, 0.28); }
.mode-card.br:active { transform: translateY(0); }

/* Coming-soon cards: muted, non-interactive, with a corner tag */
.mode-card.soon {
    --art: #3a3a55;
    cursor: not-allowed;
    background: #0e0e18;
}
.mode-card.soon .mode-name { color: #7a7a9a; }
.mode-soon {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #8f86cc;
    background: rgba(143, 123, 255, 0.12);
    border: 1px solid rgba(143, 123, 255, 0.22);
}
/* Disabled cards: no hover lift/glow, no clicks, dimmed. */
.mode-card.soon,
.mode-card[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}
.mode-card.soon:hover,
.mode-card[disabled]:hover {
    transform: none;
    border-color: #22405a;
    box-shadow: none;
}

/* ---- Fair Play & Terms ---- */
.terms-warning {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(255, 95, 109, 0.08);
    border: 1px solid rgba(255, 95, 109, 0.35);
    font-size: 12.5px;
    line-height: 1.55;
    color: #e6cdd0;
}
.terms-warning .tw-ico { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
.terms-warning strong { color: #ff9099; display: block; margin-bottom: 2px; }
.terms-warning b { color: #ffd4d8; }

.terms-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.terms-list li { font-size: 12.5px; line-height: 1.5; color: #a6a6c4; }

.terms-fine {
    margin: 16px 0 0;
    font-size: 11.5px;
    color: #78789a;
    text-align: center;
    font-style: italic;
}

@media (max-width: 560px) {
    .guide-grid { grid-template-columns: 1fr; }
    .modal-wide { width: 440px; }
}
