/* PIXEL 街机厅 - 2D 像素风 */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=ZCOOL+QingKe+HuangYou&display=swap');

:root {
  --bg: #1a1a2e;
  --panel: #16213e;
  --accent: #e94560;
  --gold: #f4d03f;
  --blue: #4fc3f7;
  --green: #2ecc71;
  --border: #0f3460;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Press Start 2P', 'ZCOOL QingKe HuangYou', monospace, sans-serif;
  background-image:
    linear-gradient(45deg, #16162a 25%, transparent 25%, transparent 75%, #16162a 75%),
    linear-gradient(45deg, #16162a 25%, transparent 25%, transparent 75%, #16162a 75%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: var(--panel);
  border-bottom: 4px solid var(--accent);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.wallet { display: flex; gap: 10px; align-items: center; }
.coin { font-size: 14px; color: var(--gold); }

.btn {
  font-family: inherit; font-size: 12px; cursor: pointer;
  padding: 10px 16px; color: #fff; border: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.5);
  transition: transform .05s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.btn-gold { background: #d4a017; }
.btn-blue { background: #2980b9; }
.btn-red { background: var(--accent); }
.btn-green { background: var(--green); color: #062b15; }

.container { width: min(960px, 94%); margin: 0 auto; flex: 1; padding: 24px 0; }

.banner {
  text-align: center; padding: 40px 16px;
  background: var(--panel); border: 4px solid var(--border);
  margin-bottom: 32px; box-shadow: 8px 8px 0 rgba(0,0,0,.4);
}
.banner h1 { font-size: 24px; color: var(--gold); margin-bottom: 16px; text-shadow: 3px 3px 0 #000; }
.banner p { font-size: 12px; line-height: 1.8; color: #aab; }

.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.game-card {
  display: block; text-decoration: none; color: #fff;
  background: var(--panel); border: 4px solid var(--border);
  padding: 24px; text-align: center;
  box-shadow: 6px 6px 0 rgba(0,0,0,.4);
  transition: transform .1s, border-color .1s;
}
.game-card:hover { transform: translate(-2px,-2px); border-color: var(--gold); }
.game-icon { font-size: 48px; margin-bottom: 16px; }
.game-card h2 { font-size: 14px; color: var(--blue); margin-bottom: 12px; }
.game-card p { font-size: 10px; line-height: 1.8; color: #aab; }

.panel {
  margin-top: 32px; background: var(--panel);
  border: 4px solid var(--border); padding: 20px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.4);
}
.panel h3 { font-size: 13px; color: var(--gold); margin-bottom: 12px; }
.panel li { font-size: 10px; line-height: 2; color: #aab; margin-left: 20px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--panel); border: 4px solid var(--gold);
  padding: 28px; text-align: center; width: min(420px, 90%);
  box-shadow: 8px 8px 0 rgba(0,0,0,.5);
}
.modal-box h3 { font-size: 15px; color: var(--gold); margin-bottom: 10px; }
.modal-box .tip { font-size: 10px; color: #888; margin-bottom: 20px; }
.recharge-list { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.btn-pack { background: #34495e; padding: 14px; line-height: 1.8; border: 2px solid var(--blue); }

.footer { text-align: center; padding: 16px; font-size: 9px; color: #666; background: var(--panel); line-height: 1.8; }

/* 游戏页共用 */
.game-wrap { text-align: center; padding: 20px 0; }
.game-wrap h1 { font-size: 18px; color: var(--gold); margin-bottom: 16px; text-shadow: 2px 2px 0 #000; }
.game-info { font-size: 12px; color: var(--blue); margin-bottom: 16px; display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
canvas { image-rendering: pixelated; border: 4px solid var(--border); background: #000; box-shadow: 6px 6px 0 rgba(0,0,0,.4); max-width: 100%; }
.game-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.back-link { display: inline-block; margin-top: 16px; color: var(--blue); font-size: 11px; text-decoration: none; }
.back-link:hover { color: var(--gold); }
.msg { font-size: 12px; color: var(--accent); margin: 12px 0; min-height: 16px; }

/* ===== 21 点扑克牌 ===== */
.table { background: #1e4620; border: 4px solid var(--gold); padding: 20px; margin: 16px 0; box-shadow: 6px 6px 0 rgba(0,0,0,.4); }
.hand-area h3 { font-size: 12px; color: var(--gold); margin-bottom: 10px; }
.cards { min-height: 90px; display: flex; gap: 10px; flex-wrap: wrap; }
.card {
  display: inline-block; width: 64px; height: 88px; background: #fff; color: #111;
  font-size: 16px; text-align: center; line-height: 1.3; padding-top: 12px;
  border-radius: 6px; box-shadow: 3px 3px 0 rgba(0,0,0,.5);
}
.card.red { color: #d32f2f; }
.card.back { background: #1a3f8f; color: #fff; font-size: 32px; padding-top: 20px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ===== 像素勇士战斗 ===== */
.battle-arena { display: flex; align-items: center; justify-content: space-around; gap: 12px; background: var(--panel); border: 4px solid var(--border); padding: 24px 16px; margin: 16px 0; }
.fighter { text-align: center; flex: 1; }
.sprite { font-size: 52px; margin-bottom: 12px; }
.vs { font-size: 18px; color: var(--accent); text-shadow: 2px 2px 0 #000; }
.hp-bar { height: 14px; background: #333; border: 2px solid #000; }
.hp-fill { height: 100%; transition: width .3s; }
.hp-fill.player { background: var(--green); }
.hp-fill.enemy { background: var(--accent); }
.hp-text { font-size: 10px; margin-top: 6px; color: #aab; }
.log { background: #000; border: 4px solid var(--border); color: #9f9; font-size: 11px; line-height: 1.8; padding: 14px; min-height: 60px; margin-bottom: 16px; }
