/* Megaten: The Cycle of Demons —— 站点样式（与游戏同一套配色） */
:root {
  --bg: #060509;
  --panel: #131019;
  --panel-2: #1b1623;
  --line: #3a3350;
  --gold: #c6a65c;
  --gold-dim: #8a7440;
  --text: #eae2d0;
  --dim: #9b9182;
  --danger: #e06060;
  --ok: #4ec9a0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: radial-gradient(circle at 50% 0%, #1a1426 0%, #060509 62%) no-repeat, var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}

a { color: var(--gold); text-decoration: none; }

/* ---------- 布局 ---------- */
.wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px 16px;
}
.panel {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 20px; box-shadow: 0 18px 50px #000a;
}

.brand { text-align: center; margin-bottom: 18px; }
.brand .en {
  font-size: 20px; letter-spacing: 2px; color: var(--gold); font-weight: 700;
}
.brand .cn {
  margin-top: 4px; font-size: 11px; letter-spacing: 4px; color: var(--dim);
}

h1 { font-size: 16px; margin: 0 0 14px; color: var(--gold); font-weight: 600; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; color: var(--dim); margin-bottom: 5px; letter-spacing: 1px;
}
.field input, .field select {
  width: 100%; padding: 10px 11px; font-size: 14px;
  background: #0d0a12; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.field .hint { font-size: 10px; color: #6f6656; margin-top: 4px; line-height: 1.4; }

.btn {
  width: 100%; padding: 11px 0; font-size: 14px; font-weight: 600;
  border-radius: 9px; border: 1px solid var(--line);
  background: #171320; color: var(--text); cursor: pointer;
  transition: transform .08s, border-color .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  border-color: var(--gold); color: #1a1408;
  background: linear-gradient(180deg, #e2c983, #b9963f);
}
.btn-ghost { background: transparent; color: var(--gold); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.switch { margin-top: 14px; text-align: center; font-size: 12px; color: var(--dim); }

.msg {
  margin: 10px 0 0; font-size: 12px; line-height: 1.5;
  min-height: 18px; text-align: center;
}
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* ---------- 头像选择 ---------- */
.avatar-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  max-height: 190px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: #0d0a12;
}
.avatar-grid .av {
  aspect-ratio: 1/1; border-radius: 6px; border: 1px solid #2e2740;
  background: radial-gradient(circle at 50% 40%, #241d33 0%, #0f0c15 78%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.avatar-grid .av img { width: 90%; height: 90%; object-fit: contain; image-rendering: pixelated; }
.avatar-grid .av.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 8px #c6a65c66; }

/* ---------- 首页 ---------- */
.top {
  width: 100%; max-width: 420px; display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.top .face {
  width: 56px; height: 56px; border-radius: 8px; border: 1px solid #3a3048;
  background: radial-gradient(circle at 50% 40%, #241d33 0%, #0f0c15 78%);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto;
}
.top .face img { width: 94%; height: 94%; object-fit: contain; image-rendering: pixelated; }
.top .who { flex: 1 1 auto; min-width: 0; }
.top .who .nm { font-size: 16px; color: var(--gold); }
.top .who .id { font-size: 11px; color: var(--dim); margin-top: 2px; }
.top .who .st { font-size: 11px; margin-top: 4px; }
.top .who .st.warn { color: #e0a060; }
.top .who .st.done { color: var(--ok); }

.menu { width: 100%; max-width: 420px; margin-top: 14px; display: grid; gap: 10px; }
.menu .big {
  padding: 18px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #1d1727, #12101a);
  color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.menu .big .sub { font-size: 11px; color: var(--dim); font-weight: 400; margin-top: 3px; }
.menu .big.primary { border-color: var(--gold); color: #1a1408; background: linear-gradient(180deg, #e2c983, #b9963f); }
.menu .big.primary .sub { color: #4a3a12; }
.menu .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 加入房间 ---------- */
.code-input {
  width: 100%; padding: 14px; text-align: center; letter-spacing: 6px;
  font-size: 22px; font-weight: 700; color: var(--gold);
  background: #0d0a12; border: 1px solid var(--line); border-radius: 10px; outline: none;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--gold); }

.foot { margin-top: 16px; font-size: 10px; color: #4f4839; text-align: center; }
