/* 今晚屌鳩你 - 水墨 Pokemon 式對戰畫面 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #1a1a1a;
  font-family: "PingFang HK", "PingFang TC", "Microsoft JhengHei", sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 書法字體栈（系統自帶，無外部字體）*/
:root {
  --kai: "Kaiti SC", "STKaiti", "DFKai-SB", "KaiTi", "BiauKai", serif;
  --paper: #f7f3ea;
  --paper-dark: #efe8d8;
  --ink: #1a1a1a;
  --ink-soft: #2c2c2c;
  --ink-gray: #8a8a8a;
  --cinnabar: #c03f2b;
}

#gameboy {
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(44,44,44,0.04), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(44,44,44,0.05), transparent 50%),
    linear-gradient(160deg, #f7f3ea 0%, #efe8d8 100%);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* ===== 標題 + 印章 ===== */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.game-title {
  font-family: var(--kai);
  font-size: 30px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 6px;
  text-shadow: 1px 2px 0 rgba(44,44,44,0.18);
  line-height: 1.1;
}

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #c03f2b;
  color: #f7f3ea;
  font-family: var(--kai);
  font-size: 16px;
  font-weight: 900;
  border-radius: 3px;
  box-shadow: 1px 1px 0 rgba(26,26,26,0.35);
  transform: rotate(-4deg);
}

/* ===== 對戰區（3:2.5 landscape，水墨山水）===== */
.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2.5;
  max-height: 52dvh;
  background:
    radial-gradient(ellipse at 70% 12%, rgba(138,138,138,0.10), transparent 60%),
    linear-gradient(180deg, #f2ecdd 0%, #ece4d0 55%, #e4dbc4 100%);
  border: 3px solid #2c2c2c;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.clouds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 地面（淡墨暈染）*/
.ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26%;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(44,44,44,0.30), transparent 70%),
    radial-gradient(ellipse at 75% 20%, rgba(44,44,44,0.22), transparent 65%),
    linear-gradient(180deg, #ddd3ba 0%, #cfc4a6 100%);
  border-top: 2px solid #2c2c2c;
  z-index: 1;
}

/* ===== Sprite（水墨人物剪影）===== */
.sprite {
  position: absolute;
  transform-origin: center bottom;
}

.cpu-sprite {
  top: 6%;
  left: 8%;
  height: 42%;
  z-index: 2;
}

.player-sprite {
  bottom: 24%;
  right: 6%;
  height: 58%;
  z-index: 2;
}

/* 攻擊動畫：玩家向左上衝、CPU 向右下衝 */
@keyframes lunge-player {
  0%   { transform: translate(0,0); }
  30%  { transform: translate(-20px,-14px) scale(1.06); }
  60%  { transform: translate(5px,4px); }
  100% { transform: translate(0,0); }
}
@keyframes lunge-cpu {
  0%   { transform: translate(0,0); }
  30%  { transform: translate(20px,14px) scale(1.06); }
  60%  { transform: translate(-5px,-4px); }
  100% { transform: translate(0,0); }
}
.sprite.attack-player { animation: lunge-player 0.45s ease; }
.sprite.attack-cpu    { animation: lunge-cpu 0.45s ease; }

/* 受擊：撞擊搖晃 + 閃白 */
@keyframes hit-shake {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  15%  { transform: translate(-9px,4px) rotate(-8deg); opacity: 0.55; }
  30%  { transform: translate(8px,-3px) rotate(7deg); opacity: 1; }
  45%  { transform: translate(-6px,3px) rotate(-5deg); opacity: 0.7; }
  60%  { transform: translate(5px,-2px) rotate(4deg); }
  75%  { transform: translate(-3px,1px) rotate(-2deg); }
  100% { transform: translate(0,0) rotate(0); }
}
@keyframes flash-white {
  0%, 40% { filter: brightness(2.4) saturate(0); }
  100%    { filter: none; }
}
.sprite.hit { animation: hit-shake 0.55s ease, flash-white 0.4s ease; }

