/* ---------- launcher screens: game screen (loading -> info) and Create a game ---------- */
.tile .mk { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 8px; font-weight: 700; letter-spacing: .08em; padding: 3px 6px; border-radius: 6px; background: rgba(240,199,94,.95); color: #1a1200; }

.gscreen, .csheet { position: fixed; inset: 0; z-index: 60; color: var(--ink); animation: gin .35s var(--out, ease-out) both; }
.gscreen.out, .csheet.out { animation: gout .26s ease-in both; }
@keyframes gin { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes gout { to { opacity: 0; transform: scale(.98); } }

.gscreen { background: #01040c; overflow: hidden; }
.g-bg { position: absolute; inset: -12%; background-size: cover; background-position: center; filter: blur(34px) saturate(1.3) brightness(.45); transform: scale(1.1); animation: gdrift 18s ease-in-out infinite alternate; }
@keyframes gdrift { from { transform: scale(1.1) translate(-1.5%, -1%); } to { transform: scale(1.18) translate(1.5%, 1%); } }
.gscreen::after { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 35%, rgba(10,40,110,.35), rgba(1,4,12,.92) 75%); pointer-events: none; }
.g-x { position: absolute; z-index: 3; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }

/* loading: the cover lifts in, a ring spins, the title fades up */
.g-load { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; text-align: center; transition: opacity .35s, transform .45s; }
.gscreen.ready .g-load { opacity: 0; transform: translateY(-24px) scale(.96); pointer-events: none; }
.g-cover { width: 168px; height: 168px; border-radius: 26px; overflow: hidden; background: linear-gradient(135deg, #1b4fb8, #0a1f4a); box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 24px 70px rgba(0,0,0,.65), 0 0 60px rgba(60,140,255,.35); animation: glift .7s cubic-bezier(.2,1.3,.4,1) both; }
.g-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes glift { from { opacity: 0; transform: translateY(22px) scale(.82); } to { opacity: 1; transform: none; } }
.g-ltitle { font-size: 28px; font-weight: 300; max-width: 90vw; overflow-wrap: anywhere; animation: glift .6s .15s both; }
.g-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #fff; animation: gspin .8s linear infinite; }
.g-lk { font-size: 12px; letter-spacing: .24em; color: var(--dim); text-transform: uppercase; }
@keyframes gspin { to { transform: rotate(360deg); } }

/* info */
.g-info { position: absolute; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain; padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 16px calc(24px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.g-info > * { animation: gup .5s cubic-bezier(.2,.9,.3,1) both; }
.g-info > *:nth-child(2) { animation-delay: .06s; } .g-info > *:nth-child(3) { animation-delay: .12s; } .g-info > *:nth-child(4) { animation-delay: .18s; }
.g-info > *:nth-child(5) { animation-delay: .24s; } .g-info > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes gup { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.gi-top { display: flex; gap: 16px; align-items: center; }
.gi-cover { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #1b4fb8, #0a1f4a); box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 14px 40px rgba(0,0,0,.6); }
.gi-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gi-head { min-width: 0; }
.gi-head h2 { margin: 4px 0 2px; font-size: 30px; font-weight: 300; line-height: 1.1; overflow-wrap: anywhere; }
.gi-sym { color: var(--dim); font-weight: 600; }
.gi-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.gi-badges span { font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 3px 7px; border-radius: 6px; background: rgba(169,212,255,.18); color: #cfe3ff; }
.gi-badges span:first-child { background: rgba(240,199,94,.9); color: #1a1200; }
.gi-install { margin: 18px 0 6px; }
.gi-it { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.gi-it b { color: #fff; }
.gi-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.gi-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 6px; background: linear-gradient(90deg, #5aa6ff, #fff); animation: gfill 1s cubic-bezier(.2,.9,.3,1) .3s both; transform-origin: left; }
@keyframes gfill { from { transform: scaleX(0); } to { transform: none; } }
.gi-desc { margin: 14px 0; color: #d6e2fb; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.gi-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.gi-stats div { padding: 10px 12px; border-radius: 14px; background: rgba(16,32,70,.7); border: 1px solid var(--line, rgba(160,195,255,.16)); min-width: 0; }
.gi-stats span { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.gi-stats b { display: block; font-size: 17px; margin-top: 2px; overflow-wrap: anywhere; }
.gi-stats a { color: #cfe3ff; }
.gi-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.gi-ca { display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 6px 6px 6px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(160,195,255,.16); min-width: 0; }
.gi-ca span { font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.gi-ca code { flex: 1; min-width: 0; font: 500 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.gi-btns .btn.play { flex: 1 1 200px; }

/* ---------- Create a game ---------- */
.csheet { background: radial-gradient(90% 70% at 50% 0%, #0b3290, #01040c 70%); overflow-y: auto; overscroll-behavior: contain; }
.cs-in { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.cs-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 6px; }
.cs-h h2 { margin: 2px 0 0; font-size: 32px; font-weight: 300; }
.cs-k { font-size: 11px; letter-spacing: .16em; color: var(--dim); }
.cs-x { position: static; flex: 0 0 auto; }
.cs-sub { color: var(--dim); margin: 8px 0 16px; font-size: 14px; }
#cs-form { display: grid; gap: 12px; }
#cs-form label { display: grid; gap: 6px; font-size: 12px; letter-spacing: .06em; color: var(--dim); min-width: 0; }
#cs-form input:not([type=file]), #cs-form textarea { font: 400 16px/1.3 Inter, system-ui, sans-serif; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(160,195,255,.25); border-radius: 12px; padding: 12px; min-height: 44px; width: 100%; outline: none; }
#cs-form input:focus, #cs-form textarea:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(90,166,255,.35); }
.cs-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.cs-cover { position: relative; display: grid !important; place-items: center; height: 168px; border-radius: 22px; border: 1.5px dashed rgba(200,225,255,.45); background: rgba(255,255,255,.05); cursor: pointer; overflow: hidden; }
.cs-cover input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cs-ph { display: grid; place-items: center; gap: 2px; font-size: 30px; color: #dce9ff; pointer-events: none; }
.cs-ph b { font-size: 14px; } .cs-ph small { font-size: 11px; color: var(--dim); }
.cs-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cs-cover.has { border-style: solid; border-color: #fff; }
.cs-more { border: 1px solid rgba(160,195,255,.16); border-radius: 12px; padding: 0 12px; }
.cs-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--dim); font-size: 13px; }
.cs-more[open] { padding-bottom: 12px; display: grid; gap: 10px; }
.cs-note { font-size: 12px; color: var(--mute, #6c7fa6); margin: 0; }
.cs-wallet { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(16,32,70,.6); border: 1px solid rgba(160,195,255,.16); }
.cs-wk { font-size: 13px; color: var(--dim); }
.cs-wl { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-conn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.cs-conn i { width: 8px; height: 8px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 8px #39d98a; }
.cs-link { margin-left: auto; min-height: 44px; background: none; border: 0; color: var(--dim); text-decoration: underline; cursor: pointer; }
.cs-go { width: 100%; min-height: 52px; font-size: 17px; }
.csheet.busy .cs-go { opacity: .6; pointer-events: none; }
.cs-steps { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.3); font-size: 14px; }
.cs-steps div { display: flex; align-items: center; gap: 10px; color: var(--mute, #6c7fa6); }
.cs-steps div i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; flex: 0 0 auto; }
.cs-steps .done { color: #7cf0b2; } .cs-steps .done i { background: currentColor; }
.cs-steps .now { color: #fff; } .cs-steps .now i { border-top-color: transparent; animation: gspin .8s linear infinite; }
.cs-steps .bad { color: #ff8c8c; }
.cs-steps .msg { display: block; padding-top: 4px; color: var(--dim); }
.cs-steps .msg.bad { color: #ff8c8c; } .cs-steps .msg.good { color: #7cf0b2; }

@media (min-width: 900px) {
  .g-cover { width: 220px; height: 220px; }
  .gi-cover { width: 160px; height: 160px; }
  .gi-head h2 { font-size: 46px; }
  .gi-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .gscreen, .csheet, .g-bg, .g-cover, .g-ltitle, .g-ring, .g-info > *, .gi-bar i, .cs-steps .now i { animation: none !important; }
  .g-load { transition: none; }
}
