:root{
  --bg:#0b1020;
  --bg-soft:#11182e;
  --surface:rgba(18,25,45,.92);
  --surface-2:rgba(25,34,61,.9);
  --surface-3:#eef3ff;
  --card:#121a31;
  --card-soft:#1a2445;
  --line:rgba(255,255,255,.09);
  --line-soft:rgba(111,137,193,.22);
  --text:#f7f9ff;
  --text-dark:#101828;
  --muted:#a4b0d0;
  --muted-dark:#667085;
  --blue:#4a8cff;
  --blue-2:#2f6fe8;
  --cyan:#58d1ff;
  --green:#22c55e;
  --orange:#f59e0b;
  --red:#ef4444;
  --shadow:0 24px 56px rgba(2,8,23,.35);
  --shadow-soft:0 18px 40px rgba(2,8,23,.18);
  --radius:26px;
  --radius-sm:18px;
  --bottom:86px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",Arial,sans-serif;background:radial-gradient(circle at top,#172346 0,#0b1020 42%,#070b17 100%);color:var(--text)}
a{color:inherit}
body{overscroll-behavior:none}
.app-shell{width:100%;max-width:560px;margin:0 auto;min-height:100vh;position:relative}
.has-bottom-nav{padding-bottom:calc(var(--bottom) + env(safe-area-inset-bottom))}
.no-bottom-nav{padding-bottom:0}
.page{padding:20px 18px 30px}
.topbar{position:sticky;top:0;z-index:35;padding:14px 16px 12px;background:rgba(7,11,23,.72);backdrop-filter:blur(18px);border-bottom:1px solid rgba(255,255,255,.06)}
.topbar.plain{background:rgba(243,246,251,.86)}
.brand{display:flex;align-items:center;justify-content:space-between;gap:14px}
.brand-left{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.brand-copy{min-width:0}
.brand-copy h1,.brand h1{margin:0;font-size:22px;line-height:1.1;letter-spacing:-.04em}
.brand-copy small,.brand small{display:block;margin-top:4px;color:var(--muted);font-weight:700;font-size:12px;line-height:1.35}
.brand-mark{width:44px;height:44px;flex:0 0 44px;border-radius:16px;background:linear-gradient(135deg,#58d1ff,#4a8cff 55%,#6c4bff);display:grid;place-items:center;color:#fff;font-size:14px;font-weight:900;box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 8px 24px rgba(74,140,255,.28);overflow:hidden}
.brand-mark.with-image{background:rgba(255,255,255,.08);padding:0}
.brand-mark img{width:100%;height:100%;object-fit:contain;background:#fff}
.icon-btn{width:42px;height:42px;border-radius:16px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.08);display:grid;place-items:center;text-decoration:none;color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.18);cursor:pointer}
.icon-btn.small{width:36px;height:36px;border-radius:12px}
.hero-panel,.surface-card,.card{background:linear-gradient(180deg,rgba(22,31,58,.96),rgba(16,23,44,.96));border:1px solid rgba(255,255,255,.08);border-radius:var(--radius);box-shadow:var(--shadow)}
.hero-panel{padding:24px;position:relative;overflow:hidden}
.hero-panel::after{content:"";position:absolute;right:-80px;top:-90px;width:220px;height:220px;background:radial-gradient(circle,rgba(88,209,255,.38) 0,rgba(88,209,255,.02) 70%,transparent 100%)}
.hero-panel h2{margin:0 0 10px;font-size:32px;line-height:1.08;letter-spacing:-.05em}
.hero-panel p{margin:0;color:#c5d1f3;line-height:1.6}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.btn{border:0;border-radius:18px;padding:14px 18px;background:linear-gradient(135deg,#4a8cff,#2f6fe8);color:#fff;font-weight:900;font-size:15px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 16px 32px rgba(47,111,232,.35);cursor:pointer;transition:transform .16s ease,box-shadow .16s ease}
.btn:active{transform:scale(.985)}
.btn.secondary{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);box-shadow:none;color:#fff}
.btn.ghost{background:#eef4ff;color:#2f6fe8;box-shadow:none}
.btn.danger{background:linear-gradient(135deg,#f87171,#ef4444)}
.btn.full{width:100%}
.btn.small{padding:10px 14px;border-radius:14px;font-size:13px}
.section-title{margin:24px 2px 12px;display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.section-title h3{margin:0;font-size:18px;letter-spacing:-.03em}
.section-title a{font-size:13px;text-decoration:none;font-weight:800;color:#b7cbff}
.grid{display:grid;gap:14px}
.grid.two{grid-template-columns:1fr 1fr}
.card{padding:18px}
.card.flat{box-shadow:none}
.card h4{margin:0 0 6px;font-size:17px;letter-spacing:-.03em}
.card p{margin:0;color:var(--muted);font-size:14px;line-height:1.6}
.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.stat-card{padding:16px;border-radius:22px;background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.04));border:1px solid rgba(255,255,255,.08)}
.stat-card b{display:block;font-size:24px;margin-bottom:4px}
.stat-card span{font-size:12px;color:#b9c7ea}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;color:#dbe6ff;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);border-radius:999px;padding:7px 10px}
.pill.blue{background:rgba(74,140,255,.16);color:#d9e7ff;border-color:rgba(74,140,255,.36)}
.meta-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.form{display:grid;gap:14px}
.field label,.field .field-title{display:block;font-size:13px;font-weight:900;margin:0 0 8px;color:#d7e2ff}
.field input,.field select,.field textarea{width:100%;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:rgba(255,255,255,.07);padding:14px 15px;font-size:16px;color:#fff;outline:none}
.field textarea{min-height:100px;resize:vertical}
.field input::placeholder{color:#9fb0d8}
.field input:focus,.field select:focus,.field textarea:focus{border-color:rgba(88,209,255,.6);box-shadow:0 0 0 4px rgba(74,140,255,.12)}
.field select option{color:#111827}
.field-help{margin:8px 0 0;color:#9fb0d8;font-size:12px;line-height:1.45}
.field-help.danger{color:#fecaca}
.notice{border-radius:18px;padding:14px 16px;background:#1e293b;border:1px solid rgba(245,158,11,.42);color:#fcd34d;font-size:14px;line-height:1.5}
.muted{color:var(--muted)}
.rank-list{display:grid;gap:12px}
.rank-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(255,255,255,.08);background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.03));border-radius:20px;padding:14px 16px;text-decoration:none;color:inherit}
.rank-item:hover{border-color:rgba(88,209,255,.32)}
.copy-box{display:flex;gap:8px;align-items:center;border:1px dashed rgba(88,209,255,.35);background:rgba(255,255,255,.04);border-radius:18px;padding:10px}
.copy-box input{border:0;background:transparent;flex:1;min-width:0;font-size:13px;color:#dbe6ff}
.choice-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.choice{border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.06);border-radius:18px;padding:13px 10px;text-align:center;font-weight:900;cursor:pointer;color:#dbe6ff}
.choice input{display:none}.choice:has(input:checked){border-color:var(--cyan);background:rgba(74,140,255,.16);color:#fff}
.bottom-nav{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:560px;height:calc(var(--bottom) + env(safe-area-inset-bottom));padding:10px 14px calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr);gap:10px;background:rgba(9,13,24,.82);backdrop-filter:blur(22px);border-top:1px solid rgba(255,255,255,.08);z-index:40}
.bottom-nav a{text-decoration:none;color:#91a4cf;border-radius:20px;display:grid;place-items:center;gap:3px;font-size:11px;font-weight:900;padding:8px 4px}
.bottom-nav a span{font-size:18px;line-height:1}
.bottom-nav a.active{background:linear-gradient(180deg,rgba(74,140,255,.22),rgba(74,140,255,.14));color:#fff;border:1px solid rgba(88,209,255,.22)}
.legal-footer{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:7px;
  padding:16px 14px calc(18px + env(safe-area-inset-bottom));
  color:#8fa0c4;
  font-size:12px;
  font-weight:800;
}
.has-bottom-nav .legal-footer{
  padding-bottom:calc(var(--bottom) + 18px + env(safe-area-inset-bottom));
}
.legal-footer a{
  color:inherit;
  text-decoration:none;
}
.legal-footer a:hover{
  color:#dbe6ff;
}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.page-head h2{margin:0;font-size:24px;letter-spacing:-.04em}
.page-head p{margin:6px 0 0;color:var(--muted);font-size:14px}
.header-actions{display:flex;gap:8px;align-items:center}
.game-picker{display:grid;gap:12px}
.game-picker-grid{display:grid;gap:12px}
.game-option{position:relative;border:1px solid rgba(255,255,255,.08);background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.03));border-radius:24px;padding:12px;display:grid;gap:12px;cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.game-option:hover{transform:translateY(-1px);border-color:rgba(88,209,255,.28)}
.game-option.active{border-color:rgba(88,209,255,.42);box-shadow:0 12px 32px rgba(47,111,232,.18)}
.game-option input{display:none}
.game-thumb{position:relative;height:156px;border-radius:20px;overflow:hidden;background:linear-gradient(135deg,#123056,#132b67 55%,#6d3aff);display:flex;align-items:flex-end;padding:16px}
.game-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.game-thumb::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(9,13,24,.05),rgba(9,13,24,.76))}
.game-thumb-badge,.game-thumb-title{position:relative;z-index:1}
.game-thumb-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900;background:rgba(255,255,255,.14);backdrop-filter:blur(10px)}
.game-thumb-title{display:flex;flex-direction:column;gap:6px}
.game-thumb-title b{font-size:19px;letter-spacing:-.03em}
.game-thumb-title span{font-size:13px;color:#d2defd}
.game-option-body{display:grid;gap:8px;padding:0 4px 4px}
.game-option-meta{display:flex;flex-wrap:wrap;gap:8px}
.option-dot{width:8px;height:8px;border-radius:999px;background:var(--cyan)}
.form-shell{display:grid;gap:16px}
.form-shell .surface-card{padding:18px}
.form-shell .surface-card h3{margin:0 0 14px;font-size:17px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-grid .field.full{grid-column:1/-1}
.inline-note{padding:12px 14px;border-radius:16px;background:rgba(88,209,255,.08);border:1px solid rgba(88,209,255,.12);color:#d4e9ff;font-size:13px;line-height:1.5}
.empty-state{padding:28px 18px;text-align:center}
.empty-state h3{margin:0 0 8px;font-size:20px}
.empty-state p{margin:0;color:var(--muted);line-height:1.6}
.pagination{display:flex;justify-content:center;align-items:center;gap:8px;margin-top:18px}
.pagination a,.pagination span{min-width:40px;height:40px;display:grid;place-items:center;border-radius:14px;text-decoration:none;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);color:#dbe6ff;font-weight:800}
.pagination .active{background:linear-gradient(135deg,#4a8cff,#2f6fe8);border-color:transparent}
.room-list{display:grid;gap:12px}
.room-card{display:grid;gap:14px;text-decoration:none;color:inherit}
.room-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.room-card-head b{font-size:18px}
.room-meta-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.room-meta-box{padding:12px;border-radius:16px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06)}
.room-meta-box span{display:block;font-size:11px;color:#9fb0d8;margin-bottom:4px}
.room-meta-box b{font-size:14px}
.info-grid{display:grid;gap:14px}
.info-card{padding:18px;border-radius:24px;background:#fff;border:1px solid #e4ebf6;box-shadow:0 12px 30px rgba(22,36,65,.08);color:#1f2a44}
.info-card h4{margin:0 0 8px;font-size:18px;color:#172033}
.info-list{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.info-list li{padding:12px 14px;border-radius:16px;background:#f7f9fd;border:1px solid #e5ebf6;color:#344054;line-height:1.6}
.legal-page{
  display:grid;
  gap:14px;
}
.legal-card{
  padding:22px;
  background:#fff;
  border-color:#e4ebf6;
  color:#1f2a44;
}
.legal-card .legal-date{
  margin:0 0 8px;
  color:#66758f;
  font-size:12px;
  font-weight:900;
}
.legal-card h2{
  margin:0 0 16px;
  font-size:26px;
  line-height:1.18;
  color:#101828;
}
.legal-card h3{
  margin:22px 0 8px;
  font-size:17px;
  line-height:1.35;
  color:#24304a;
}
.legal-card p,
.legal-card li{
  color:#344054;
  font-size:14px;
  line-height:1.75;
}
.legal-card p{
  margin:0 0 10px;
}
.legal-card ul{
  display:grid;
  gap:8px;
  margin:0;
  padding-left:18px;
}
.legal-card a{
  color:#1d4ed8;
  font-weight:900;
  text-decoration:none;
}
.legal-card a:hover{
  color:#123cba;
}
.settings-sheet{position:fixed;inset:0;z-index:120;display:none}
.settings-sheet.show{display:block}
.settings-sheet__backdrop{position:absolute;inset:0;background:rgba(4,8,16,.6);backdrop-filter:blur(5px)}
.settings-sheet__panel{position:absolute;left:0;right:0;bottom:0;max-width:820px;margin:0 auto;background:linear-gradient(180deg,#131b33,#0e162b);border-radius:28px 28px 0 0;border:1px solid rgba(255,255,255,.08);padding:12px 18px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(0,0,0,.35)}
.settings-sheet__grab{width:58px;height:6px;border-radius:999px;background:rgba(255,255,255,.16);margin:4px auto 14px}
.settings-sheet__head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.settings-sheet__head h2{margin:0;font-size:22px;letter-spacing:-.04em}
.settings-form{display:grid;gap:14px}
.settings-row{display:flex;justify-content:space-between;gap:12px;padding:16px;border-radius:20px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);align-items:center}
.settings-row b{display:block;margin-bottom:4px}
.settings-row small{display:block;color:#9fb0d8;line-height:1.4}
.settings-row input[type="checkbox"]{width:52px;height:30px;appearance:none;border-radius:999px;background:#2b3557;position:relative;cursor:pointer;transition:.2s}
.settings-row input[type="checkbox"]::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:.2s}
.settings-row input[type="checkbox"]:checked{background:var(--blue)}
.settings-row input[type="checkbox"]:checked::after{left:25px}
.settings-actions{display:flex;gap:10px}

/* game / room compatibility */
.room-header{padding:20px 18px 0}
.room-title{font-size:26px;line-height:1.15;letter-spacing:-.05em;margin:10px 0 8px}
.back-link{text-decoration:none;color:#b7cbff;font-weight:900}.game-wrap{min-height:100vh;background:#020617;color:white;display:flex;flex-direction:column}.game-hud{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:rgba(2,6,23,.76);position:fixed;left:0;right:0;top:0;z-index:2;max-width:820px;margin:0 auto}.game-canvas{width:100%;height:100vh;display:block;touch-action:none;background:#020617}.overlay{position:fixed;inset:0;max-width:820px;margin:0 auto;background:rgba(2,6,23,.72);display:none;align-items:center;justify-content:center;padding:20px;z-index:5}.overlay.show{display:flex}.overlay-card{background:#fff;color:#111827;border-radius:26px;padding:22px;width:min(420px,100%);text-align:center}

/* admin compatibility */
.admin-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh;max-width:1280px;margin:0 auto;background:#fff;color:var(--text-dark)}
.admin-side{background:#0f172a;color:white;padding:20px}.admin-side a{display:block;color:#cbd5e1;text-decoration:none;padding:11px 12px;border-radius:12px;font-weight:800}.admin-side a.active,.admin-side a:hover{background:#1d4ed8;color:#fff}.admin-main{padding:24px;background:#f8fafc;color:var(--text-dark)}.table{width:100%;border-collapse:collapse;background:#fff;border-radius:16px;overflow:hidden}.table th,.table td{padding:12px;border-bottom:1px solid #e5e7eb;text-align:left;font-size:14px}.table th{background:#f1f5f9;color:#475569}.admin-main .card,.admin-panel{background:#fff;border:1px solid #e5e7eb;border-radius:24px;box-shadow:0 10px 30px rgba(15,23,42,.05);padding:20px}.admin-main .field label,.admin-main .field .field-title{color:#344054}.admin-main .field input,.admin-main .field select,.admin-main .field textarea{background:#fff;color:#101828;border:1px solid #d0d5dd}.admin-main .field-help,.admin-main .muted{color:#667085}.admin-main .btn.secondary{color:#111827}.admin-main .pill{background:#eef2ff;color:#344054;border-color:#dbe4ff}.admin-main .pill.blue{background:#e9f1ff;color:#1d4ed8;border-color:#cfe0ff}
.mb-toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translate(-50%, 18px);z-index:9999;max-width:min(420px, calc(100vw - 34px));border-radius:999px;padding:12px 16px;background:rgba(17,24,39,.92);color:#fff;font-size:14px;font-weight:900;opacity:0;pointer-events:none;transition:opacity .18s ease, transform .18s ease;box-shadow:0 16px 40px rgba(0,0,0,.22)}.mb-toast.show{opacity:1;transform:translate(-50%, 0)}

@media (max-width:720px){
  .page{padding:18px 14px 26px}
  .hero-panel h2{font-size:29px}
  .grid.two,.form-grid,.room-meta-grid,.stats-grid{grid-template-columns:1fr}
  .topbar{padding-left:14px;padding-right:14px}
  .brand-copy h1,.brand h1{font-size:20px}
  .game-thumb{height:146px}
  .bottom-nav{gap:8px;padding-inline:10px}
  .bottom-nav a{border-radius:18px}
  .admin-shell{display:block}.admin-side{display:flex;overflow:auto;gap:8px}.admin-side a{white-space:nowrap}
}


/* v50 create renewal */
.create-page{display:grid;gap:16px}
.create-hero{display:grid;grid-template-columns:1.25fr .75fr;gap:18px;align-items:stretch}
.create-hero-copy{display:grid;align-content:center;gap:10px}
.create-hero-cta{display:grid;align-content:end;gap:10px}
.hero-kicker{display:inline-flex;align-items:center;gap:8px;padding:7px 12px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);font-size:12px;font-weight:900;color:#dce7ff;width:max-content}
.game-picker-shell{padding:14px}
.game-picker-grid{display:grid;gap:16px}
.game-option{padding:14px;border-radius:28px;background:linear-gradient(180deg,rgba(22,33,65,.98),rgba(14,22,46,.98));border:1px solid rgba(102,168,255,.18);box-shadow:0 20px 42px rgba(3,8,20,.28), inset 0 1px 0 rgba(255,255,255,.06)}
.game-option.active{border-color:rgba(88,209,255,.48);box-shadow:0 20px 44px rgba(47,111,232,.22), inset 0 1px 0 rgba(255,255,255,.08)}
.game-thumb{height:186px;border-radius:24px;padding:18px;background:linear-gradient(135deg,#122e60,#14275a 48%,#19357d 70%,#5b49d8);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.game-thumb::after{background:linear-gradient(180deg,rgba(7,10,18,.04),rgba(7,10,18,.82) 82%)}
.game-thumb-title{gap:7px;max-width:85%}
.game-thumb-title b{font-size:28px;line-height:1.05;letter-spacing:-.04em;text-shadow:0 6px 20px rgba(0,0,0,.34)}
.game-thumb-title span:last-child{font-size:14px;line-height:1.5;color:#dfebff}
.game-thumb-badge{background:rgba(18,29,56,.62);border:1px solid rgba(255,255,255,.12)}
.game-option-body{gap:12px;padding:2px 4px 2px}
.game-option-meta{gap:10px}
.game-option-footer{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.inline-create{padding-inline:16px;box-shadow:0 10px 24px rgba(47,111,232,.24)}
.create-help-card{display:flex;align-items:center;justify-content:space-between;padding:18px 20px}
.create-help-card h3{margin:0 0 6px;font-size:18px}
.create-help-card p{margin:0;color:#b8c7ea;line-height:1.55}
.form-grid.compact{grid-template-columns:1fr 1fr}
.modal-actions{display:grid;gap:10px}
.kakao-room-create-btn{
  background:#fee500;
  color:#181600;
  box-shadow:0 12px 24px rgba(254,229,0,.22);
}
.app-modal{position:fixed;inset:0;z-index:130;display:none}
.app-modal.show{display:block}
.app-modal__backdrop{position:absolute;inset:0;background:rgba(4,8,16,.72);backdrop-filter:blur(9px)}
.app-modal__panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 28px));max-height:calc(100vh - 36px);overflow:auto;border-radius:30px;background:linear-gradient(180deg,#162246,#0f1830);border:1px solid rgba(255,255,255,.1);box-shadow:0 32px 72px rgba(0,0,0,.42);padding:20px}
.app-modal__head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.app-modal__head h3{margin:6px 0 6px;font-size:28px;line-height:1.06;letter-spacing:-.05em}
.app-modal__head p{margin:0;color:#bccbee;line-height:1.6}
.create-modal-form .field-help b{color:#fff}
.room-list .surface-card,.rank-list .rank-item{border-radius:26px}
.room-card{background:linear-gradient(180deg,rgba(22,31,58,.98),rgba(16,23,44,.98));border:1px solid rgba(255,255,255,.08)}
.room-card-head b{font-size:22px;letter-spacing:-.03em}
.rank-item{padding:18px 18px;background:linear-gradient(180deg,rgba(22,31,58,.98),rgba(16,23,44,.98))}
.rank-item b:last-child{font-size:30px;letter-spacing:-.04em;white-space:nowrap}

@media (max-width:720px){
  .create-hero{grid-template-columns:1fr;gap:14px}
  .game-thumb{height:164px;padding:16px}
  .game-thumb-title{max-width:100%}
  .game-thumb-title b{font-size:24px}
  .app-modal__panel{top:auto;bottom:0;transform:translateX(-50%);width:min(560px,100vw);max-height:85vh;border-radius:28px 28px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom))}
  .form-grid.compact{grid-template-columns:1fr}
  .room-card-head b{font-size:19px}
  .rank-item b:last-child{font-size:24px}
}


/* v51 white premium UI renewal */
:root{
  --v51-bg:#f8fbff;
  --v51-text:#101d36;
  --v51-muted:#69758c;
  --v51-line:#e7edf7;
  --v51-purple:#823ef3;
  --v51-blue:#2388f6;
  --v51-orange:#ff8324;
  --v51-shadow:0 18px 44px rgba(21,37,74,.10);
}
html,body{
  background:
    radial-gradient(circle at 12% 0%, rgba(119,71,255,.08), transparent 32%),
    radial-gradient(circle at 88% 6%, rgba(35,136,246,.08), transparent 30%),
    linear-gradient(180deg,#ffffff 0%, #f8fbff 100%) !important;
  color:var(--v51-text);
}
.app-shell{max-width:560px;background:rgba(255,255,255,.42);box-shadow:0 0 0 1px rgba(231,237,247,.42)}
.topbar,.ui-white-topbar{
  background:rgba(255,255,255,.82)!important;
  backdrop-filter:blur(22px);
  border-bottom:1px solid rgba(224,231,244,.85);
  padding:18px 18px 14px;
}
.brand-copy h1,.brand h1{color:var(--v51-text);font-size:28px;font-weight:950;letter-spacing:-.05em}
.brand-copy small,.brand small{color:var(--v51-muted)}
.brand-mark{
  width:54px;height:54px;flex-basis:54px;border-radius:18px;
  background:linear-gradient(135deg,#35c1ff 0%,#526cff 48%,#9a3fff 100%);
  color:#fff;box-shadow:0 12px 26px rgba(94,85,255,.20);
}
.brand-mark.with-image{background:transparent;box-shadow:none}
.icon-btn{
  width:52px;height:52px;border-radius:50%;
  background:rgba(255,255,255,.86);color:#37445d;
  border:1px solid rgba(224,231,244,.9);
  box-shadow:0 10px 28px rgba(22,36,65,.12);
}
.icon-btn.small{width:38px;height:38px;border-radius:50%}
.page{padding:24px 18px 30px}
.v51-title{display:flex;gap:16px;align-items:flex-start;margin:8px 0 10px}
.v51-title-icon{font-size:34px;line-height:1;color:#8c45f5;text-shadow:0 8px 20px rgba(140,69,245,.22)}
.v51-title h2{margin:0;font-size:30px;line-height:1.15;letter-spacing:-.055em;color:var(--v51-text);font-weight:950}
.v51-title p{margin:10px 0 0;color:var(--v51-muted);font-size:16px;line-height:1.5}
.v51-game-list{display:grid;gap:14px}
.v51-game-card{
  border:1px solid var(--v51-line);
  border-radius:28px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--v51-shadow);
  padding:16px;
  display:grid;
  gap:14px;
  overflow:hidden;
}
.v51-game-card.active{border-color:rgba(130,62,243,.28)}
.v51-game-thumb{
  height:154px;border-radius:18px;overflow:hidden;
  background:linear-gradient(135deg,#ecefff,#fff);
}
.v51-game-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.v51-game-thumb-fallback{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:48px;
  font-weight:1000;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.42), transparent 24%),
    linear-gradient(135deg,#a855f7,#6d35ea);
}
.v51-game-thumb-fallback.orange{background:radial-gradient(circle at 18% 18%, rgba(255,255,255,.42), transparent 24%),linear-gradient(135deg,#ffae3f,#ff7624)}
.v51-game-thumb-fallback.blue{background:radial-gradient(circle at 18% 18%, rgba(255,255,255,.42), transparent 24%),linear-gradient(135deg,#50bfff,#2388f6)}
.v51-game-thumb-fallback.mint{background:radial-gradient(circle at 18% 18%, rgba(255,255,255,.42), transparent 24%),linear-gradient(135deg,#67e8f9,#34d399)}
.v51-game-thumb-fallback.sky{background:radial-gradient(circle at 18% 18%, rgba(255,255,255,.48), transparent 24%),linear-gradient(135deg,#7dd3fc,#60a5fa 54%,#c084fc)}
.v51-game-info{display:grid;gap:12px}
.v51-game-title-row{display:block}
.v51-game-title-row h3{margin:0;font-size:25px;line-height:1.12;letter-spacing:0;color:var(--v51-text);font-weight:920}
.v51-game-title-row p{margin:7px 0 0;color:var(--v51-muted);line-height:1.48;font-size:14px}
.v51-create-btn{
  width:100%;height:50px;border:0;border-radius:999px;color:#fff;font-size:16px;font-weight:820;
  display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;
  background:linear-gradient(135deg,#a855f7,#6d35ea);box-shadow:0 10px 18px rgba(130,62,243,.20);
}
.v51-create-btn.orange{background:linear-gradient(135deg,#ffae3f,#ff7624);box-shadow:0 10px 18px rgba(255,131,36,.18)}
.v51-create-btn.blue{background:linear-gradient(135deg,#50bfff,#2388f6);box-shadow:0 10px 18px rgba(35,136,246,.18)}
.v51-create-btn.mint{background:linear-gradient(135deg,#67e8f9,#34d399);box-shadow:0 10px 18px rgba(52,211,153,.18)}
.v51-create-btn.sky{background:linear-gradient(135deg,#7dd3fc,#60a5fa 54%,#a78bfa);box-shadow:0 10px 18px rgba(96,165,250,.18)}
.v51-create-btn span{font-size:19px}.v51-create-btn b{margin-left:auto;padding-right:10px;font-size:22px;font-weight:760}
.weekly-rank-page{display:grid;gap:14px}
.weekly-game-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 2px 8px;
  scrollbar-width:none;
}
.weekly-game-tabs::-webkit-scrollbar{display:none}
.weekly-game-tabs a{
  flex:0 0 auto;
  min-height:40px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:0 13px;
  border-radius:999px;
  border:1px solid #e2e8f4;
  background:#fff;
  color:#66758f;
  text-decoration:none;
  font-size:13px;
  font-weight:850;
  box-shadow:0 8px 18px rgba(22,36,65,.06);
}
.weekly-game-tabs a.active{
  border-color:rgba(125,53,232,.24);
  background:linear-gradient(135deg,rgba(157,92,255,.18),rgba(157,92,255,.08));
  color:#6d28d9;
}
.weekly-rank-list{display:grid;gap:10px}
.weekly-rank-item{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:9px 12px;
  border-radius:16px;
  border:1px solid #e2e8f4;
  background:#fff;
  color:var(--v51-text);
  box-shadow:0 10px 24px rgba(22,36,65,.07);
}
.weekly-rank-item.top{
  border-color:rgba(125,53,232,.28);
  box-shadow:0 14px 30px rgba(125,53,232,.12);
}
.weekly-rank-item.is-mine{
  border-color:rgba(250,204,21,.72);
  box-shadow:0 0 0 1px rgba(250,204,21,.20),0 12px 28px rgba(250,204,21,.12);
}
.weekly-rank-num{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#eef2ff;
  color:#6d28d9;
  font-weight:950;
  font-size:13px;
}
.weekly-rank-player{min-width:0}
.weekly-rank-player b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
  line-height:1.25;
}
.weekly-rank-player b em{
  display:inline-flex;
  margin-left:6px;
  padding:3px 6px;
  border-radius:999px;
  background:#facc15;
  color:#422006;
  font-size:9px;
  font-style:normal;
  font-weight:950;
  vertical-align:middle;
}
.weekly-rank-player span{
  display:block;
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#74829a;
  font-size:12px;
  font-weight:750;
}
.weekly-rank-item strong{
  color:#0f172a;
  font-size:16px;
  white-space:nowrap;
}
.bottom-nav{
  max-width:560px;background:rgba(255,255,255,.92)!important;border:1px solid rgba(224,231,244,.9);
  border-radius:28px 28px 0 0;height:calc(84px + env(safe-area-inset-bottom));
  box-shadow:0 -18px 36px rgba(22,36,65,.10);padding:10px 14px calc(10px + env(safe-area-inset-bottom));
}
.bottom-nav a{color:#66758f;border-radius:999px;font-size:13px;display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:center}
.bottom-nav a span{font-size:24px;font-weight:900}
.bottom-nav a b{font-size:14px}
.bottom-nav a.active{
  color:#7d35e8;background:linear-gradient(135deg,rgba(157,92,255,.18),rgba(157,92,255,.08));
  border:0;box-shadow:none;
}
.app-modal__backdrop{background:rgba(30,42,68,.34);backdrop-filter:blur(12px)}
.app-modal__panel{
  background:rgba(255,255,255,.96)!important;color:var(--v51-text);
  border:1px solid rgba(224,231,244,.95);box-shadow:0 30px 70px rgba(22,36,65,.24);
}
.app-modal__head h3{color:var(--v51-text)}
.app-modal__head p,.field-help,.inline-note{color:var(--v51-muted)}
.field label,.field .field-title{color:#34425a}
.field input,.field select,.field textarea{
  background:#f7f9fd!important;color:var(--v51-text)!important;border:1px solid #e2e8f4!important;
}
.inline-note{background:#f6f8fe;border-color:#e5ebf6;color:#6b7890}
.btn.secondary{background:#f5f7fc!important;color:#526078!important;border:1px solid #e2e8f4!important}
.settings-sheet__backdrop{background:rgba(30,42,68,.22);backdrop-filter:blur(8px)}
.settings-sheet__panel{
  background:rgba(255,255,255,.97);color:var(--v51-text);border:1px solid #e6edf7;
  box-shadow:0 -20px 54px rgba(22,36,65,.16)
}
.settings-row{background:#fff;border-color:#e6edf7;box-shadow:0 8px 20px rgba(22,36,65,.06)}
.settings-row small{color:#758198}
.settings-sheet__grab{background:#d9e1ee}
.settings-row input[type="checkbox"]{background:#dce4f0}
.settings-row input[type="checkbox"]:checked{background:#8640f4}
.settings-create-box,
.settings-install-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid #e6edf7;
  border-radius:18px;
  background:#f7f9fd;
}
.settings-create-box b,
.settings-install-box b{
  display:block;
  margin-bottom:4px;
  color:#24304a;
}
.settings-create-box small,
.settings-install-box small{
  display:block;
  color:#6b7890;
  font-size:12px;
  line-height:1.45;
}
.settings-create-box .btn,
.settings-install-box .btn{
  min-width:94px;
  min-height:42px;
  padding:0 14px;
  border-radius:14px;
  white-space:nowrap;
}
.settings-install-box{background:linear-gradient(135deg,#eef6ff,#f8fbff)}
.settings-install-box .btn.disabled,
.install-hero .btn.disabled{
  background:#eef2f7;
  color:#64748b;
  box-shadow:none;
  opacity:1;
  cursor:default;
}
.install-page{display:grid;gap:14px}
.install-hero{text-align:center;padding:24px 18px}
.install-hero img{width:84px;height:84px;border-radius:24px;display:block;margin:0 auto 14px;box-shadow:0 14px 32px rgba(24,119,242,.18)}
.install-hero h2{margin:0 0 8px;font-size:25px;letter-spacing:0;color:#172033}
.install-hero p{margin:0 0 16px;color:#66758f;line-height:1.5}
.install-status{margin-top:12px;color:#66758f;font-size:13px;font-weight:800}
.install-guide{padding:18px}
.install-guide h3{margin:0 0 8px;color:#172033}
.install-guide p{margin:0;color:#66758f;line-height:1.6}
.surface-card,.card{
  background:#fff!important;color:var(--v51-text);border:1px solid var(--v51-line);box-shadow:var(--v51-shadow);
}
.rank-item,.room-card{
  background:#fff!important;color:var(--v51-text);border:1px solid var(--v51-line);box-shadow:0 12px 30px rgba(22,36,65,.08);
}
.pill{background:#f4f7fc;color:#60708a;border-color:#e3e9f4}
.pill.blue{background:#eef4ff;color:#236de8;border-color:#dbe8ff}
.muted{color:var(--v51-muted)}
.notice{background:#fff8e8;color:#a15c00;border-color:#ffe0a3}

/* v51 room / records light cards */
.room-meta-box{background:#f7f9fd;border:1px solid #e6edf7}
.room-meta-box span{color:#74829a}
.rank-item b:last-child{color:var(--v51-text)}
.pagination a,.pagination span{background:#fff;color:#66758f;border-color:#e2e8f4;box-shadow:0 8px 20px rgba(22,36,65,.06)}
.pagination .active{background:linear-gradient(135deg,#9a55f7,#7d35e8);color:#fff}

@media (max-width:520px){
  .brand-copy h1,.brand h1{font-size:24px}
  .brand-mark{width:48px;height:48px;flex-basis:48px}
  .icon-btn{width:48px;height:48px}
  .v51-title h2{font-size:27px}
  .v51-game-thumb{height:132px}
  .v51-game-title-row h3{font-size:22px}
  .v51-create-btn{height:48px;font-size:15px;font-weight:800}
  .bottom-nav a b{font-size:12px}
  .bottom-nav a span{font-size:20px}
}


/* v52 mobile fit refinement */
.hero-panel{
  background:linear-gradient(135deg,#16264c 0%, #1d315d 58%, #2b587d 100%) !important;
  color:#fff !important;
}
.hero-panel h2{color:#fff !important}
.hero-panel p{color:rgba(255,255,255,.92) !important}

.page-head{align-items:center}
.page-head h2{font-size:22px;line-height:1.15}
.page-head p{font-size:13px;line-height:1.45}
.section-title h3{font-size:17px}
.notice{font-size:13px;padding:13px 14px;line-height:1.45}
.pill{white-space:nowrap}
.meta-row{
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.meta-row::-webkit-scrollbar{display:none}
.meta-row .pill{flex:0 0 auto}

.rank-item > div{min-width:0;flex:1}
.rank-item > div > b{
  display:block;
  font-size:18px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-bottom:10px;
}
.rank-item b:last-child{
  font-size:24px;
  line-height:1.05;
  white-space:nowrap;
  flex:0 0 auto;
}

.room-card{padding:16px}
.room-card-head{align-items:flex-start}
.room-card-head > div{min-width:0;flex:1}
.room-card-head b{
  display:block;
  font-size:20px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.room-card-head > .pill{flex:0 0 auto}
.room-meta-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.room-meta-box{
  min-width:0;
  padding:12px;
  border-radius:16px;
}
.room-meta-box b{
  display:block;
  font-size:14px;
  line-height:1.3;
  word-break:keep-all;
}

.info-card h4{font-size:17px}
.info-list li{font-size:13px;line-height:1.55}

@media (max-width: 560px){
  .app-shell{max-width:100%}
  .topbar,.ui-white-topbar{
    padding:12px 14px 10px !important;
  }
  .page{
    padding:14px 14px 24px;
  }

  .brand{gap:10px}
  .brand-left{gap:10px}
  .brand-mark{
    width:42px;
    height:42px;
    flex-basis:42px;
    border-radius:14px;
  }
  .brand-copy h1,.brand h1{
    font-size:18px;
    line-height:1.1;
  }
  .brand-copy small,.brand small{
    margin-top:3px;
    font-size:11px;
    line-height:1.25;
  }
  .icon-btn{
    width:42px;
    height:42px;
  }

  .hero-panel{
    padding:20px 18px;
    border-radius:24px;
  }
  .hero-panel h2{
    font-size:17px !important;
    line-height:1.25;
    letter-spacing:-.03em;
    margin-bottom:10px;
    word-break:keep-all;
  }
  .hero-panel p{
    font-size:12px;
    line-height:1.55;
    word-break:keep-all;
  }

  .v51-title{
    gap:12px;
    margin:4px 0 16px;
  }
  .v51-title-icon{
    font-size:24px;
  }
  .v51-title h2{
    font-size:18px;
    line-height:1.3;
    letter-spacing:-.03em;
    word-break:keep-all;
  }
  .v51-title p{
    margin-top:6px;
    font-size:12px;
    line-height:1.45;
  }

  .v51-game-card{
    padding:12px;
    border-radius:22px;
    gap:12px;
  }
  .v51-game-thumb{
    height:110px;
    border-radius:16px;
  }
  .v51-game-title-row h3{
    font-size:17px;
    line-height:1.2;
    margin:0;
  }
  .v51-game-title-row p{
    margin-top:4px;
    font-size:12px;
    line-height:1.4;
  }
  .v51-create-btn{
    height:44px;
    font-size:14px;
    font-weight:800;
    padding:0 14px;
  }
  .v51-create-btn b{
    padding-right:2px;
    font-size:20px;
  }

  .page-head{
    gap:10px;
  }
  .page-head h2{
    font-size:18px;
    line-height:1.2;
  }
  .page-head p{
    margin-top:4px;
    font-size:12px;
    line-height:1.45;
  }

  .pill{
    padding:6px 9px;
    font-size:11px;
  }
  .section-title{
    margin:22px 2px 10px;
  }
  .section-title h3{
    font-size:15px;
  }

  .room-list .surface-card, .rank-list .rank-item{
    border-radius:22px;
  }
  .room-card{
    gap:12px;
    padding:14px;
  }
  .room-card-head{
    gap:8px;
  }
  .room-card-head b{
    font-size:16px;
  }
  .room-meta-grid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .room-meta-box{
    padding:10px;
    border-radius:14px;
  }
  .room-meta-box span{
    font-size:10px;
    margin-bottom:3px;
  }
  .room-meta-box b{
    font-size:13px;
  }

  .rank-item{
    gap:10px;
    padding:14px;
    border-radius:20px;
  }
  .rank-item > div > b{
    font-size:16px;
    margin-bottom:8px;
  }
  .rank-item b:last-child{
    font-size:16px !important;
    letter-spacing:-.02em;
  }

  .info-card{
    padding:16px;
    border-radius:20px;
  }
  .info-card h4{
    font-size:15px;
    margin-bottom:8px;
  }
  .info-list{
    gap:8px;
  }
  .info-list li{
    padding:10px 12px;
    font-size:12px;
    line-height:1.5;
    border-radius:14px;
  }

  .bottom-nav{
    max-width:560px;
    height:calc(76px + env(safe-area-inset-bottom));
    padding:8px 10px calc(8px + env(safe-area-inset-bottom));
    gap:8px;
    border-radius:24px 24px 0 0;
  }
  .bottom-nav a{
    gap:6px;
    padding:8px 4px;
    font-size:10px;
    border-radius:18px;
  }
  .bottom-nav a span{
    font-size:18px;
  }
  .bottom-nav a b{
    font-size:12px;
    white-space:nowrap;
  }

  .app-modal__panel{
    width:100vw;
    max-height:88vh;
    border-radius:24px 24px 0 0;
    padding:16px 14px calc(16px + env(safe-area-inset-bottom));
  }
  .app-modal__head h3{
    font-size:20px;
    line-height:1.2;
  }
  .app-modal__head p{
    font-size:12px;
    line-height:1.45;
  }
  .field label,.field .field-title{
    font-size:12px;
    margin-bottom:6px;
  }
  .field input,.field select,.field textarea{
    padding:12px 13px;
    font-size:15px;
    border-radius:14px;
  }
  .field-help,.inline-note{
    font-size:11px;
    line-height:1.45;
  }
  .btn{
    padding:13px 16px;
    border-radius:16px;
    font-size:14px;
  }
}


/* v53 room / record mobile layout */
.room-summary-card{padding:18px}

.v53-room-list,.v53-record-list{
  display:grid;
  gap:14px;
}

.v53-room-card,.v53-record-card{
  display:grid;
  grid-template-columns:132px minmax(0,1fr);
  gap:16px;
  padding:16px;
  border-radius:28px;
  background:#fff;
  border:1px solid var(--v51-line);
  box-shadow:0 14px 36px rgba(22,36,65,.08);
  text-decoration:none;
  color:var(--v51-text);
}

.v53-room-thumb,.v53-record-thumb{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  background:linear-gradient(135deg,#edf3ff,#ffffff);
  min-height:132px;
}
.v53-record-thumb{min-height:96px}
.v53-room-thumb img,.v53-record-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.v53-room-thumb span,.v53-record-thumb span{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  font-size:34px;
  color:#fff;
}

.v53-room-card.theme-star .v53-room-thumb,
.v53-record-card.theme-star .v53-record-thumb{
  background:linear-gradient(135deg,#6b48ff 0%,#1ca8ff 100%);
}
.v53-room-card.theme-west .v53-room-thumb,
.v53-record-card.theme-west .v53-record-thumb{
  background:linear-gradient(135deg,#ffb04a 0%,#ff6b1c 100%);
}
.v53-room-card.theme-cube .v53-room-thumb,
.v53-record-card.theme-cube .v53-record-thumb{
  background:linear-gradient(135deg,#66c4ff 0%,#5a74ff 55%,#a65dff 100%);
}
.v53-room-card.theme-down .v53-room-thumb,
.v53-record-card.theme-down .v53-record-thumb{
  background:linear-gradient(135deg,#67e8f9 0%,#34d399 100%);
}
.v53-room-card.theme-flight .v53-room-thumb,
.v53-record-card.theme-flight .v53-record-thumb{
  background:linear-gradient(135deg,#7dd3fc 0%,#60a5fa 54%,#c084fc 100%);
}

.v53-room-body,.v53-record-body{
  min-width:0;
  display:grid;
  gap:12px;
}

.v53-room-top,.v53-record-body{
  align-items:start;
}
.v53-room-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.v53-room-title-area,.v53-record-main{min-width:0}
.v53-game-name{
  display:flex;
  align-items:center;
  gap:6px;
  color:#7f8ba2;
  font-size:13px;
  font-weight:900;
  letter-spacing:-.02em;
  margin-bottom:6px;
}
.v53-room-title-area h4,.v53-record-main h4{
  margin:0;
  font-size:20px;
  line-height:1.15;
  letter-spacing:-.04em;
  color:var(--v51-text);
  word-break:keep-all;
}
.v53-room-time{
  flex:0 0 auto;
  color:#7f8ba2;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  padding-top:2px;
}

.v53-room-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.v53-state-badge,.v53-soft-badge,.v53-stat-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid #e5ebf6;
  background:#f7f9fd;
  color:#6f7b93;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}
.v53-state-badge.state-open{background:#eef9ee;border-color:#d9efdc;color:#34a853}
.v53-state-badge.state-closed{background:#f2f4f8;border-color:#e0e5ee;color:#6f7b93}
.v53-state-badge.state-expired{background:#fff2f0;border-color:#ffd9d2;color:#d45845}

.v53-room-stat-line{
  display:grid;
  grid-template-columns:1fr 1px 1fr;
  gap:14px;
  align-items:center;
  min-height:52px;
  padding:0 16px;
  border-radius:18px;
  border:1px solid #e6edf7;
  background:#fff;
}
.v53-stat-divider{
  width:1px;
  height:22px;
  background:#e4e9f2;
}
.v53-stat-chip{
  justify-content:flex-start;
  padding:0;
  border:0;
  min-height:auto;
  background:transparent;
  font-size:14px;
}

.v53-room-bottom{
  display:grid;
  grid-template-columns:1fr auto;
  gap:14px;
  align-items:end;
}
.v53-room-mini-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.v53-room-mini-grid > div{
  padding:10px 12px;
  border-radius:16px;
  border:1px solid #e6edf7;
  background:#f8fafd;
}
.v53-room-mini-grid span{
  display:block;
  margin-bottom:3px;
  color:#8b97ad;
  font-size:11px;
  font-weight:700;
}
.v53-room-mini-grid b{
  display:block;
  font-size:15px;
  line-height:1.2;
  color:var(--v51-text);
}

.v53-room-actions{
  display:flex;
  gap:10px;
  align-items:center;
}
.v53-action-btn{
  min-width:88px;
  height:46px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid #e2e8f4;
  background:#fff;
  color:#68758d;
  font-size:15px;
  font-weight:900;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(22,36,65,.06);
}
.v53-action-btn.primary{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg,#a855f7,#7b3bed);
  box-shadow:0 14px 24px rgba(123,59,237,.22);
}
.v53-room-card.theme-west .v53-action-btn.primary{
  background:linear-gradient(135deg,#ffb347,#ff7b22);
  box-shadow:0 14px 24px rgba(255,123,34,.22);
}
.v53-room-card.theme-cube .v53-action-btn.primary{
  background:linear-gradient(135deg,#59bfff,#3387ff);
  box-shadow:0 14px 24px rgba(51,135,255,.22);
}
.v53-room-card.theme-down .v53-action-btn.primary{
  background:linear-gradient(135deg,#67e8f9,#34d399);
  box-shadow:0 14px 24px rgba(52,211,153,.22);
}

.v53-record-card{
  grid-template-columns:150px minmax(0,1fr);
  align-items:center;
}
.v53-record-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
}
.v53-record-sub{
  color:#7f8ba2;
  font-size:14px;
  line-height:1.45;
}
.v53-record-side{
  flex:0 0 auto;
  min-width:96px;
  text-align:right;
  padding-left:16px;
  border-left:1px solid #e7ecf5;
}
.v53-record-side b{
  display:block;
  margin-bottom:8px;
  font-size:20px;
  line-height:1.05;
  letter-spacing:-.03em;
  color:var(--v51-text);
  white-space:nowrap;
}
.v53-record-side span{
  display:block;
  color:#8793a8;
  font-size:13px;
  line-height:1.45;
}

@media (max-width: 560px){
  .room-summary-card{padding:15px}
  .v53-room-list,.v53-record-list{gap:12px}

  .v53-room-card,.v53-record-card{
    grid-template-columns:104px minmax(0,1fr);
    gap:12px;
    padding:12px;
    border-radius:24px;
  }
  .v53-room-thumb,.v53-record-thumb{
    min-height:104px;
    border-radius:18px;
  }
  .v53-record-thumb{min-height:86px}
  .v53-room-thumb span,.v53-record-thumb span{font-size:26px}

  .v53-game-name{
    font-size:11px;
    margin-bottom:5px;
  }
  .v53-room-title-area h4,.v53-record-main h4{
    font-size:16px;
    line-height:1.2;
  }
  .v53-room-time{
    font-size:11px;
    padding-top:1px;
  }

  .v53-room-badges{
    gap:6px;
  }
  .v53-state-badge,.v53-soft-badge,.v53-stat-chip{
    min-height:28px;
    padding:0 9px;
    border-radius:12px;
    font-size:11px;
  }

  .v53-room-stat-line{
    min-height:42px;
    padding:0 12px;
    gap:10px;
    border-radius:15px;
  }
  .v53-stat-divider{
    height:18px;
  }
  .v53-stat-chip{
    font-size:12px;
  }

  .v53-room-bottom{
    grid-template-columns:1fr;
    gap:10px;
  }
  .v53-room-mini-grid{
    gap:8px;
  }
  .v53-room-mini-grid > div{
    padding:9px 10px;
    border-radius:14px;
  }
  .v53-room-mini-grid span{
    font-size:10px;
  }
  .v53-room-mini-grid b{
    font-size:13px;
  }
  .v53-room-actions{
    gap:8px;
  }
  .v53-action-btn{
    flex:1 1 auto;
    min-width:0;
    height:42px;
    padding:0 12px;
    font-size:14px;
  }

  .v53-record-card{
    grid-template-columns:86px minmax(0,1fr);
  }
  .v53-record-body{
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
  }
  .v53-record-sub{
    font-size:12px;
  }
  .v53-record-side{
    min-width:74px;
    padding-left:10px;
  }
  .v53-record-side b{
    margin-bottom:6px;
    font-size:17px;
  }
  .v53-record-side span{
    font-size:11px;
    line-height:1.35;
  }
}

@media (max-width: 400px){
  .v53-room-card{
    grid-template-columns:1fr;
  }
  .v53-room-thumb{
    min-height:116px;
  }
  .v53-record-card{
    grid-template-columns:78px minmax(0,1fr);
    gap:10px;
  }
  .v53-record-side b{
    font-size:16px;
  }
}


/* v55: 만든 방 / 내 기록 모바일 전용 구조안 적용
   - 방 만들기: 1200x720 가로 배너 유지
   - 만든 방/내 기록: 512x512 게임 아이콘 우선 사용, 정사각형 표시
*/
.v53-room-card{
  grid-template-columns:88px minmax(0,1fr);
  gap:12px;
  padding:14px;
  border-radius:24px;
  align-items:start;
}
.v53-room-thumb{
  width:88px;
  min-height:88px;
  aspect-ratio:1/1;
  border-radius:20px;
  align-self:start;
}
.v53-room-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.v53-room-body{
  gap:8px;
}
.v53-room-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:start;
}
.v53-game-name{
  font-size:11px;
  margin-bottom:4px;
}
.v53-room-title-area h4{
  font-size:16px;
  line-height:1.18;
  max-width:100%;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.v53-room-time{
  font-size:11px;
  max-width:86px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.v53-room-badges{
  display:flex;
  flex-wrap:nowrap;
  overflow-x:auto;
  gap:6px;
  scrollbar-width:none;
}
.v53-room-badges::-webkit-scrollbar{display:none}
.v53-state-badge,.v53-soft-badge{
  min-height:25px;
  padding:0 8px;
  border-radius:999px;
  font-size:10.5px;
  flex:0 0 auto;
}
.v53-room-stat-line{
  min-height:36px;
  padding:0 10px;
  gap:8px;
  border-radius:14px;
}
.v53-stat-chip{
  font-size:11.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.v53-room-mini-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.v53-room-mini-grid > div{
  padding:8px 9px;
  border-radius:13px;
}
.v53-room-mini-grid span{
  font-size:9.5px;
}
.v53-room-mini-grid b{
  font-size:12.5px;
}
.v53-room-bottom{
  grid-template-columns:1fr;
  gap:8px;
}
.v53-room-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.v53-action-btn{
  height:39px;
  min-width:0;
  font-size:13px;
  padding:0 10px;
}

/* 기록은 썸네일보다 기록 수치가 주인공이 되도록 더 컴팩트하게 */
.v53-record-card{
  grid-template-columns:72px minmax(0,1fr);
  gap:11px;
  padding:12px;
  border-radius:22px;
  min-height:96px;
}
.v53-record-thumb{
  width:72px;
  min-height:72px;
  aspect-ratio:1/1;
  border-radius:17px;
  align-self:center;
}
.v53-record-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.v53-record-body{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
}
.v53-record-main h4{
  font-size:15px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.v53-record-sub{
  font-size:11.5px;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.v53-record-side{
  min-width:66px;
  padding-left:8px;
}
.v53-record-side b{
  font-size:16px;
  margin-bottom:5px;
}
.v53-record-side span{
  font-size:10px;
  line-height:1.35;
}

@media (max-width:400px){
  .v53-room-card{
    grid-template-columns:80px minmax(0,1fr);
    padding:12px;
  }
  .v53-room-thumb{width:80px;min-height:80px;border-radius:18px}
  .v53-room-title-area h4{font-size:15px}
  .v53-room-time{display:none}
  .v53-record-card{
    grid-template-columns:64px minmax(0,1fr);
  }
  .v53-record-thumb{width:64px;min-height:64px}
  .v53-record-side b{font-size:15px}
}

/* 관리자 도움말 */
.admin-game-form .field-help b{font-weight:900}

/* UX cleanup: shared controls */
.btn{
  min-height:46px;
  border-radius:16px;
  font-weight:900;
}
.surface-card,
.card,
.admin-panel,
.info-card,
.v53-room-card,
.v53-record-card{
  border-radius:20px;
}
.bottom-nav a{
  min-height:54px;
  border-radius:16px;
}
.bottom-nav a.active{
  box-shadow:inset 0 0 0 1px rgba(35,136,246,.16);
}
.field input,
.field select,
.field textarea{
  border-radius:16px;
}
.page-head h2,
.section-title h3,
.brand-copy h1,
.brand h1{
  letter-spacing:0;
}

/* Main header brand layout */
.ui-white-topbar .brand{
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  align-items:center;
  gap:12px;
}
.ui-white-topbar .brand-left{
  min-width:0;
  display:grid;
  grid-template-columns:54px minmax(0,1fr);
  align-items:center;
  gap:12px;
}
.ui-white-topbar .brand-mark{
  width:54px;
  height:54px;
  aspect-ratio:1/1;
  flex-basis:auto;
  border-radius:16px;
}
.ui-white-topbar .brand-mark img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.ui-white-topbar .brand-copy{
  min-width:0;
  display:grid;
  grid-template-rows:auto auto;
  align-content:center;
  gap:3px;
}
.ui-white-topbar .brand-copy h1{
  margin:0;
  font-size:25px;
  line-height:1.05;
}
.ui-white-topbar .brand-copy small{
  margin:0;
  font-size:12px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ui-white-topbar .settings-icon-btn{
  width:48px;
  height:48px;
  border:0;
  background:transparent;
  box-shadow:none;
  color:#1f2a44;
  font-size:30px;
  line-height:1;
}
.ui-white-topbar .settings-icon-btn:active{
  transform:scale(.96);
}
.create-page{
  gap:10px;
}
.v51-page .v51-title{
  margin-bottom:8px;
}
.v51-page .v51-title p{
  margin-top:5px;
}
.v51-game-info{
  gap:14px;
}
.create-modal-form{
  gap:12px;
}
.create-modal-form .field-help{
  display:none;
}
.modal-option-list{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
.modal-field-row{
  display:grid;
  grid-template-columns:34px 96px minmax(0,1fr);
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid #e5ebf6;
  border-radius:16px;
  background:#f8faff;
}
.modal-field-row[hidden]{
  display:none;
}
.modal-field-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#eef3ff;
  color:#5868d9;
  font-weight:900;
  font-size:17px;
}
.modal-field-row label{
  margin:0;
  color:#44516a;
  font-size:14px;
  white-space:nowrap;
}
.modal-field-row input,
.modal-field-row select{
  min-width:0;
  height:42px;
  padding:0 12px;
  border-radius:12px;
  background:#fff;
}
.modal-actions{
  margin-top:2px;
}

/* 560px app frame compact sizing: applies on desktop too because the frame is fixed-width. */
.topbar,.ui-white-topbar{
  padding:12px 14px 10px !important;
}
.page{
  padding:14px 14px 24px;
}
.brand{gap:10px}
.brand-left{gap:10px}
.brand-mark{
  width:42px;
  height:42px;
  flex-basis:42px;
  border-radius:14px;
}
.brand-copy h1,.brand h1{
  font-size:18px;
  line-height:1.1;
}
.brand-copy small,.brand small{
  margin-top:3px;
  font-size:11px;
  line-height:1.25;
}
.icon-btn{
  width:42px;
  height:42px;
}
.ui-white-topbar .brand{
  grid-template-columns:minmax(0,1fr) 44px;
  gap:8px;
}
.ui-white-topbar .brand-left{
  grid-template-columns:48px minmax(0,1fr);
  gap:10px;
}
.ui-white-topbar .brand-mark{
  width:48px;
  height:48px;
  border-radius:14px;
}
.ui-white-topbar .brand-copy h1{
  font-size:22px;
}
.ui-white-topbar .settings-icon-btn{
  width:44px;
  height:44px;
  font-size:28px;
}
.hero-panel{
  padding:20px 18px;
  border-radius:24px;
}
.hero-panel h2{
  font-size:17px !important;
  line-height:1.25;
  letter-spacing:-.03em;
  margin-bottom:10px;
  word-break:keep-all;
}
.hero-panel p{
  font-size:12px;
  line-height:1.55;
  word-break:keep-all;
}
.v51-title{
  gap:12px;
  margin:4px 0 16px;
}
.v51-title-icon{
  font-size:24px;
}
.v51-title h2{
  font-size:18px;
  line-height:1.3;
  letter-spacing:-.03em;
  word-break:keep-all;
}
.v51-title p{
  margin-top:6px;
  font-size:12px;
  line-height:1.45;
}
.v51-game-card{
  padding:12px;
  border-radius:22px;
  gap:12px;
}
.v51-game-thumb{
  height:110px;
  border-radius:16px;
}
.v51-game-title-row h3{
  font-size:17px;
  line-height:1.2;
  margin:0;
}
.v51-game-title-row p{
  margin-top:4px;
  font-size:12px;
  line-height:1.4;
}
.v51-create-btn{
  height:44px;
  font-size:14px;
  font-weight:800;
  padding:0 14px;
}
.v51-create-btn b{
  padding-right:2px;
  font-size:20px;
}
.page-head{
  gap:10px;
}
.page-head h2{
  font-size:18px;
  line-height:1.2;
}
.page-head p{
  margin-top:4px;
  font-size:12px;
  line-height:1.45;
}
.pill{
  padding:6px 9px;
  font-size:11px;
}
.section-title{
  margin:22px 2px 10px;
}
.section-title h3{
  font-size:15px;
}
.room-list .surface-card, .rank-list .rank-item{
  border-radius:22px;
}
.room-card{
  gap:12px;
  padding:14px;
}
.room-card-head{
  gap:8px;
}
.room-card-head b{
  font-size:16px;
}
.room-meta-grid{
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.room-meta-box{
  padding:10px;
  border-radius:14px;
}
.room-meta-box span{
  font-size:10px;
  margin-bottom:3px;
}
.room-meta-box b{
  font-size:13px;
}
.rank-item{
  gap:10px;
  padding:14px;
  border-radius:20px;
}
.rank-item > div > b{
  font-size:16px;
  margin-bottom:8px;
}
.rank-item b:last-child{
  font-size:16px !important;
  letter-spacing:-.02em;
}
.info-card{
  padding:16px;
  border-radius:20px;
}
.info-card h4{
  font-size:15px;
  margin-bottom:8px;
}
.info-list{
  gap:8px;
}
.info-list li{
  padding:10px 12px;
  font-size:12px;
  line-height:1.5;
  border-radius:14px;
}
.bottom-nav{
  height:calc(66px + env(safe-area-inset-bottom));
  padding:6px 10px calc(6px + env(safe-area-inset-bottom));
  gap:6px;
  border-radius:22px 22px 0 0;
}
.bottom-nav a{
  gap:2px;
  padding:5px 3px;
  font-size:10px;
  border-radius:16px;
}
.bottom-nav a span{
  font-size:16px;
}
.bottom-nav a b{
  font-size:12px;
  white-space:nowrap;
}

/* Five-tab bottom navigation */
.bottom-nav{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.bottom-nav a{
  min-width:0;
  flex-direction:column;
  gap:2px;
}
.bottom-nav a span{
  font-size:16px;
}
.bottom-nav a b{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:11px;
}
@media (max-width:360px){
  .bottom-nav{
    gap:4px;
    padding-inline:7px;
  }
  .bottom-nav a b{
    font-size:10px;
  }
  .weekly-rank-item{
    grid-template-columns:30px minmax(0,1fr) auto;
    gap:7px;
    padding:8px 9px;
  }
  .weekly-rank-item strong{
    font-size:15px;
  }
}

@media (max-width:420px){
  .ui-white-topbar{
    padding:14px 14px 10px;
  }
  .ui-white-topbar .brand{
    grid-template-columns:minmax(0,1fr) 44px;
    gap:8px;
  }
  .ui-white-topbar .brand-left{
    grid-template-columns:48px minmax(0,1fr);
    gap:10px;
  }
  .ui-white-topbar .brand-mark{
    width:48px;
    height:48px;
    border-radius:14px;
  }
  .ui-white-topbar .brand-copy h1{
    font-size:22px;
  }
  .ui-white-topbar .settings-icon-btn{
    width:44px;
    height:44px;
    font-size:28px;
  }
  .modal-field-row{
    grid-template-columns:32px 82px minmax(0,1fr);
    gap:8px;
    padding:9px;
  }
  .modal-field-icon{
    width:32px;
    height:32px;
    border-radius:11px;
    font-size:16px;
  }
  .modal-field-row label{
    font-size:13px;
  }
  .modal-field-row input,
  .modal-field-row select{
    height:40px;
    font-size:14px;
  }
}

/* Made rooms: concise list cards */
.v53-room-card{
  grid-template-columns:96px minmax(0,1fr);
  gap:14px;
  align-items:stretch;
  padding:14px;
}
.v53-room-thumb{
  width:96px;
  min-height:96px;
  aspect-ratio:1/1;
  border-radius:20px;
}
.v53-room-body{
  display:grid;
  grid-template-rows:auto auto 1fr;
  gap:10px;
  min-width:0;
}
.v53-room-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:start;
}
.v53-room-title-area h4{
  font-size:17px;
  line-height:1.22;
}
.v53-state-badge{
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
}
.v53-room-dates{
  display:flex;
  flex-wrap:wrap;
  gap:4px 10px;
  color:#728098;
  font-size:12px;
  line-height:1.35;
}
.v53-room-dates span{
  color:#68758d;
  font-weight:500;
  white-space:nowrap;
}
.v53-room-dates b{
  margin-right:3px;
  color:#4f63d7;
  font-size:13px;
  font-weight:900;
}
.v53-room-dates span:nth-child(2) b{
  color:#e06b2f;
}
.v53-room-actions{
  align-self:end;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.v53-action-btn{
  height:40px;
  min-width:0;
  border-radius:14px;
  font-size:14px;
}

@media (max-width:420px){
  .v53-room-card{
    grid-template-columns:88px minmax(0,1fr);
    gap:12px;
    padding:12px;
  }
  .v53-room-thumb{
    width:88px;
    min-height:88px;
    border-radius:18px;
  }
  .v53-game-name{
    font-size:10.5px;
  }
  .v53-room-title-area h4{
    font-size:15px;
  }
  .v53-state-badge{
    min-height:24px;
    padding:0 8px;
    font-size:10.5px;
  }
  .v53-room-dates{
    gap:3px 8px;
    font-size:10.5px;
  }
  .v53-action-btn{
    height:38px;
    font-size:13px;
  }
}
