:root {
  --ink: #15211f;
  --muted: #73807c;
  --line: #e5e9e4;
  --paper: #f5f3ed;
  --white: #fffefa;
  --green-950: #052a25;
  --green-900: #073830;
  --green-800: #0a4a3e;
  --green-700: #116351;
  --green-600: #16765f;
  --green-500: #1f8a6d;
  --lime: #c9ee6a;
  --lime-dark: #a7d53d;
  --red: #d94c43;
  --gold: #d6a535;
  --shadow: 0 18px 60px rgba(13, 45, 39, .11);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.ambient { position: fixed; pointer-events: none; filter: blur(2px); opacity: .35; z-index: 0; }
.ambient-one { width: 360px; height: 360px; right: -170px; top: 20%; border-radius: 50%; background: #d6ee9c; }
.ambient-two { width: 280px; height: 280px; left: 31%; bottom: -180px; border-radius: 48%; background: #d5c79f; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 18px; letter-spacing: .08em; line-height: 1.2; }
.brand small { font-size: 7px; letter-spacing: .26em; opacity: .52; margin-top: 3px; }
.brand-mark { position: relative; width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--green-900); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transform: rotate(-3deg); }
.brand-mark i { position: absolute; font-style: normal; font-size: 18px; color: white; line-height: 1; }
.brand-mark i:first-child { transform: translate(-5px, -3px); }
.brand-mark i:last-child { color: #f06b5d; transform: translate(6px, 4px) scale(.8); }
.brand-light { color: white; position: absolute; top: 44px; left: 54px; z-index: 3; }
.brand-light .brand-mark { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); }

/* 登录 */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(500px, 1.12fr) minmax(420px, .88fr); position: relative; z-index: 1; }
.auth-story { min-height: 100vh; position: relative; padding: 128px 7vw 72px; color: white; overflow: hidden; background:
  radial-gradient(circle at 15% 85%, rgba(48,135,105,.5), transparent 33%),
  radial-gradient(circle at 80% 8%, rgba(167,213,61,.14), transparent 24%),
  linear-gradient(145deg, #052b27, #0a4137 64%, #0b493c); }
.auth-story::before { content: ""; position: absolute; inset: 0; opacity: .055; background-image: repeating-linear-gradient(115deg, transparent 0 28px, #fff 29px 30px); }
.auth-story::after { content: "♠"; position: absolute; font-family: Georgia, serif; font-size: 520px; line-height: .8; right: -145px; bottom: -150px; color: rgba(255,255,255,.035); transform: rotate(-8deg); }
.story-copy { position: relative; z-index: 2; max-width: 650px; }
.eyebrow, .auth-kicker, .page-eyebrow { text-transform: uppercase; letter-spacing: .22em; font-weight: 800; font-size: 11px; }
.eyebrow { color: var(--lime); margin: 0 0 23px; }
.story-copy h1 { margin: 0; font-size: clamp(52px, 6vw, 86px); line-height: 1.1; letter-spacing: -.05em; font-weight: 900; }
.story-copy h1 em { font-style: normal; color: var(--lime); }
.story-copy > p:not(.eyebrow) { max-width: 520px; margin: 29px 0 40px; color: rgba(255,255,255,.68); font-size: 16px; line-height: 1.9; }
.story-points { display: flex; gap: 34px; }
.story-points span { display: grid; color: rgba(255,255,255,.52); font-size: 11px; letter-spacing: .06em; }
.story-points b { color: white; font-size: 20px; margin-bottom: 4px; }
.floating-cards { position: absolute; right: 10%; bottom: 10%; width: 230px; height: 210px; z-index: 2; }
.poster-card { width: 115px; height: 166px; position: absolute; border-radius: 13px; box-shadow: 0 28px 50px rgba(0,0,0,.28); }
.poster-card.card-front { background: #fffef8; color: #15211f; padding: 12px; display: grid; align-content: start; font-family: Georgia, serif; border: 1px solid #eee8dc; }
.poster-card.card-front b { font-size: 24px; line-height: 1; }
.poster-card.card-front i { font-size: 20px; font-style: normal; }
.poster-card.card-front strong { place-self: center; font-size: 48px; margin-top: 24px; }
.poster-card.red { color: var(--red); transform: rotate(14deg); right: 4px; top: 24px; }
.poster-card:not(.red).card-front { transform: rotate(-5deg); right: 61px; top: 8px; }
.poster-card.card-back { left: -6px; top: 30px; transform: rotate(-20deg); background: var(--lime); border: 6px solid #f2ffd2; outline: 1px solid rgba(0,0,0,.1); display: grid; place-items: center; color: var(--green-900); }
.poster-card.card-back::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(7,56,48,.28); border-radius: 7px; background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(7,56,48,.05) 6px 7px); }
.poster-card.card-back span { z-index: 1; border: 1px solid var(--green-800); width: 44px; height: 44px; display: grid; place-items: center; transform: rotate(45deg); font-weight: 900; }
.poster-card.card-back span::first-letter { transform: rotate(-45deg); }

.auth-panel { min-height: 100vh; background: rgba(255,254,250,.94); display: grid; place-items: center; padding: 50px; position: relative; }
.auth-box { width: min(410px, 100%); }
.mobile-brand { display: none; }
.auth-kicker { color: var(--green-500); margin: 0 0 9px; }
.auth-box h2 { font-size: 32px; letter-spacing: -.04em; margin: 0 0 10px; }
.auth-subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.auth-tabs { margin: 36px 0 28px; border-bottom: 1px solid var(--line); display: flex; gap: 30px; }
.auth-tab { background: none; border: 0; padding: 0 2px 13px; color: #95a09d; font-weight: 600; cursor: pointer; position: relative; }
.auth-tab.active { color: var(--green-800); }
.auth-tab.active::after { content: ""; height: 3px; position: absolute; left: 0; right: 0; bottom: -2px; border-radius: 3px; background: var(--green-700); }
.auth-form { display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 8px; }
.auth-form label span { font-size: 12px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #dfe5df; background: #fbfcf9; border-radius: 12px; padding: 13px 15px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus, textarea:focus { border-color: var(--green-500); background: white; box-shadow: 0 0 0 4px rgba(31,138,109,.1); }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 12px; min-height: 44px; padding: 0 18px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { background: var(--green-900); color: white; box-shadow: 0 9px 24px rgba(7,56,48,.2); }
.primary-button:hover { background: var(--green-800); transform: translateY(-1px); box-shadow: 0 13px 28px rgba(7,56,48,.24); }
.primary-button:disabled, .secondary-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.primary-button.wide { margin-top: 7px; min-height: 52px; justify-content: space-between; padding: 0 20px; }
.primary-button.wide i { font-style: normal; font-size: 20px; }
.secondary-button { background: #edf2ed; color: var(--green-900); }
.secondary-button:hover { background: #e1eae2; }
.danger-button { background: #fff0ee; color: var(--red); }
.auth-note { text-align: center; color: #9ca5a2; font-size: 11px; margin: 24px 0 0; }

/* 应用布局 */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); position: relative; z-index: 1; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 31px 24px 22px; background: rgba(255,254,250,.94); border-right: 1px solid rgba(20,50,44,.08); display: flex; flex-direction: column; }
.main-nav { display: grid; gap: 7px; margin: 52px 0 0; }
.nav-item { width: 100%; min-height: 47px; border: 0; background: transparent; border-radius: 12px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: #76817e; cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; }
.nav-item:hover { background: #f0f3ed; color: var(--green-800); }
.nav-item.active { color: var(--green-900); background: #eaf0e8; }
.nav-icon { width: 22px; font-size: 20px; font-family: Georgia, serif; text-align: center; }
.nav-badge { min-width: 19px; height: 19px; border-radius: 10px; margin-left: auto; display: grid; place-items: center; background: var(--red); color: white; font-size: 10px; }
.sidebar-tip { margin-top: auto; position: relative; border-radius: 16px; padding: 17px; color: white; overflow: hidden; background: linear-gradient(145deg, var(--green-900), var(--green-800)); }
.sidebar-tip span { color: var(--lime); font-size: 10px; letter-spacing: .12em; font-weight: 800; }
.sidebar-tip p { position: relative; z-index: 1; margin: 8px 0 0; font-size: 11px; line-height: 1.7; color: rgba(255,255,255,.68); }
.sidebar-tip i { position: absolute; font-style: normal; font-size: 70px; opacity: .07; right: -7px; bottom: -23px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 13px 4px 0; border-top: 1px solid var(--line); }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; background: var(--green-800); color: var(--lime); display: grid; place-items: center; font-weight: 900; }
.avatar.bot { background: #dfe7dd; color: var(--green-800); }
.avatar.small { width: 34px; height: 34px; border-radius: 10px; }
.sidebar-user .user-meta { min-width: 0; display: grid; }
.user-meta strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10px; color: var(--muted); }
.logout-button { margin-left: auto; border: 0; background: none; color: #98a29f; font-size: 18px; cursor: pointer; }
.content-shell { min-width: 0; min-height: 100vh; }
.topbar { height: 101px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 60px); }
.page-eyebrow { color: var(--green-500); margin: 0 0 4px; font-size: 8px; }
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.connection-pill { border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 20px; padding: 7px 12px; font-size: 10px; color: var(--muted); }
.connection-pill i { width: 6px; height: 6px; margin-right: 5px; display: inline-block; border-radius: 50%; background: #54b987; box-shadow: 0 0 0 3px rgba(84,185,135,.13); }
.connection-pill.offline i { background: #d9a33d; }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); display: grid; place-items: center; cursor: pointer; position: relative; font-size: 18px; }
.dot-badge { position: absolute; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; right: 5px; top: 5px; background: var(--red); }
.main-content { padding: 3px clamp(24px, 4vw, 60px) 50px; max-width: 1540px; margin: 0 auto; }

/* 大厅 */
.lobby-hero { min-height: 275px; border-radius: var(--radius); padding: 39px 43px; color: white; overflow: hidden; position: relative; display: grid; align-items: center; background:
  radial-gradient(circle at 78% 40%, rgba(201,238,106,.18), transparent 23%),
  linear-gradient(120deg, #07352f, #0a4b3e); box-shadow: var(--shadow); }
.lobby-hero::before { content: ""; position: absolute; inset: 0; opacity: .07; background-image: linear-gradient(30deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%), linear-gradient(150deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%); background-size: 45px 78px; }
.hero-copy { position: relative; z-index: 2; max-width: 510px; }
.hero-copy .eyebrow { font-size: 9px; margin-bottom: 15px; }
.hero-copy h2 { margin: 0; font-size: clamp(30px, 3vw, 45px); line-height: 1.25; letter-spacing: -.04em; }
.hero-copy h2 em { color: var(--lime); font-style: normal; }
.hero-copy p { color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.8; margin: 14px 0 23px; }
.hero-button { border: 0; background: var(--lime); color: var(--green-950); border-radius: 11px; min-height: 43px; padding: 0 19px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 25px rgba(201,238,106,.18); }
.hero-cards { position: absolute; width: 315px; height: 240px; right: 7%; bottom: -20px; transform: scale(.88); }
.hero-card { position: absolute; width: 125px; height: 182px; background: white; border: 1px solid #ebe7db; border-radius: 14px; box-shadow: 0 23px 40px rgba(0,0,0,.25); font-family: Georgia, serif; padding: 12px; color: #18231f; }
.hero-card span { display: grid; font-weight: bold; font-size: 23px; line-height: .9; }
.hero-card i { font-size: 20px; font-style: normal; }
.hero-card:nth-child(1) { transform: rotate(-15deg); left: 15px; top: 43px; }
.hero-card:nth-child(2) { transform: rotate(-2deg); left: 93px; top: 13px; color: var(--red); }
.hero-card:nth-child(3) { transform: rotate(13deg); left: 175px; top: 38px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 29px 0 15px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-card { border: 1px solid rgba(18,64,54,.08); background: rgba(255,254,250,.9); border-radius: 17px; min-height: 175px; padding: 22px; position: relative; cursor: pointer; text-align: left; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(20,62,54,.1); border-color: rgba(31,138,109,.3); }
.mode-card .mode-number { position: absolute; right: 13px; top: -20px; font: 900 92px Georgia, serif; color: rgba(10,74,62,.045); }
.mode-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #e9f0e7; color: var(--green-800); font-size: 20px; margin-bottom: 17px; }
.mode-card.recommended .mode-icon { background: var(--green-900); color: var(--lime); }
.mode-card h3 { margin: 0; font-size: 15px; }
.mode-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; max-width: 210px; }
.mode-tag { position: absolute; right: 16px; bottom: 16px; font-size: 9px; font-weight: 800; color: var(--green-700); background: #edf5e9; border-radius: 10px; padding: 5px 8px; }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.5); }
.stat-item { padding: 17px 20px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.stat-item:last-child { border: 0; }
.stat-item i { font-style: normal; color: var(--green-600); font-size: 20px; }
.stat-item span { display: grid; color: var(--muted); font-size: 9px; }
.stat-item strong { color: var(--ink); font-size: 15px; }

/* 通用面板、通知 */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,254,250,.88); box-shadow: 0 10px 35px rgba(20,55,48,.05); overflow: hidden; }
.panel-header { min-height: 71px; padding: 17px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.notices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.notice-list { padding: 8px; display: grid; gap: 5px; }
.notice-row { padding: 14px; border-radius: 13px; display: flex; align-items: center; gap: 12px; }
.notice-row:hover { background: #f3f5ef; }
.notice-copy { min-width: 0; flex: 1; }
.notice-copy strong { font-size: 12px; display: block; }
.notice-copy p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.notice-actions { display: flex; gap: 6px; }
.mini-button { min-height: 31px; border: 0; border-radius: 9px; padding: 0 11px; font-size: 10px; font-weight: 700; cursor: pointer; background: #e8efea; color: var(--green-800); }
.mini-button.accept { background: var(--green-900); color: white; }
.mini-button:hover { filter: brightness(.96); }
.empty-state { min-height: 190px; padding: 35px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state i { display: block; font-style: normal; font-family: Georgia, serif; color: #c5ceca; font-size: 40px; margin-bottom: 8px; }
.empty-state strong { display: block; color: #53605d; font-size: 13px; }
.empty-state p { margin: 5px 0 0; font-size: 10px; }

/* 好友聊天 */
.friends-layout { height: calc(100vh - 154px); min-height: 560px; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.friends-rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.add-friend { padding: 17px; border-bottom: 1px solid var(--line); display: flex; gap: 7px; }
.add-friend input { height: 38px; font-size: 11px; padding: 0 11px; }
.add-friend button { width: 38px; flex: 0 0 38px; border-radius: 10px; border: 0; background: var(--green-900); color: white; cursor: pointer; }
.friend-list { overflow-y: auto; padding: 8px; }
.friend-row { width: 100%; border: 0; border-radius: 13px; background: transparent; padding: 11px; display: flex; gap: 11px; align-items: center; cursor: pointer; text-align: left; }
.friend-row:hover, .friend-row.active { background: #edf1eb; }
.friend-row .user-meta { flex: 1; min-width: 0; }
.friend-score { font-size: 9px; color: var(--muted); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #72be87; box-shadow: 0 0 0 3px white; margin-left: -16px; margin-top: 25px; }
.chat-pane { display: grid; grid-template-rows: 70px minmax(0, 1fr) auto; min-width: 0; }
.chat-head { padding: 0 21px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.chat-person { display: flex; align-items: center; gap: 11px; }
.chat-person strong { font-size: 13px; display: block; }
.chat-person span { font-size: 9px; color: var(--muted); }
.chat-messages { overflow-y: auto; padding: 23px; display: flex; flex-direction: column; gap: 13px; }
.message { max-width: min(72%, 520px); display: grid; gap: 4px; }
.message.mine { align-self: end; justify-items: end; }
.message-bubble { background: #eef1eb; border-radius: 5px 14px 14px 14px; padding: 10px 13px; font-size: 12px; line-height: 1.6; word-break: break-word; }
.message.mine .message-bubble { background: var(--green-800); color: white; border-radius: 14px 5px 14px 14px; }
.message time { font-size: 8px; color: #9aa4a1; }
.chat-compose { padding: 15px 18px; border-top: 1px solid var(--line); display: flex; gap: 9px; }
.chat-compose input { height: 43px; font-size: 12px; }
.chat-compose button { flex: 0 0 74px; }
.chat-placeholder { grid-row: 1 / -1; display: grid; place-items: center; text-align: center; color: var(--muted); }
.chat-placeholder i { font-style: normal; font-size: 45px; color: #bdc9c4; }
.chat-placeholder strong { display: block; color: var(--ink); font-size: 14px; margin: 9px 0 4px; }
.chat-placeholder p { font-size: 10px; margin: 0; }

/* 房间 */
.room-page { display: grid; gap: 18px; }
.room-banner { min-height: 126px; padding: 27px 31px; border-radius: var(--radius); color: white; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(120deg, var(--green-900), var(--green-800)); overflow: hidden; position: relative; }
.room-banner::after { content: attr(data-code); position: absolute; right: 20px; top: -34px; font: 900 105px Georgia, serif; color: rgba(255,255,255,.05); letter-spacing: -.08em; }
.room-banner .eyebrow { margin: 0 0 9px; font-size: 8px; }
.room-banner h2 { margin: 0; font-size: 28px; }
.room-code { position: relative; z-index: 1; text-align: right; }
.room-code span { display: block; font-size: 9px; color: rgba(255,255,255,.55); letter-spacing: .15em; }
.room-code strong { font: 700 24px Georgia, serif; letter-spacing: .12em; color: var(--lime); }
.seat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.seat-card { min-height: 225px; display: grid; place-items: center; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,250,.85); padding: 25px; position: relative; }
.seat-card .seat-number { position: absolute; top: 13px; left: 14px; font-size: 9px; color: #a1aaa7; letter-spacing: .1em; }
.large-avatar { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 22px; background: var(--green-900); color: var(--lime); font-size: 24px; font-weight: 900; margin: 0 auto 13px; box-shadow: 0 11px 25px rgba(7,56,48,.15); }
.seat-card.bot-seat .large-avatar { color: var(--green-900); background: #dfe8dc; }
.seat-card h3 { margin: 0; font-size: 14px; }
.seat-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.seat-card.empty { border-style: dashed; background: rgba(255,255,255,.35); }
.seat-card.empty .large-avatar { background: transparent; border: 1px dashed #b7c2bd; color: #aab4b0; box-shadow: none; }
.waiting-dots span { display: inline-block; width: 4px; height: 4px; background: #97a39e; border-radius: 50%; margin: 0 2px; animation: waiting 1.4s infinite; }
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes waiting { 0%, 60%, 100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-4px); opacity: 1; } }
.room-footer-panel { padding: 20px; display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.room-status { display: flex; align-items: center; gap: 11px; }
.room-status i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-style: normal; background: #e9f0e7; color: var(--green-800); }
.room-status strong { display: block; font-size: 12px; }
.room-status span { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.invite-friends { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }

/* 牌桌 */
.game-wrap { margin: -104px calc(clamp(24px, 4vw, 60px) * -1) -50px; min-height: 100vh; background: #052f2a; color: white; position: relative; overflow: hidden; }
.game-wrap::before { content: ""; position: absolute; inset: 0; opacity: .05; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px; }
.game-toolbar { height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 4; background: rgba(4,36,32,.66); border-bottom: 1px solid rgba(255,255,255,.07); }
.game-toolbar button { border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.07); color: white; border-radius: 10px; min-height: 36px; padding: 0 13px; cursor: pointer; }
.game-meta { display: flex; gap: 18px; }
.game-meta span { display: grid; font-size: 8px; color: rgba(255,255,255,.48); text-align: right; letter-spacing: .08em; }
.game-meta strong { color: var(--lime); font-size: 13px; letter-spacing: 0; }
.game-table { position: relative; min-height: calc(100vh - 72px); max-width: 1180px; margin: 0 auto; padding: 30px 35px 185px; }
.table-felt { position: absolute; left: 12%; right: 12%; top: 9%; bottom: 18%; border-radius: 48%; border: 1px solid rgba(201,238,106,.11); box-shadow: inset 0 0 90px rgba(0,0,0,.14), 0 0 0 22px rgba(0,0,0,.025); }
.opponent-row { display: flex; justify-content: space-between; position: relative; z-index: 2; }
.game-player { min-width: 180px; max-width: 230px; padding: 11px; border-radius: 15px; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.15); border: 1px solid rgba(255,255,255,.07); }
.game-player.current { border-color: rgba(201,238,106,.65); box-shadow: 0 0 0 3px rgba(201,238,106,.08); }
.game-player .avatar { background: rgba(255,255,255,.1); color: var(--lime); }
.game-player .user-meta strong { color: white; }
.game-player .user-meta span { color: rgba(255,255,255,.5); }
.role-badge { margin-left: auto; padding: 4px 7px; border-radius: 8px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.65); font-size: 8px; }
.role-badge.landlord { color: #2a1d00; background: var(--lime); }
.turn-marker { position: absolute; width: 8px; height: 8px; background: var(--lime); border-radius: 50%; right: -3px; top: -3px; box-shadow: 0 0 0 5px rgba(201,238,106,.12); }
.bottom-cards { position: absolute; top: 19px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; z-index: 3; }
.bottom-cards > span { position: absolute; top: -14px; width: 100%; text-align: center; color: rgba(255,255,255,.42); font-size: 8px; letter-spacing: .12em; }
.mini-card { width: 31px; height: 43px; border-radius: 4px; display: grid; place-items: center; background: #fffef8; color: #26312e; font: 700 10px Georgia, serif; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.mini-card.red { color: var(--red); }
.mini-card.back { background: var(--lime); color: var(--green-900); }
.center-play { position: absolute; z-index: 2; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; min-width: 300px; }
.turn-copy { color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: .08em; margin-bottom: 14px; }
.turn-copy strong { color: white; }
.played-cards { min-height: 80px; display: flex; justify-content: center; align-items: center; }
.played-cards .playing-card { margin-left: -34px; transform: scale(.7); transform-origin: center; }
.played-cards .playing-card:first-child { margin-left: 0; }
.combo-label { display: inline-block; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 5px 10px; color: var(--lime); font-size: 9px; }
.self-area { position: absolute; left: 25px; right: 25px; bottom: 18px; z-index: 3; text-align: center; }
.self-status { display: flex; justify-content: center; align-items: center; gap: 9px; margin-bottom: 10px; }
.self-status .avatar { width: 31px; height: 31px; border-radius: 10px; background: rgba(255,255,255,.12); }
.self-status strong { font-size: 11px; }
.hand { height: 127px; display: flex; justify-content: center; align-items: end; padding-left: 45px; overflow: visible; }
.playing-card { position: relative; flex: 0 0 73px; width: 73px; height: 107px; margin-left: -38px; border: 0; border-radius: 9px; color: #18231f; background: #fffef9; box-shadow: 0 7px 17px rgba(0,0,0,.28); padding: 7px; font-family: Georgia, serif; text-align: left; cursor: pointer; transition: transform .14s, box-shadow .14s; border: 1px solid #e8e3d8; }
.playing-card:first-child { margin-left: 0; }
.playing-card:hover { transform: translateY(-9px); box-shadow: 0 12px 22px rgba(0,0,0,.3); }
.playing-card.selected { transform: translateY(-22px); box-shadow: 0 0 0 3px var(--lime), 0 15px 25px rgba(0,0,0,.35); }
.playing-card.red { color: var(--red); }
.playing-card b { display: block; font-size: 17px; line-height: .9; }
.playing-card i { display: block; font-size: 15px; font-style: normal; }
.playing-card strong { position: absolute; font-size: 28px; left: 50%; top: 52%; transform: translate(-50%, -50%); }
.playing-card.joker b { writing-mode: vertical-rl; font-size: 8px; letter-spacing: .12em; line-height: 1.2; }
.playing-card.joker strong { font-size: 22px; }
.game-actions { min-height: 47px; margin-top: -1px; display: flex; justify-content: center; align-items: center; gap: 9px; }
.game-actions button { min-width: 78px; min-height: 38px; border: 1px solid rgba(255,255,255,.17); border-radius: 10px; background: rgba(255,255,255,.1); color: white; font-weight: 700; font-size: 11px; cursor: pointer; }
.game-actions button.primary { color: var(--green-950); background: var(--lime); border-color: var(--lime); }
.game-actions button:disabled { opacity: .4; cursor: not-allowed; }
.waiting-turn { padding: 9px 15px; background: rgba(0,0,0,.16); border-radius: 12px; color: rgba(255,255,255,.55); font-size: 10px; }
.game-result { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3,30,27,.75); backdrop-filter: blur(6px); }
.result-card { min-width: 320px; border-radius: 22px; background: #fffef9; color: var(--ink); padding: 32px; text-align: center; box-shadow: 0 25px 90px rgba(0,0,0,.4); }
.result-card i { font-style: normal; font-size: 48px; color: var(--gold); }
.result-card h2 { margin: 8px 0; font-size: 26px; }
.result-card p { margin: 0 0 21px; color: var(--muted); font-size: 12px; }

/* Toast */
.toast-stack { position: fixed; z-index: 100; right: 20px; top: 20px; display: grid; gap: 9px; pointer-events: none; }
.toast { width: min(340px, calc(100vw - 40px)); padding: 13px 15px; border-radius: 13px; color: white; background: #183f37; box-shadow: 0 13px 40px rgba(4,39,33,.25); display: flex; align-items: start; gap: 10px; animation: toast-in .25s ease-out; font-size: 11px; line-height: 1.6; }
.toast.error { background: #953e38; }
.toast i { font-style: normal; color: var(--lime); font-size: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.loading { min-height: 300px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.spinner { width: 28px; height: 28px; border: 3px solid #dfe5df; border-top-color: var(--green-600); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .auth-page { grid-template-columns: 1fr 430px; }
  .auth-story { padding-left: 50px; }
  .floating-cards { right: 4%; transform: scale(.8); }
  .hero-cards { right: 1%; transform: scale(.75); }
  .lobby-hero .hero-copy { max-width: 480px; }
  .playing-card { flex-basis: 64px; width: 64px; height: 96px; margin-left: -34px; }
}

@media (max-width: 820px) {
  .auth-page { display: block; background: linear-gradient(160deg, var(--green-950), var(--green-800)); padding: 22px; }
  .auth-story { display: none; }
  .auth-panel { min-height: calc(100vh - 44px); border-radius: 24px; padding: 30px; }
  .mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
  .app-shell { display: block; padding-bottom: 69px; }
  .sidebar { position: fixed; z-index: 50; width: 100%; height: 68px; top: auto; bottom: 0; padding: 7px 13px; border: 0; border-top: 1px solid var(--line); display: block; }
  .sidebar > .brand, .sidebar-tip, .sidebar-user { display: none; }
  .main-nav { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .nav-item { min-height: 54px; justify-content: center; flex-direction: column; gap: 1px; padding: 4px; font-size: 9px; }
  .nav-icon { height: 23px; }
  .nav-badge { position: absolute; margin: 0 0 26px 27px; }
  .topbar { height: 85px; padding: 0 20px; }
  .connection-pill { display: none; }
  .main-content { padding: 3px 16px 30px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 132px; }
  .mode-icon { margin-bottom: 11px; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .notices-grid { grid-template-columns: 1fr; }
  .friends-layout { height: calc(100vh - 180px); grid-template-columns: 230px minmax(0, 1fr); }
  .seat-grid { grid-template-columns: 1fr; }
  .seat-card { min-height: 150px; }
  .large-avatar { width: 52px; height: 52px; border-radius: 17px; }
  .game-wrap { margin: -88px -16px -30px; min-height: calc(100vh - 68px); }
  .game-table { min-height: calc(100vh - 140px); padding-left: 10px; padding-right: 10px; }
  .game-player { min-width: 140px; }
  .game-meta { gap: 9px; }
  .playing-card { flex-basis: clamp(30px, 7vw, 53px); width: 57px; height: 85px; margin-left: -27px; }
  .hand { padding-left: 28px; }
  .played-cards .playing-card { margin-left: -30px; }
}

@media (max-width: 570px) {
  .auth-panel { padding: 25px 21px; }
  .auth-box h2 { font-size: 27px; }
  .lobby-hero { min-height: 250px; padding: 28px 24px; }
  .hero-copy { max-width: 100%; }
  .hero-copy h2 { font-size: 30px; }
  .hero-copy p { max-width: 250px; }
  .hero-cards { opacity: .26; right: -80px; }
  .friends-layout { display: block; height: auto; min-height: 620px; }
  .friends-rail { border-right: 0; max-height: 240px; border-bottom: 1px solid var(--line); }
  .friend-list { display: flex; overflow-x: auto; }
  .friend-row { min-width: 175px; }
  .chat-pane { min-height: 440px; grid-template-rows: 62px 1fr auto; }
  .room-banner { padding: 23px; }
  .room-code { display: none; }
  .room-footer-panel { align-items: start; flex-direction: column; }
  .invite-friends { justify-content: start; }
  .opponent-row { gap: 8px; }
  .game-player { min-width: 0; width: 47%; padding: 8px; }
  .game-player .avatar { width: 31px; height: 31px; border-radius: 9px; }
  .role-badge { position: absolute; margin: 46px 0 0 3px; }
  .table-felt { left: 2%; right: 2%; }
  .center-play { top: 42%; }
  .bottom-cards { top: 89px; }
  .game-toolbar { padding: 0 12px; }
  .game-meta span:first-child { display: none; }
  .self-area { left: 4px; right: 4px; }
  .playing-card { flex-basis: calc((100vw - 42px) / 20); width: 52px; height: 78px; margin-left: -26px; padding: 5px; border-radius: 7px; }
  .playing-card b { font-size: 13px; }
  .playing-card i { font-size: 12px; }
  .playing-card strong { font-size: 20px; }
  .result-card { min-width: 0; width: calc(100vw - 40px); }
}
