:root {
  color-scheme: dark;
  --bg: #111811;
  --surface: #19231c;
  --surface-raised: #202c23;
  --surface-soft: #253329;
  --border: rgba(224, 232, 212, .1);
  --text: #f1f1e8;
  --muted: #a5b09f;
  --faint: #778274;
  --gold: #e2b86d;
  --gold-strong: #f2c879;
  --green: #a5c28a;
  --red: #e48678;
  --radius: 18px;
  font-family: "DM Sans", "Gowun Dodum", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 70% -10%, rgba(102, 119, 72, .16), transparent 42%),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: 246px;
  padding: 30px 18px 22px;
  border-right: 1px solid var(--border);
  background: rgba(17, 24, 17, .9);
  z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--gold);
  color: #172019;
  font-family: "Gowun Dodum", sans-serif;
  font-size: 19px;
  box-shadow: 0 5px 20px rgba(226, 184, 109, .16);
}
.side-nav { display: grid; gap: 7px; margin-top: 52px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background .2s, color .2s;
}
.nav-link > span { width: 18px; color: var(--faint); text-align: center; font-size: 19px; }
.nav-link:hover, .nav-link.is-active { background: var(--surface-raised); color: var(--text); }
.nav-link.is-active > span { color: var(--gold); }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; color: var(--muted); font-size: 12px; }
.sidebar-foot p { margin: 10px 0 0; color: var(--faint); font-size: 11px; line-height: 1.7; }
.online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 99px; background: var(--green); box-shadow: 0 0 10px rgba(165, 194, 138, .5); }
.mobile-topbar, .mobile-nav { display: none; }
.main-content { max-width: 1240px; min-height: 100vh; margin-left: 246px; padding: 42px clamp(24px, 5vw, 72px) 56px; }
.page-wrap { width: 100%; max-width: 1040px; margin: 0 auto; }
.eyebrow { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 29px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: "Gowun Dodum", sans-serif; font-size: clamp(27px, 3.4vw, 40px); font-weight: 400; letter-spacing: -.06em; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border: 1px solid var(--border); border-radius: 99px; background: rgba(32, 44, 35, .6); }
.avatar-small, .avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #4b6248;
  color: #f2f1dc;
  font-weight: 700;
}
.avatar-small { width: 32px; height: 32px; font-size: 12px; }
.profile-chip span { color: var(--muted); font-size: 12px; }
.hero-card {
  position: relative;
  display: flex;
  min-height: 242px;
  align-items: center;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid rgba(226, 184, 109, .2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 86% 50%, rgba(226, 184, 109, .17), transparent 23%),
    linear-gradient(110deg, #253226 0%, #1e2c22 50%, #293426 100%);
}
.hero-card::before, .hero-card::after { position: absolute; content: ""; border: 1px solid rgba(226, 184, 109, .12); border-radius: 50%; }
.hero-card::before { width: 290px; height: 290px; right: 4%; top: -25px; }
.hero-card::after { width: 220px; height: 220px; right: calc(4% + 35px); top: 10px; }
.hero-copy { position: relative; z-index: 1; max-width: 550px; }
.hero-copy h2 { margin: 12px 0 9px; font-family: "Gowun Dodum", sans-serif; font-size: clamp(25px, 3.4vw, 38px); font-weight: 400; letter-spacing: -.055em; }
.hero-copy p { max-width: 420px; margin-bottom: 22px; color: #bdc7b6; font-size: 14px; line-height: 1.7; }
.hero-orb { position: absolute; right: 12%; z-index: 1; display: grid; width: 100px; height: 100px; place-items: center; border: 1px solid rgba(242, 200, 121, .5); border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffdf98, #c28d4f 66%, #715638); box-shadow: 0 0 55px rgba(226, 184, 109, .2); color: #2b2a1f; font-size: 39px; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--gold);
  color: #1b2118;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:hover { transform: translateY(-1px); background: var(--gold-strong); }
.button:active { transform: translateY(0); }
.button.secondary { border-color: var(--border); background: var(--surface-raised); color: var(--text); }
.button.secondary:hover { border-color: rgba(226, 184, 109, .3); background: var(--surface-soft); }
.button.subtle { background: transparent; color: var(--muted); }
.button.wide { width: 100%; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 34px 0 15px; }
.section-heading h2 { margin: 0; font-size: 17px; font-weight: 600; }
.section-heading p { margin: 0; color: var(--faint); font-size: 12px; }
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.mode-card {
  display: flex;
  min-height: 188px;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 17px 15px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(32, 44, 35, .92), rgba(25, 35, 28, .92));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, transform .2s, background .2s;
}
.mode-card:hover { transform: translateY(-3px); border-color: rgba(226, 184, 109, .42); background: var(--surface-raised); }
.mode-icon { display: grid; width: 39px; height: 39px; margin-bottom: 14px; place-items: center; border-radius: 13px; background: rgba(226, 184, 109, .12); color: var(--gold); font-size: 18px; }
.mode-card:nth-child(2) .mode-icon { background: rgba(162, 143, 205, .14); color: #bdaddf; }
.mode-card:nth-child(3) .mode-icon { background: rgba(113, 169, 153, .14); color: #99ccb9; }
.mode-card:nth-child(4) .mode-icon { background: rgba(218, 131, 113, .13); color: #e89d8e; }
.mode-card strong { font-size: 14px; }
.mode-card p { margin: 6px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.mode-meta { margin-top: auto; color: var(--faint); font-size: 10px; }
.feature-row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 13px; margin-top: 20px; }
.feature-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: rgba(25, 35, 28, .72); }
.feature-card h3 { margin: 0 0 6px; font-size: 13px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.feature-card .inline-link { display: inline-block; margin-top: 10px; color: var(--gold); font-size: 11px; font-weight: 600; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .8fr); align-items: start; gap: 18px; }
.game-main, .game-side { display: grid; gap: 14px; }
.panel { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(25, 35, 28, .9); }
.phase-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border: 1px solid rgba(226, 184, 109, .2); border-radius: 16px; background: linear-gradient(110deg, rgba(68, 63, 39, .48), rgba(35, 45, 35, .7)); }
.phase-label { display: flex; align-items: center; gap: 12px; }
.phase-symbol { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: rgba(226, 184, 109, .15); color: var(--gold); font-size: 19px; }
.phase-label strong { display: block; margin-bottom: 4px; font-size: 14px; }
.phase-label small { color: var(--muted); font-size: 11px; }
.phase-count { color: var(--gold); font-size: 12px; font-weight: 600; }
.section-title { margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.role-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid rgba(226, 184, 109, .2); border-radius: 14px; background: rgba(226, 184, 109, .06); }
.role-stamp { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: rgba(226, 184, 109, .16); color: var(--gold); font-size: 20px; }
.role-card strong { display: block; margin-bottom: 5px; font-size: 14px; }
.role-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.player-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.player-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 91px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}
.player-card:hover:not(:disabled), .player-card.is-selected { border-color: var(--gold); background: rgba(226, 184, 109, .1); }
.player-card:disabled { cursor: default; opacity: .48; }
.player-card.is-dead { filter: grayscale(.8); opacity: .38; }
.avatar { width: 34px; height: 34px; font-size: 12px; }
.player-name { max-width: 100%; overflow: hidden; color: #d9ddd1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.player-tag { position: absolute; top: 5px; right: 5px; color: var(--faint); font-size: 8px; }
.player-card.is-self .avatar { box-shadow: 0 0 0 2px var(--gold); }
.player-list-compact { display: grid; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 11px; background: rgba(32, 44, 35, .58); }
.player-row .avatar { width: 29px; height: 29px; font-size: 10px; }
.player-row span { font-size: 11px; }
.player-row small { margin-left: auto; color: var(--faint); font-size: 9px; }
.chat-feed { display: grid; gap: 10px; max-height: 240px; overflow-y: auto; padding: 2px 1px 4px; }
.chat-line { display: flex; gap: 9px; align-items: flex-start; }
.chat-line .avatar { width: 28px; height: 28px; font-size: 9px; }
.chat-bubble { max-width: 90%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 3px 12px 12px; background: var(--surface-raised); color: #dfe2d8; font-size: 11px; line-height: 1.55; }
.chat-bubble strong { display: block; margin-bottom: 3px; color: var(--gold); font-size: 10px; }
.chat-line.is-self .chat-bubble { border-color: rgba(165, 194, 138, .2); background: rgba(91, 116, 77, .14); }
.chat-line.is-system .chat-bubble { max-width: none; border: 0; background: transparent; color: var(--muted); }
.action-options { display: grid; gap: 8px; margin: 12px 0; }
.option-button { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: #202b22; color: #dce3d6; cursor: pointer; font-size: 11px; line-height: 1.5; text-align: left; }
.option-button:hover, .option-button.is-selected { border-color: rgba(226, 184, 109, .7); background: rgba(226, 184, 109, .09); }
.action-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.action-hint { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.5; }
.room-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px dashed rgba(226, 184, 109, .22); border-radius: 12px; color: var(--muted); font-size: 11px; }
.room-code strong { color: var(--gold); letter-spacing: .13em; }
.room-note { margin: 10px 0 0; color: var(--faint); font-size: 10px; line-height: 1.6; }
.empty-state { padding: 34px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty-state .empty-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 17px; background: var(--surface-soft); color: var(--gold); font-size: 24px; }
.empty-state h2 { margin-bottom: 9px; font-family: "Gowun Dodum", sans-serif; font-weight: 400; }
.empty-state p { max-width: 500px; margin: 0 auto 19px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.guide-card { padding: 19px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.guide-number { margin-bottom: 12px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.guide-card h2 { margin-bottom: 8px; font-size: 15px; }
.guide-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.shop-item { padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.shop-art { display: grid; height: 98px; margin-bottom: 13px; place-items: center; border-radius: 12px; background: radial-gradient(circle, rgba(226, 184, 109, .18), rgba(32, 44, 35, .4) 65%); color: var(--gold); font-size: 34px; }
.shop-item h2 { margin-bottom: 5px; font-size: 13px; }
.shop-item p { min-height: 32px; margin-bottom: 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.shop-item .button { min-height: 37px; font-size: 11px; }
.account-panel { display: grid; gap: 13px; }
.progress-card { display: grid; gap: 9px; padding: 15px; border: 1px solid rgba(226,184,109,.23); border-radius: 14px; background: linear-gradient(135deg, rgba(226,184,109,.09), rgba(32,44,35,.7)); }
.progress-card > div:first-child { display: flex; align-items: baseline; gap: 11px; }
.progress-card .eyebrow { margin: 0; color: var(--gold); font-size: 9px; }
.progress-card strong { font-size: 19px; }
.progress-card span, .progress-card small { color: var(--muted); font-size: 11px; }
.rank-badge { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; width: fit-content; min-width: 150px; padding: 9px 12px; border: 1px solid var(--rank-accent); border-radius: 11px; background: linear-gradient(110deg, color-mix(in srgb, var(--rank-accent) 20%, transparent), rgba(16,26,32,.9)); }
.rank-badge > span { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--rank-accent); border-radius: 50%; color: var(--rank-accent); font-size: 10px; font-weight: 800; }
.rank-badge strong { color: var(--rank-accent); font-size: 14px; }
.rank-badge small { color: var(--muted); font-size: 9px; }
.rank-theme-bronze { --rank-accent: #c28a57; }
.rank-theme-silver { --rank-accent: #c2cbd1; }
.rank-theme-gold { --rank-accent: #e4bd5e; }
.rank-theme-platinum { --rank-accent: #80d8d1; }
.rank-theme-diamond { --rank-accent: #79baff; }
.rank-theme-master { --rank-accent: #a48cff; }
.rank-theme-grandmaster { --rank-accent: #eb7d73; }
.rank-theme-challenger { --rank-accent: #f09050; }
.rank-theme-legend { --rank-accent: #edcf79; }
.rank-theme-mythic { --rank-accent: #e385d7; }
.progress-meter, .mvp-meter { height: 8px; overflow: hidden; border-radius: 99px; background: #101a20; }
.progress-meter i, .mvp-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #83a98c, #e2b86d); }
.record-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.record-grid > div { display: grid; gap: 4px; padding: 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: center; }
.record-grid strong { color: var(--gold); font-size: 18px; }
.record-grid span { color: var(--muted); font-size: 9px; }
.notice { margin-top: 18px; padding: 14px 16px; border: 1px solid rgba(226, 184, 109, .18); border-radius: 13px; background: rgba(226, 184, 109, .05); color: var(--muted); font-size: 11px; line-height: 1.7; }
.notice strong { color: var(--gold); }
.nickname-form { display: flex; max-width: 480px; gap: 9px; }
.nickname-form input { min-width: 0; flex: 1; padding: 0 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-raised); color: var(--text); }
.resume-room-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 13px 15px; border: 1px solid rgba(226,184,109,.4); border-radius: 14px; background: linear-gradient(110deg, rgba(226,184,109,.14), rgba(32,44,35,.84)); }
.resume-room-card > div { display: grid; gap: 4px; min-width: 0; }
.resume-room-card strong { color: var(--gold); font-size: 13px; }
.resume-room-card span { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.5; }
.resume-room-card .button { flex: 0 0 auto; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; transform: translateY(15px); border: 1px solid var(--border); border-radius: 12px; background: #263328; color: var(--text); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

body.is-auth { overflow-x: hidden; overflow-y: auto; }
body.is-auth .sidebar, body.is-auth .mobile-topbar, body.is-auth .mobile-nav { display: none; }
body.is-auth .main-content { max-width: none; min-height: 100vh; margin: 0; padding: 0; }
.auth-page { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); background: #121a14; }
.auth-art { position: relative; min-height: 100vh; overflow: hidden; background: #202c22; }
.auth-art::after { position: absolute; inset: 0; z-index: 1; content: ""; background: linear-gradient(90deg, rgba(16, 24, 18, .78), rgba(16, 24, 18, .17)), linear-gradient(0deg, rgba(16, 24, 18, .72), transparent 56%); }
.auth-art .weather-scene { position: absolute; inset: 0; height: 100%; border: 0; border-radius: 0; }
.auth-art .weather-hills { height: 43%; }
.auth-art .weather-village { bottom: 16%; }
.auth-art-copy { position: absolute; bottom: 10%; left: clamp(32px, 7vw, 100px); z-index: 2; max-width: 480px; }
.auth-art-copy h1 { margin: 17px 0 13px; font-size: clamp(36px, 4vw, 56px); line-height: 1.3; }
.auth-art-copy p:last-child { color: #c5cbbd; font-size: 15px; line-height: 1.9; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 6vw, 82px); }
.auth-panel > .brand { align-self: flex-start; }
.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth-form-wrap > .eyebrow { margin-bottom: 12px; }
.auth-form-wrap h2 { margin-bottom: 8px; font-family: "Gowun Dodum", sans-serif; font-size: 30px; font-weight: 400; letter-spacing: -.05em; }
.auth-subtitle { margin-bottom: 25px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.form-stack { display: grid; gap: 15px; }
.form-stack > label { display: grid; gap: 7px; color: #d8ded2; font-size: 11px; font-weight: 600; }
.form-stack input, .form-stack select, .join-form input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #1a241c;
  color: var(--text);
  font-size: 12px;
}
.form-stack input::placeholder, .join-form input::placeholder { color: #6e7b6d; }
.form-stack select { appearance: auto; }
.form-stack .button { margin-top: 3px; }
.form-stack .consent { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.7; }
.form-stack .consent input { width: 15px; min-height: 15px; height: 15px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--gold); }
.consent a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-switch button { padding: 0 3px; border: 0; background: transparent; color: var(--gold); cursor: pointer; font-weight: 700; }
.auth-footnote { margin: 20px 0 0; color: var(--faint); font-size: 10px; line-height: 1.6; text-align: center; }
.service-hero { position: relative; display: flex; min-height: 250px; align-items: center; overflow: hidden; padding: 34px clamp(23px, 4vw, 46px); border: 1px solid rgba(226,184,109,.17); border-radius: 23px; background: #202d23; }
.service-hero .weather-scene { position: absolute; top: 0; right: 0; width: 52%; height: 100%; border: 0; border-radius: 0; }
.service-hero-copy { position: relative; z-index: 2; max-width: 57%; }
.service-hero-copy h2 { margin: 11px 0 8px; font-family: "Gowun Dodum", sans-serif; font-size: clamp(26px, 3.2vw, 38px); font-weight: 400; letter-spacing: -.06em; line-height: 1.35; }
.service-hero-copy > p:not(.eyebrow) { max-width: 440px; margin-bottom: 18px; color: #bdc7b6; font-size: 12px; line-height: 1.7; }
.weather-scene {
  --sky-a: #1d2828;
  --sky-b: #334137;
  --horizon: #687453;
  position: relative;
  display: block;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid rgba(225, 230, 208, .1);
  border-radius: 18px;
  background: radial-gradient(ellipse at 77% 29%, rgba(226,184,109,.17), transparent 19%), linear-gradient(180deg, var(--sky-a), var(--sky-b) 64%, #384435);
  isolation: isolate;
  transition: background 1s ease;
}
.weather-scene[data-weather="rain"] { --sky-a: #172329; --sky-b: #29373b; --horizon: #455a50; }
.weather-scene[data-weather="fog"] { --sky-a: #414d48; --sky-b: #58645a; --horizon: #79816c; }
.weather-scene[data-weather="snow"] { --sky-a: #273641; --sky-b: #55636a; --horizon: #9ca895; }
.weather-scene[data-weather="wind"] { --sky-a: #293127; --sky-b: #414a38; --horizon: #68704c; }
.weather-scene::before { position: absolute; inset: 0; z-index: 4; content: ""; background: linear-gradient(0deg, rgba(12,19,14,.4), transparent 55%); pointer-events: none; }
.weather-moon { position: absolute; top: 14%; right: 20%; z-index: 0; display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid rgba(247,223,163,.4); border-radius: 50%; background: rgba(246,224,173,.83); box-shadow: 0 0 36px rgba(239,207,140,.32); color: #56553f; font-size: 22px; }
.weather-scene[data-weather="rain"] .weather-moon, .weather-scene[data-weather="fog"] .weather-moon { opacity: .48; }
.weather-cloud { position: absolute; top: 37%; z-index: 1; width: 76px; height: 18px; border-radius: 99px; background: rgba(173,187,166,.12); filter: blur(4px); }
.cloud-one { right: 27%; }
.cloud-two { top: 27%; right: 54%; width: 56px; opacity: .65; }
.weather-hills { position: absolute; right: -10%; bottom: 20%; left: -8%; z-index: 1; height: 35%; border-radius: 48% 52% 0 0 / 28% 35% 0 0; background: linear-gradient(140deg, #42533d, var(--horizon)); transform: rotate(-2deg); }
.weather-hills::before { position: absolute; right: 42%; bottom: -17%; left: -9%; height: 70%; border-radius: 50% 50% 0 0; content: ""; background: #344636; }
.weather-village { position: absolute; right: 6%; bottom: 13%; left: 7%; z-index: 2; display: flex; height: 42%; align-items: flex-end; justify-content: space-around; }
.weather-village i { position: relative; display: block; width: 13%; height: 57%; border: 1px solid rgba(229,211,165,.12); background: linear-gradient(90deg, #29352a, #44513d 45%, #303a2e); clip-path: polygon(50% 0,100% 29%,100% 100%,0 100%,0 29%); }
.weather-village i:nth-child(2) { width: 17%; height: 81%; }
.weather-village i:nth-child(3) { width: 12%; height: 46%; }
.weather-village i:nth-child(4) { width: 16%; height: 68%; }
.weather-village i:nth-child(5) { width: 11%; height: 51%; }
.weather-village i::after { position: absolute; top: 48%; left: 42%; width: 19%; height: 19%; border-radius: 2px; content: ""; background: rgba(239,187,96,.8); box-shadow: 0 0 9px rgba(239,187,96,.6); }
.weather-caption { position: absolute; right: 13px; bottom: 10px; z-index: 5; color: rgba(241,241,232,.72); font-size: 9px; letter-spacing: .04em; }
.weather-particles { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; }
[data-weather="rain"] .weather-particles { opacity: .42; background: repeating-linear-gradient(110deg, transparent 0 21px, rgba(201,221,226,.5) 22px, transparent 23px 31px); animation: rainfall .7s linear infinite; }
[data-weather="snow"] .weather-particles { opacity: .8; background-image: radial-gradient(2px 2px at 16px 24px, #fff 60%, transparent), radial-gradient(2px 2px at 86px 63px, #fff 60%, transparent), radial-gradient(1.5px 1.5px at 137px 18px, #fff 60%, transparent); background-size: 130px 100px; animation: snowfall 5s linear infinite; }
[data-weather="fog"] .weather-particles { opacity: .45; background: linear-gradient(0deg, rgba(220,225,212,.23), transparent 58%); filter: blur(8px); animation: mist 7s ease-in-out infinite alternate; }
[data-weather="wind"] .weather-particles { opacity: .34; background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(220,217,179,.24) 23px, transparent 24px 38px); animation: gust 4s ease-in-out infinite alternate; }
.weather-scene.is-compact { min-height: 165px; margin-bottom: 17px; }
.weather-scene.is-compact .weather-village { bottom: 12%; }
.weather-scene.is-compact .weather-caption { bottom: 8px; }
.live-scene { position: relative; height: 206px; overflow: hidden; margin-bottom: 17px; border: 1px solid var(--border); border-radius: 20px; }
.live-scene .weather-scene { position: absolute; inset: 0; height: 100%; border: 0; border-radius: 0; }
.live-scene .weather-moon { width: 52px; height: 52px; font-size: 28px; }
.live-scene .weather-village { height: 52%; }
.scene-overlay-copy { position: absolute; right: 25px; bottom: 20px; left: 25px; z-index: 5; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.scene-overlay-copy p { max-width: 53%; margin: 0; color: rgba(244,244,230,.9); font-family: "Gowun Dodum", sans-serif; font-size: 16px; text-align: right; text-shadow: 0 2px 8px #1c231e; }
.weather-badge { padding: 7px 10px; border: 1px solid rgba(240,236,210,.18); border-radius: 99px; background: rgba(20,28,22,.55); color: #f1e4c6; font-size: 10px; white-space: nowrap; backdrop-filter: blur(8px); }
.lobby-grid { display: grid; width: 100%; max-width: 1080px; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 14px; margin: 14px auto 0; }
.lobby-grid > .panel { max-width: none; min-width: 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-title-row h2 { margin: 3px 0 0; font-size: 16px; }
.section-title-row .eyebrow { font-size: 9px; }
.section-kicker { color: var(--faint); font-size: 10px; white-space: nowrap; }
.join-form { display: flex; gap: 9px; }
.join-form input { min-width: 0; flex: 1; text-transform: uppercase; letter-spacing: .15em; }
.form-hint { margin: 10px 0 0; color: var(--faint); font-size: 10px; line-height: 1.65; }
.room-list-section { margin-top: 31px; }
.room-list-section .section-title-row { margin-bottom: 13px; }
.room-list-section .section-title-row h2 { font-size: 17px; }
.open-room-list { display: grid; gap: 8px; }
.open-room-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(25,35,28,.84); }
.open-room-info { min-width: 0; flex: 1; }
.open-room-info strong, .open-room-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-room-info strong { margin-bottom: 4px; font-size: 12px; }
.open-room-info small { color: var(--muted); font-size: 10px; }
.room-count { color: var(--gold); font-size: 10px; white-space: nowrap; }
.open-room-card .button { min-height: 35px; padding: 0 12px; font-size: 10px; }
.waiting-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, .75fr); gap: 15px; align-items: start; }
.waiting-main { min-width: 0; }
.waiting-aside { display: grid; gap: 12px; }
.waiting-aside .weather-scene { margin: 0; }
.room-roster-heading { margin: 20px 0 13px; }
.room-roster-heading h2 span { color: var(--gold); font-size: 12px; font-weight: 500; }
.roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.roster-card { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: rgba(32,44,35,.62); }
.roster-avatar, .user-avatar { display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #526d55; color: #f1f1e8; font-weight: 700; }
.roster-avatar { width: 33px; height: 33px; font-size: 11px; }
.hue-1 { background: #75634d; }.hue-2 { background: #5c6378; }.hue-3 { background: #795b61; }.hue-4 { background: #56706d; }.hue-5 { background: #777052; }.hue-6 { background: #685d7b; }.hue-7 { background: #4d6b7a; }
.roster-name { min-width: 0; flex: 1; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.roster-name small { display: inline-block; margin-left: 5px; color: var(--gold); font-size: 8px; }
.roster-level { color: var(--gold); font-size: 9px; font-weight: 700; }
.roster-level.is-bot { color: var(--muted); }
.roster-status { color: var(--faint); font-size: 8px; white-space: nowrap; }
.roster-status.is-ready { color: var(--green); }
.roster-status.is-offline { color: var(--red); }
.roster-card.is-self { border-color: rgba(226,184,109,.22); }
.roster-card.is-dead { opacity: .42; filter: grayscale(.75); }
.waiting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.waiting-actions .button { min-width: 120px; }
.waiting-hint { color: var(--faint); font-size: 10px; line-height: 1.6; }
.room-code-copy { display: grid; width: 100%; gap: 7px; justify-items: start; padding: 13px; border: 1px dashed rgba(226,184,109,.32); border-radius: 13px; background: rgba(226,184,109,.045); cursor: pointer; text-align: left; }
.room-code-copy span, .room-code-copy small { color: var(--muted); font-size: 10px; }
.room-code-copy strong { color: var(--gold); font-size: 22px; letter-spacing: .22em; }
.room-note { margin: 10px 0 0; color: var(--faint); font-size: 10px; line-height: 1.7; }
.mode-heading { margin-bottom: 9px; font-size: 15px; }
.game-page .page-wrap { max-width: 1100px; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.game-topbar h1 { margin: 7px 0 0; font-size: 27px; }
.game-topbar h1 span { color: var(--gold); }
.game-topbar .eyebrow { font-size: 9px; }
.game-top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.game-live-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .75fr); gap: 15px; align-items: start; }
.game-live-main, .game-live-aside { display: grid; gap: 13px; min-width: 0; }
.game-live-grid .panel { padding: 16px; }
.personal-role { display: flex; align-items: center; gap: 12px; }
.role-emblem { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 13px; background: rgba(226,184,109,.14); color: var(--gold); font-size: 19px; }
.personal-role small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.personal-role strong { display: block; margin-bottom: 3px; font-size: 13px; }
.personal-role p { margin: 0; color: var(--faint); font-size: 9px; line-height: 1.5; }
.living-indicator { margin-left: auto; color: var(--green); font-size: 9px; white-space: nowrap; }
.action-card { padding: 20px; border: 1px solid rgba(226,184,109,.2); border-radius: 17px; background: linear-gradient(135deg, rgba(40,48,36,.95), rgba(25,35,28,.96)); }
.action-card .eyebrow { margin-bottom: 8px; font-size: 9px; }
.action-card h2 { margin: 0 0 8px; font-family: "Gowun Dodum", sans-serif; font-size: 19px; font-weight: 400; letter-spacing: -.03em; }
.action-card > p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.target-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 15px 0; }
.target-card { display: flex; min-width: 0; min-height: 75px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px; border: 1px solid var(--border); border-radius: 12px; background: rgba(32,44,35,.8); color: var(--text); cursor: pointer; font-size: 9px; }
.target-card:hover, .target-card.is-selected { border-color: var(--gold); background: rgba(226,184,109,.1); }
.target-card.is-selected .roster-avatar { box-shadow: 0 0 0 2px var(--gold); }
.speech-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.speech-option { display: grid; min-height: 91px; justify-items: start; align-content: center; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(32,44,35,.8); color: var(--text); cursor: pointer; text-align: left; }
.speech-option > span { color: var(--gold); font-size: 16px; }
.speech-option strong { font-size: 10px; }
.speech-option small { color: var(--faint); font-size: 8px; line-height: 1.45; }
.speech-option:hover { border-color: rgba(226,184,109,.55); }
.action-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
.game-feed { display: grid; max-height: 220px; gap: 7px; overflow-y: auto; }
.feed-system { margin: 0; color: var(--gold); font-size: 10px; line-height: 1.6; }
.feed-line { display: flex; gap: 8px; margin: 0; font-size: 10px; line-height: 1.6; }
.feed-line strong { flex: 0 0 auto; color: var(--green); }
.feed-line span { color: #d8ded2; }
.waiting-indicator { display: flex; align-items: center; gap: 5px; margin-top: 15px; color: var(--muted); font-size: 10px; }
.waiting-indicator span { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.waiting-indicator span:nth-child(2) { animation-delay: .2s; }.waiting-indicator span:nth-child(3) { animation-delay: .4s; }
.game-live-aside .roster-grid { grid-template-columns: 1fr; }
.game-live-aside .roster-card { padding: 7px; }
.game-live-aside .roster-avatar { width: 29px; height: 29px; }
.compact-weather h2 { margin: 8px 0; font-size: 13px; }
.compact-weather p:last-child { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.user-menu { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.user-avatar { width: 32px; height: 32px; font-size: 11px; }
.user-menu button { padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; }
.result-card { border-color: rgba(165,194,138,.25); }
.result-card h2 { font-size: 23px; }
.result-card .button { margin-top: 8px; }
.mvp-panel { display: grid; gap: 11px; margin: 15px 0; padding: 14px; border: 1px solid #d7bd8260; border-radius: 14px; background: #111d26b8; }
.mvp-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mvp-heading .eyebrow { margin: 0 0 4px; color: #e2b86d; font-size: 9px; }
.mvp-heading h3, .mvp-panel > h3 { margin: 0; font-size: 15px; }
.mvp-heading > span { color: #bac7c9; font-size: 10px; white-space: nowrap; }
.mvp-panel > .form-hint, .mvp-panel > p { margin: 0; color: #bac7c9; font-size: 10px; line-height: 1.6; }
.mvp-finalized { color: #f2d69b !important; font-weight: 700; }
.mvp-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mvp-candidate { display: grid; gap: 7px; padding: 10px; border: 1px solid #b7ced62b; border-radius: 11px; background: #192832; }
.mvp-candidate.is-mvp { border-color: #e2b86d99; background: #473c286b; }
.mvp-candidate > div:first-child { display: flex; justify-content: space-between; gap: 6px; }
.mvp-candidate strong { overflow: hidden; color: #e2edf3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mvp-candidate > div:first-child span, .mvp-candidate > small { color: #bac7c9; font-size: 9px; white-space: nowrap; }
.mvp-candidate .mvp-meter { height: 5px; }
.mvp-candidate .button { min-height: 32px; margin: 0; font-size: 10px; }
.shop-item .button:disabled { opacity: .54; cursor: not-allowed; }
.button:disabled { transform: none; opacity: .45; cursor: not-allowed; }
.private-clue { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid rgba(160,181,211,.25); border-radius: 13px; background: rgba(83,107,140,.12); color: #bcd1e7; }
.private-clue > span { font-size: 19px; }
.private-clue p { display: grid; gap: 3px; margin: 0; font-size: 10px; }
.private-clue strong { color: #e2e9ef; font-size: 10px; }
.team-whisper { margin: 0; padding: 10px 13px; border: 1px solid rgba(228,134,120,.2); border-radius: 12px; background: rgba(228,134,120,.07); color: #e9a59a; font-size: 10px; }
.journal-panel { border-color: rgba(161, 189, 210, .24); background: linear-gradient(145deg, #1d2c30, var(--surface)); }
.journal-panel h2 { margin: 5px 0 0; }
.journal-lock { padding: 7px 10px; border: 1px solid rgba(161, 189, 210, .3); border-radius: 99px; color: #bdd7e7; font-size: 12px; white-space: nowrap; }
.journal-list { display: grid; max-height: 270px; gap: 8px; margin: 16px 0; padding: 0; overflow-y: auto; list-style: none; }
.journal-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.journal-round { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 10px; background: rgba(161, 189, 210, .1); color: #bdd7e7; font-size: 12px; }
.journal-list li > div { min-width: 0; flex: 1; }
.journal-list strong, .journal-list small { display: block; overflow-wrap: anywhere; }
.journal-list strong { font-size: 14px; }
.journal-list small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.journal-list button, .quick-claims button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); color: var(--text); font-size: 13px; cursor: pointer; }
.journal-empty, .claim-notice { color: var(--muted); font-size: 13px; line-height: 1.7; }
.claim-notice { padding-left: 10px; border-left: 2px solid var(--gold); }
.quick-claims { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.quick-claims button:disabled { opacity: .45; cursor: not-allowed; }
.chat-form label { display: block; margin: 14px 0 8px; font-size: 14px; }
.chat-form label span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.chat-compose { display: flex; align-items: stretch; gap: 8px; }
.chat-compose input { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 16px; }
.chat-compose .button { min-height: 48px; flex-shrink: 0; }
.discussion-panel .game-feed { max-height: 320px; padding: 10px 0; }
.discussion-panel .feed-line { flex-direction: column; gap: 3px; padding: 8px 0; font-size: 14px; overflow-wrap: anywhere; }
.discussion-panel .feed-system, .discussion-panel .form-hint, .journal-panel .form-hint { font-size: 12px; line-height: 1.7; }
.game-page .target-card { min-height: 80px; font-size: 13px; overflow-wrap: anywhere; }
.game-page .speech-option { min-height: 100px; }
.game-page .speech-option strong { font-size: 14px; }
.game-page .speech-option small { font-size: 12px; }
.game-page .personal-role p, .game-page .action-card > p:not(.eyebrow) { font-size: 13px; }
.policy-page { max-width: none; margin-left: 0; padding: 40px 24px 70px; }
.policy-page .page-wrap { max-width: 780px; }
.policy-page h1 { margin: 10px 0 20px; }
.policy-section { margin: 24px 0; }
.policy-section h2 { margin-bottom: 8px; font-size: 15px; }
.policy-section p { color: var(--muted); font-size: 12px; line-height: 1.9; }

@keyframes rainfall { from { transform: translate3d(12px,-28px,0); } to { transform: translate3d(-12px,28px,0); } }
@keyframes snowfall { from { background-position: 0 -60px, 30px -20px, 60px -90px; } to { background-position: 60px 120px, -20px 150px, 90px 140px; } }
@keyframes mist { from { transform: translateX(-10%); opacity: .25; } to { transform: translateX(9%); opacity: .7; } }
@keyframes gust { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 1050px) {
  .auth-page { grid-template-columns: minmax(0, .9fr) minmax(380px, 1.1fr); }
  .auth-panel { padding: 42px; }
  .waiting-grid, .game-live-grid { grid-template-columns: minmax(0, 1fr) minmax(230px, .75fr); }
}
@media (max-width: 760px) {
  body.is-auth { padding-bottom: 0; }
  .auth-page { min-height: 100vh; grid-template-columns: 1fr; }
  .auth-art { min-height: 235px; }
  .auth-art-copy { bottom: 20px; left: 23px; }
  .auth-art-copy h1 { margin: 9px 0 4px; font-size: 26px; }
  .auth-art-copy p:last-child { margin-bottom: 0; font-size: 10px; line-height: 1.5; }
  .auth-art .weather-caption { display: none; }
  .auth-panel { padding: 23px; }
  .auth-form-wrap { max-width: 470px; padding: 29px 0 20px; }
  .auth-form-wrap h2 { font-size: 25px; }
  .service-hero { min-height: 235px; padding: 23px 19px; }
  .service-hero-copy { max-width: 79%; }
  .service-hero-copy h2 { font-size: 26px; }
  .service-hero-copy > p:not(.eyebrow) { max-width: 250px; font-size: 10px; }
  .service-hero .weather-scene { width: 100%; }
  .lobby-grid { grid-template-columns: 1fr; gap: 10px; }
  .waiting-grid { grid-template-columns: 1fr; }
  .waiting-aside { grid-template-columns: 1fr 1fr; }
  .waiting-aside .panel { min-width: 0; }
  .game-topbar { align-items: flex-start; }
  .game-topbar h1 { font-size: 22px; }
  .game-top-actions { gap: 6px; }
  .game-top-actions .button { min-height: 37px; padding: 0 10px; font-size: 10px; }
  .live-scene { height: 170px; }
  .scene-overlay-copy { right: 14px; bottom: 13px; left: 14px; }
  .scene-overlay-copy p { font-size: 12px; }
  .game-live-grid { grid-template-columns: 1fr; }
  .game-live-aside { grid-template-columns: 1fr 1fr; align-items: start; }
  .game-live-aside .panel:first-child { grid-column: 1 / -1; }
  .game-live-aside .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-live-aside .roster-status { display: none; }
  .game-live-grid .panel { padding: 13px; }
  .action-card { padding: 16px; }
  .speech-options { gap: 6px; }
  .speech-option { padding: 8px; }
}
@media (max-width: 420px) {
  .user-menu > span:not(.user-avatar) { display: none; }
  .user-menu { gap: 5px; }
  .roster-grid { grid-template-columns: 1fr; }
  .waiting-aside { grid-template-columns: 1fr; }
  .target-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-live-aside { grid-template-columns: 1fr; }
  .game-live-aside .panel:first-child { grid-column: auto; }
  .game-live-aside .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speech-option small { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.social-page { max-width: 1160px; }
.social-hub { display: grid; gap: 18px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, rgba(35, 48, 37, .96), rgba(22, 30, 24, .98)); }
.social-hub > .section-title-row { margin: 0; }
.social-grid { display: grid; grid-template-columns: minmax(250px, .82fr) minmax(0, 1.18fr); gap: 16px; }
.social-contacts, .social-inbox { display: grid; align-content: start; gap: 14px; min-width: 0; }
.social-contacts > section, .social-inbox > section, .social-conversation { display: grid; gap: 9px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: rgba(12, 19, 14, .55); }
.social-contacts h3, .social-inbox h3, .social-conversation h3 { margin: 0; font-size: 14px; }
.social-contacts h3 span, .social-inbox h3 span { color: var(--gold); }
.friend-request-form { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: rgba(12, 19, 14, .55); }
.friend-request-form > label, .social-conversation form > label { font-size: 12px; font-weight: 700; }
.friend-request-form small, .social-safety-note, .social-conversation .form-hint { color: var(--muted); font-size: 10px; line-height: 1.6; }
.social-contact, .social-invite { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: rgba(39, 51, 41, .68); }
.social-friends-section { gap: 10px !important; }
.social-friends-heading { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 12px; min-width: 0; }
.social-friends-heading h3 { display: flex; flex: 0 0 auto; align-items: baseline; gap: 6px; }
.social-friend-count { min-width: 18px; text-align: center; }
.social-online-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.social-friends-heading > .button { flex: 0 0 auto; min-height: 34px; margin-left: auto; padding: 4px 9px; font-size: 10px; }
.social-friends-list { display: grid; gap: 7px; }
.social-friend-avatar { position: relative; }
.social-friend-status { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border: 2px solid #18251c; border-radius: 50%; background: #df6969; }
.social-friend-status.is-online { background: #68d68e; box-shadow: 0 0 7px #68d68e88; }
.social-contact.is-selected { border-color: var(--gold); }
.social-contact > strong, .social-contact-open strong, .social-invite strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-contact > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-left: auto; }
.social-contact .button, .social-invite .button { min-height: 32px; padding: 5px 8px; font-size: 10px; }
.social-contact-open { display: grid; flex: 1; min-width: 0; gap: 3px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.social-contact-open { min-height: 44px; }
.social-friend-avatar { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid #e6c78e55; border-radius: 12px; background: radial-gradient(circle at 30% 25%, #f6e8c933, transparent 55%), linear-gradient(145deg, #344653, #182630); color: var(--gold); font-family: "Gowun Dodum", sans-serif; font-size: 17px; }
.social-search-results { display: grid; gap: 8px; padding: 14px; border: 1px solid #e6c78e44; border-radius: 13px; background: linear-gradient(145deg, #1d2c30, #121c20); }
.social-search-results h3 { margin: 0 0 2px; font-size: 13px; }
.social-search-results h3 span { color: var(--gold); }
.social-search-result { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 11px; background: #dce7f008; }
.social-search-result > strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-search-result .button { min-height: 40px; }
.social-relation { padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.social-relation.is-friend { border-color: #9dc9a366; color: #b7dfb4; }
.social-message-open { flex: 0 0 auto; }
.social-contact-open small, .social-invite small { color: var(--muted); font-size: 9px; }
.social-contact details { position: relative; }
.social-contact details > summary { color: var(--muted); cursor: pointer; font-size: 10px; }
.social-contact details > button { display: block; margin-top: 5px; }
.social-invite > div { display: grid; flex: 1; min-width: 0; gap: 4px; }
.social-invite small { overflow-wrap: anywhere; }
.social-conversation { min-height: 260px; }
.social-conversation > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.social-conversation > header > span { color: var(--muted); font-size: 9px; }
.social-message-list { display: grid; max-height: 300px; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.social-message { justify-self: start; max-width: 90%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; background: rgba(47, 62, 49, .85); }
.social-message.is-own { justify-self: end; border-color: rgba(226, 184, 109, .35); background: rgba(83, 68, 42, .62); border-radius: 12px 12px 3px 12px; }
.social-message strong, .social-message time { color: var(--muted); font-size: 9px; }
.social-message p { margin: 4px 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.social-message time { display: block; text-align: right; }
.social-conversation form { display: grid; gap: 7px; }
.social-conversation textarea { width: 100%; min-height: 54px; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #101811; color: var(--text); font: inherit; font-size: 12px; }
.social-safety-note { margin: 0; }
.social-profile-modal { max-height: min(90dvh, 680px); overflow-y: auto; overscroll-behavior: contain; }
.social-profile-modal .profile-modal-hero { margin-top: 20px; }
.social-profile-modal .profile-stats { margin-bottom: 14px; }
.social-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(4, 8, 5, .76); }
.social-modal-card { width: min(940px, 100%); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; box-shadow: 0 24px 90px #000b; }
.social-modal .social-hub { border-radius: 18px; }
.social-modal .section-title-row { position: sticky; top: -20px; z-index: 1; padding: 8px 0; background: #202c23; }
@media (max-width: 760px) {
  .social-grid { grid-template-columns: 1fr; }
  .social-hub { gap: 12px; padding: 14px; }
  .social-contact { flex-wrap: wrap; }
  .social-contact > div { margin-left: 0; }
  .social-search-result .button { min-height: 44px; }
  .social-modal-card { max-height: 94dvh; }
  .social-message-list { max-height: 38dvh; }
  .user-menu [data-view="social"] { display: none; }
  #social-notifications { top: auto; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
}

@media (max-width: 1050px) {
  .main-content { padding-right: 30px; padding-left: 30px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-card { min-height: 164px; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-topbar { position: sticky; top: 0; z-index: 6; display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(17, 24, 17, .92); backdrop-filter: blur(12px); }
  .mobile-topbar .brand { gap: 8px; font-size: 14px; }
  .mobile-topbar .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 15px; }
  .profile-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); color: var(--gold); cursor: pointer; font-size: 12px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 8; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(17, 24, 17, .96); backdrop-filter: blur(14px); }
  .mobile-nav .nav-link { min-height: 48px; flex-direction: column; justify-content: center; gap: 1px; padding: 3px; }
  .mobile-nav .nav-link > span { font-size: 18px; line-height: 1.1; }
  .mobile-nav .nav-link small { font-size: 9px; }
  .main-content { min-height: calc(100vh - 58px); margin-left: 0; padding: 25px 16px 30px; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading .profile-chip { display: none; }
  .hero-card { min-height: 235px; padding: 24px 21px; }
  .hero-orb { right: 6%; width: 70px; height: 70px; font-size: 28px; opacity: .75; }
  .hero-card::before { right: -21%; }
  .hero-card::after { right: -10%; }
  .hero-copy { max-width: 83%; }
  .hero-copy p { font-size: 12px; }
  .mode-grid { gap: 9px; }
  .mode-card { min-height: 161px; padding: 13px 12px; }
  .mode-card p { font-size: 10px; }
  .feature-row { grid-template-columns: 1fr; gap: 9px; margin-top: 12px; }
  .game-layout { grid-template-columns: 1fr; gap: 12px; }
  .game-side { grid-template-columns: 1fr 1fr; align-items: start; }
  .game-side .panel:first-child { grid-column: 1 / -1; }
  .panel { padding: 15px; }
  .player-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .player-card { min-height: 82px; }
  .guide-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .shop-item { padding: 12px; }
  .shop-art { height: 77px; }
  .record-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toast { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; max-width: none; text-align: center; }
}
@media (max-width: 390px) {
  .page-heading { flex-direction: column; }
  .hero-copy { max-width: 100%; }
  .hero-orb { right: 4%; top: 16px; width: 56px; height: 56px; font-size: 23px; opacity: .35; }
  .mode-card { min-height: 169px; }
  .game-side { grid-template-columns: 1fr; }
  .game-side .panel:first-child { grid-column: auto; }
  .nickname-form { flex-direction: column; }
  .nickname-form input { min-height: 44px; }
}