/* ===== HP 框（宣紙卡片 + 墨框）===== */
.hp-box {
  position: absolute;
  width: 43%;
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  padding: 4px 8px 6px;
  z-index: 3;
  box-shadow: 2px 2px 0 rgba(26,26,26,0.18);
}

.cpu-hp-box    { top: 30%; left: 4%; }
.player-hp-box { top: 30%; right: 4%; }

.hp-box-name {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 900;
  color: #1a1a1a;
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.hp-box-name .lv { font-size: 11px; color: #8a8a8a; }

.hp-box-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hp-label {
  font-size: 9px;
  font-weight: 900;
  color: #c03f2b;
}

.hp-track {
  flex: 1;
  height: 8px;
  background: #e4dbc4;
  border: 1px solid #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: #1a1a1a;
  transition: width 0.45s ease, background 0.45s ease;
}
.hp-fill.mid { background: #5a5a5a; }
.hp-fill.low { background: #c03f2b; }

.hp-num {
  font-size: 10px;
  font-weight: 900;
  color: #2c2c2c;
  min-width: 22px;
  text-align: right;
}

/* ===== 底部文字框（宣紙墨字）===== */
.text-box {
  position: absolute;
  left: 2.5%;
  right: 2.5%;
  bottom: 3%;
  min-height: 32%;
  max-height: 40%;
  background: #f2ecdd;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  padding: 6px 10px;
  overflow-y: auto;
  z-index: 4;
  font-size: 13px;
  line-height: 1.55;
}

.log-line { margin-bottom: 3px; color: #2c2c2c; }
.log-line.attack { color: #c03f2b; font-weight: bold; }
.log-line.praise { color: #8a6d1f; font-weight: bold; }
.log-line.intro  { color: #8a8a8a; font-style: italic; }

/* ===== 絕招彈字（位置/大小/動畫不變，只換配色）===== */
.ultimate-banner {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  font-family: var(--kai);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1a1a1a;
  text-shadow:
    2px 2px 0 rgba(26,26,26,0.25),
    0 0 18px rgba(192, 63, 43, 0.95),
    0 0 34px rgba(192, 63, 43, 0.55);
  animation: ultPop 0.9s ease-out forwards;
}
.ultimate-banner.player { top: 3%; }
.ultimate-banner.cpu {
  top: 16%;
  color: #c03f2b;
  text-shadow:
    2px 2px 0 rgba(26,26,26,0.55),
    -1px -1px 0 rgba(26,26,26,0.35),
    0 0 18px rgba(26, 26, 26, 0.6);
}
@keyframes ultPop {
  0%   { transform: scale(3.2); opacity: 0; }
  25%  { transform: scale(0.95); opacity: 1; }
  45%  { transform: scale(1.12); }
  65%  { transform: scale(1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== 選字區 ===== */
.selected-chars {
  background: #efe8d8;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 6px;
  min-height: 40px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #1a1a1a;
  flex-shrink: 0;
}

.selected-chars .placeholder { color: #8a8a8a; font-size: 12px; font-weight: normal; }

.selected-chars .char {
  min-width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: #f7f3ea;
  border-radius: 4px;
  font-size: 17px;
  font-family: var(--kai);
  padding: 0 4px;
}

/* ===== 計時器 ===== */
.timer {
  text-align: center;
  font-family: var(--kai);
  font-size: 20px;
  font-weight: bold;
  color: #2c2c2c;
  min-height: 24px;
  flex-shrink: 0;
}
.timer.low { color: #c03f2b; animation: pulse 0.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ===== 字 grid ===== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 3px;
  flex-shrink: 0;
}

.char-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.1s;
  font-family: var(--kai);
  min-height: 34px;
  padding: 1px;
  overflow: hidden;
}

.char-cell:hover { background: #efe8d8; }

/* 墨暈散開動畫 */
@keyframes inkSplash {
  0%   { transform: scale(0); opacity: 0.55; }
  100% { transform: scale(2.6); opacity: 0; }
}

.char-cell.selected {
  border-color: #c03f2b;
  background: #f3dcd6;
  color: #c03f2b;
  transform: scale(0.93);
}

.char-cell.selected::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,26,26,0.5) 0%, rgba(26,26,26,0.15) 55%, transparent 75%);
  animation: inkSplash 0.45s ease-out forwards;
  pointer-events: none;
}

/* ===== 出招 / 重開 ===== */
.attack-btn {
  background: #c03f2b;
  color: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: var(--kai);
  letter-spacing: 4px;
  box-shadow: 2px 2px 0 rgba(26,26,26,0.3);
}

.attack-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.attack-btn:not(:disabled):hover { background: #d04a35; }
.attack-btn:not(:disabled):active { box-shadow: none; transform: translate(1px,1px); }

.restart-btn {
  background: transparent;
  color: #2c2c2c;
  border: 2px solid #2c2c2c;
  border-radius: 6px;
  padding: 4px;
  font-size: 11px;
  font-family: var(--kai);
  cursor: pointer;
  flex-shrink: 0;
}
.restart-btn:hover { background: #2c2c2c; color: #f7f3ea; }

/* ===== 三屏切換（150ms fade）===== */
.hidden { display: none !important; }
.screen { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.screen.hidden { display: none; }
.screen.fade-in { animation: screenFade 0.15s ease; }
@keyframes screenFade { from { opacity: 0; } to { opacity: 1; } }

/* ===== 登入畫面 ===== */
.login-card {
  background: #efe8d8;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  box-shadow: 3px 3px 0 rgba(26,26,26,0.18);
}
.field-label {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 900;
  color: #2c2c2c;
}
.ink-input {
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 18px;
  font-family: var(--kai);
  color: #1a1a1a;
  outline: none;
}
.ink-input:focus { border-color: #c03f2b; }
.login-error {
  min-height: 18px;
  font-size: 13px;
  color: #c03f2b;
  font-weight: bold;
}
.login-note {
  text-align: center;
  font-size: 12px;
  color: #8a8a8a;
  margin-top: 2px;
}

/* ===== 玩家主頁 ===== */
.home-title { font-size: 24px; }
.home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 2px;
}
.home-name {
  font-family: var(--kai);
  font-size: 24px;
  font-weight: 900;
  color: #1a1a1a;
}
.home-title-text {
  font-size: 13px;
  color: #c03f2b;
  font-family: var(--kai);
  font-weight: 900;
  letter-spacing: 2px;
}
.logout-link {
  font-size: 12px;
  color: #8a8a8a;
  text-decoration: none;
  border-bottom: 1px solid #8a8a8a;
  padding-top: 6px;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.level-badge {
  background: #1a1a1a;
  color: #f7f3ea;
  font-family: var(--kai);
  font-weight: 900;
  font-size: 14px;
  border-radius: 4px;
  padding: 3px 8px;
  flex-shrink: 0;
}
.xp-track {
  flex: 1;
  height: 10px;
  background: #e4dbc4;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  width: 0%;
  background: #c03f2b;
  transition: width 0.4s ease;
}
.xp-num { font-size: 11px; color: #2c2c2c; font-weight: bold; flex-shrink: 0; }

.stat-cards {
  display: flex;
  gap: 6px;
}
.stat-card {
  flex: 1;
  background: #efe8d8;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  box-shadow: 2px 2px 0 rgba(26,26,26,0.15);
}
.stat-value {
  font-family: var(--kai);
  font-size: 22px;
  font-weight: 900;
  color: #1a1a1a;
}
.stat-sub { font-size: 12px; color: #8a8a8a; }
.stat-label {
  font-size: 11px;
  color: #2c2c2c;
  margin-top: 2px;
}
.points-countdown { color: #c03f2b; font-weight: bold; }

.record-line {
  text-align: center;
  font-size: 13px;
  color: #2c2c2c;
  font-family: var(--kai);
  font-weight: 900;
  letter-spacing: 1px;
}

.disabled-btn {
  background: #8a8a8a !important;
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== PvP 大廳 ===== */
.pvp-panel {
  background: #efe8d8;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  box-shadow: 3px 3px 0 rgba(26,26,26,0.18);
  align-items: stretch;
  text-align: center;
}
.pvp-panel.hidden { display: none; }
.pvp-note { font-size: 12px; color: #8a8a8a; }
.pvp-divider {
  font-family: var(--kai);
  color: #8a8a8a;
  font-size: 13px;
  letter-spacing: 4px;
}
.pvp-code-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 10px;
  text-transform: uppercase;
}
.pvp-error {
  min-height: 18px;
  font-size: 13px;
  color: #c03f2b;
  font-weight: bold;
}
.pvp-code-label {
  font-family: var(--kai);
  font-size: 14px;
  color: #8a8a8a;
  letter-spacing: 6px;
}
.pvp-code {
  font-family: var(--kai);
  font-size: 64px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 18px;
  text-indent: 18px; /* 視覺置中（補 letter-spacing 尾部）*/
  line-height: 1.1;
  text-shadow: 2px 2px 0 rgba(44,44,44,0.18);
}
.pvp-hint { font-size: 13px; color: #2c2c2c; font-family: var(--kai); }

/* 等待動畫：墨點 */
.ink-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 6px 0;
}
.ink-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c2c2c;
  animation: inkDot 1.2s ease-in-out infinite;
}
.ink-dots span:nth-child(2) { animation-delay: 0.2s; }
.ink-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes inkDot {
  0%, 100% { transform: scale(0.6); opacity: 0.3; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.pvp-count-num {
  font-family: var(--kai);
  font-size: 96px;
  font-weight: 900;
  color: #c03f2b;
  text-shadow: 3px 3px 0 rgba(26,26,26,0.25);
  animation: countPop 0.9s ease;
}
@keyframes countPop {
  0% { transform: scale(2.4); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== PvP 咪高峰 ===== */
.mic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-shrink: 0;
}
.mic-row.hidden { display: none; }
.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #2c2c2c;
  border: 2px solid #2c2c2c;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: var(--kai);
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 2px;
}
.mic-btn.on {
  background: #c03f2b;
  border-color: #1a1a1a;
  color: #f7f3ea;
}
.mic-status { font-size: 12px; color: #8a8a8a; }
.mic-status.on { color: #c03f2b; font-weight: bold; }

.collection-section {
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background: #f2ecdd;
  padding: 8px;
  flex: 1;
  min-height: 80px;
}
.collection-title {
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 3px;
  margin-bottom: 6px;
  border-bottom: 1px solid #8a8a8a;
  padding-bottom: 4px;
}
.collection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.collection-list .placeholder { color: #8a8a8a; font-size: 12px; }

/* ===== 排行榜（主頁） ===== */
.leaderboard-section { flex: none; min-height: 0; }
.leaderboard-list { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f3ea;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
}
.lb-row.you { background: #f5e0d8; border: 1px solid #c03f2b; }
.lb-rank {
  font-family: var(--kai);
  font-weight: 900;
  font-size: 14px;
  width: 22px;
  text-align: center;
  color: #8a8a8a;
  flex-shrink: 0;
}
.lb-rank.top { color: #c03f2b; font-size: 16px; }
.lb-name { font-family: var(--kai); font-weight: 900; color: #1a1a1a; flex: 1; }
.lb-title { font-size: 10px; color: #8a8a8a; flex-shrink: 0; }
.lb-wins { font-family: var(--kai); font-weight: 900; color: #1a1a1a; flex-shrink: 0; }
.lb-sep { text-align: center; color: #8a8a8a; font-size: 11px; line-height: 1; }

/* ===== 意見回饋（玩家主頁） ===== */
.feedback-link {
  background: none;
  border: none;
  padding: 4px;
  align-self: center;
  font-family: var(--kai);
  font-size: 12px;
  color: #8a8a8a;
  text-decoration: underline;
  cursor: pointer;
}
.feedback-link:hover { color: #2c2c2c; }
.feedback-panel {
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background: #f2ecdd;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--kai);
  font-size: 14px;
  color: #1a1a1a;
  resize: vertical;
  outline: none;
}
.feedback-textarea:focus { border-color: #c03f2b; }
.feedback-actions { display: flex; gap: 6px; justify-content: flex-end; }
.feedback-status { font-size: 12px; color: #8a6d2b; min-height: 14px; text-align: center; }
.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f7f3ea;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 3px 7px;
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 900;
  color: #1a1a1a;
}
.word-count { font-size: 10px; color: #c03f2b; font-weight: bold; }

/* ===== 結算 overlay ===== */
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(247, 243, 234, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: screenFade 0.15s ease;
}
.result-overlay.hidden { display: none; }
.result-verdict {
  font-family: var(--kai);
  font-size: 54px;
  font-weight: 900;
  color: #c03f2b;
  letter-spacing: 8px;
  text-shadow: 2px 2px 0 rgba(26,26,26,0.25);
}
.result-verdict.lose { color: #2c2c2c; }
.result-xp {
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
}
.result-levelup {
  background: #c03f2b;
  color: #f7f3ea;
  font-family: var(--kai);
  font-weight: 900;
  font-size: 15px;
  border-radius: 4px;
  padding: 4px 12px;
  box-shadow: 2px 2px 0 rgba(26,26,26,0.3);
}
.result-levelup.hidden { display: none; }
.result-overlay .attack-btn { padding: 8px 28px; }

/* ===== 戰績卡（結算畫面內） ===== */
.result-card {
  width: min(260px, 78vw);
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(26,26,26,0.3);
}

/* ===== 全服戰報彈幕 ===== */
.feed-marquee {
  height: 28px;
  overflow: hidden;
  background: #1a1a1a;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.feed-track {
  display: inline-flex;
  white-space: nowrap;
  animation: feedScroll 30s linear infinite;
  will-change: transform;
}
@keyframes feedScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.feed-item {
  font-family: var(--kai);
  font-size: 13px;
  padding: 0 6px;
  color: #f2ecdd;
}
.feed-item.draw { color: #e07a5f; }
.feed-empty {
  font-family: var(--kai);
  font-size: 13px;
  color: #f2ecdd;
  padding: 0 10px;
}

/* ===== 電腦版 ===== */
@media (min-width: 500px) {
  body { padding: 12px; align-items: center; }
  #gameboy {
    height: calc(100dvh - 24px);
    max-height: 860px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 3px solid #2c2c2c;
  }
  .arena { max-height: 54dvh; }
  .char-cell { min-height: 42px; font-size: 20px; }
  .game-title { font-size: 34px; }
}

/* ===== 矮屏手機 ===== */
@media (max-height: 700px) {
  #gameboy { gap: 4px; padding: 6px 10px; }
  .game-title { font-size: 24px; letter-spacing: 4px; }
  .seal { width: 22px; height: 22px; font-size: 13px; }
  .arena { max-height: 40dvh; }
  .text-box { font-size: 11px; padding: 4px 8px; }
  .selected-chars { min-height: 32px; padding: 4px; }
  .timer { font-size: 16px; min-height: 20px; }
  .char-cell { min-height: 26px; font-size: 14px; }
  .attack-btn { padding: 6px; font-size: 14px; }
  .restart-btn { padding: 2px; font-size: 10px; }
}

/* ===== 管理員後台 ===== */
.admin-section {
  background: #efe8d8;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 14px 12px;
  box-shadow: 3px 3px 0 rgba(26,26,26,0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-section-title {
  font-family: var(--kai);
  font-size: 17px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 3px;
  border-bottom: 1px solid #8a8a8a;
  padding-bottom: 5px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.admin-grid .stat-card { padding: 8px 4px; }
.admin-grid .stat-value { font-size: 20px; }

/* 7日流量柱狀圖 */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
  padding: 6px 2px 0;
}
.chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 96px;
}
.chart-bar {
  width: 9px;
  min-height: 2px;
  background: #1a1a1a;
  border-radius: 2px 2px 0 0;
}
.chart-bar.api { background: #8a8a8a; }
.chart-bar.battle { background: #c03f2b; }
.chart-day-label {
  font-size: 10px;
  color: #2c2c2c;
  white-space: nowrap;
}
.chart-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 11px;
  color: #2c2c2c;
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}
.chart-legend .lg-pv::before { background: #1a1a1a; }
.chart-legend .lg-api::before { background: #8a8a8a; }
.chart-legend .lg-battle::before { background: #c03f2b; }

/* 排行榜 */
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f3ea;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
}
.rank-num {
  font-family: var(--kai);
  font-weight: 900;
  color: #c03f2b;
  min-width: 20px;
}
.rank-main { flex: 1; font-family: var(--kai); font-weight: 900; color: #1a1a1a; }
.rank-sub { font-size: 11px; color: #8a8a8a; }
.admin-subtitle {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 900;
  color: #2c2c2c;
  letter-spacing: 2px;
  margin-top: 4px;
}

/* 用戶管理 */
.player-row {
  background: #f7f3ea;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.player-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-row-name {
  font-family: var(--kai);
  font-weight: 900;
  font-size: 15px;
  color: #1a1a1a;
  flex: 1;
}
.admin-badge {
  background: #c03f2b;
  color: #f7f3ea;
  font-size: 10px;
  font-weight: 900;
  border-radius: 3px;
  padding: 1px 5px;
}
.player-row-meta { font-size: 11px; color: #2c2c2c; }
.player-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn {
  background: transparent;
  color: #2c2c2c;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: var(--kai);
  font-weight: 900;
  cursor: pointer;
}
.mini-btn:hover { background: #2c2c2c; color: #f7f3ea; }
.mini-btn.danger { color: #c03f2b; border-color: #c03f2b; }
.mini-btn.danger:hover { background: #c03f2b; color: #f7f3ea; }

/* 設定表單 */
.settings-form { display: flex; flex-direction: column; gap: 8px; }
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-label {
  flex: 1;
  font-size: 13px;
  color: #2c2c2c;
  font-weight: bold;
}
.setting-input {
  width: 90px;
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 15px;
  font-family: var(--kai);
  color: #1a1a1a;
  text-align: right;
  outline: none;
}
.setting-input:focus { border-color: #c03f2b; }

/* 詞彙管理 */
.phrase-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.phrase-word-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 15px;
}
.phrase-type-select {
  background: #f7f3ea;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 13px;
  font-family: var(--kai);
  color: #1a1a1a;
}
.phrase-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: #f7f3ea;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
}
.phrase-row.disabled { opacity: 0.45; }
.phrase-word {
  flex: 1;
  min-width: 60px;
  white-space: nowrap;
  font-family: var(--kai);
  font-weight: 900;
  font-size: 15px;
  color: #1a1a1a;
}
.phrase-kind { font-size: 10px; color: #8a8a8a; flex-shrink: 0; }
.phrase-uses { font-size: 10px; color: #8a6d2b; flex-shrink: 0; white-space: nowrap; }
.phrase-eff-mult { font-size: 11px; font-weight: 900; color: #c03f2b; flex-shrink: 0; white-space: nowrap; }

/* 意見收集（後台） */
.feedback-row {
  background: #f7f3ea;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}
.feedback-meta { font-size: 10px; color: #8a8a8a; margin-bottom: 2px; }
.feedback-msg { color: #1a1a1a; white-space: pre-wrap; word-break: break-word; }
.phrase-mult-input {
  width: 52px;
  background: #f7f3ea;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 13px;
  font-family: var(--kai);
  text-align: right;
  outline: none;
}
.phrase-mult-input:focus { border-color: #c03f2b; }

/* toast 提示 */
.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #f7f3ea;
  font-family: var(--kai);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: 6px;
  padding: 9px 20px;
  box-shadow: 2px 2px 0 rgba(26,26,26,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99;
}
.admin-toast.show { opacity: 1; }
