:root {
  --bg-dark: #1b2236;
  --bg-darker: #0f1420;
  --accent-orange: #ff7a1a;
  --accent-red: #d4001a;
  --accent-green: #00c853;
  --accent-blue: #1e90ff;
  --text-light: #ffffff;
  --text-muted: #9aa0ac;
  --card-white: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  max-width: 480px;
  margin-inline: auto;
  min-height: 100vh;
  padding-bottom: 70px;
  position: relative;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Top Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-dark);
}
.app-header .logo img {
  width: 42px; height: 42px; border-radius: 50%;
}
.app-header .welcome {
  text-align: center; flex: 1;
}
.app-header .welcome small { display: block; color: var(--text-muted); font-size: 13px; }
.app-header .welcome strong { font-size: 18px; }
.app-header .header-right { display: flex; align-items: center; gap: 10px; }
.coin-badge {
  background: #fff; color: #222; border-radius: 20px;
  padding: 4px 12px; display: flex; align-items: center; gap: 5px; font-weight: bold;
}

.page-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--bg-dark); font-weight: bold; font-size: 18px;
}
.page-header .back-btn { font-size: 22px; cursor: pointer; }

.notice-banner {
  display: flex; align-items: stretch; background: #fff; margin: 14px 16px;
  border-radius: var(--radius); overflow: hidden;
}
.notice-banner .icon { background: var(--accent-orange); color: #fff; display: flex; align-items: center; padding: 0 18px; }
.notice-banner .text { color: #222; padding: 16px; font-weight: 700; letter-spacing: 1px; flex: 1; }

.slider { margin: 0 16px; border-radius: var(--radius); overflow: hidden; }
.slider img { width: 100%; border-radius: var(--radius); }
.slider-dots { text-align: center; margin: 10px 0; }
.slider-dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin: 0 3px; }
.slider-dots span.active { background: var(--accent-red); }

.section-title { font-size: 20px; font-weight: 700; text-align: center; margin: 18px 0 14px; }

.matches-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px; }
.match-tile {
  background: #fff; color: #222; border-radius: var(--radius); padding: 18px 10px;
  text-align: center; font-weight: 700;
}
.match-tile .tile-icon {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}

.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.game-card { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1/1.1; }
.game-card img { width: 100%; height: 100%; object-fit: cover; }
.game-card .label {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6);
  font-size: 11px; padding: 5px; text-align: center; font-weight: 600;
}

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #000;
  display: flex; justify-content: space-around; padding: 10px 0 6px;
  border-top: 1px solid #222; z-index: 50;
}
.bottom-nav a { text-align: center; color: #aaa; font-size: 11px; }
.bottom-nav a.active { color: #fff; }
.bottom-nav a .nav-icon { font-size: 20px; display: block; margin-bottom: 2px; }

.match-card {
  background: #fff; color: #222; border-radius: var(--radius); margin: 16px;
  padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.match-card h3 { color: var(--accent-blue); margin: 0 0 10px; }
.match-info-grid { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.info-box { flex: 1; background: #f5f5f5; border-radius: 10px; padding: 10px 14px; min-width: 90px; }
.info-box .label { font-size: 11px; color: #999; text-transform: uppercase; }
.info-box .value { font-weight: 700; font-size: 16px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn { flex: 1; padding: 14px; border: none; border-radius: 8px; font-weight: 700; text-align: center; cursor: pointer; }
.btn-green { background: var(--accent-green); color: #fff; }
.btn-outline-red { background: transparent; border: 2px solid var(--accent-red); color: var(--accent-red); }
.btn-red { background: var(--accent-red); color: #fff; }
.btn-gray { background: #ccc; color: #555; }
.btn-full { width: 100%; }

.form-wrap { padding: 20px; }
.form-input {
  width: 100%; padding: 16px 18px; border-radius: 30px; border: 1px solid #ddd;
  margin-bottom: 16px; font-size: 15px; background: #fff; color: #222;
}
.form-title { font-size: 30px; font-weight: 800; color: var(--accent-red); margin-bottom: 20px; }
.btn-submit {
  width: 100%; padding: 16px; border-radius: 30px; border: none;
  background: var(--accent-red); color: #fff; font-weight: 700; font-size: 16px;
}

.empty-state { text-align: center; padding: 60px 30px; }
.empty-state h3 { color: var(--accent-orange); }
.empty-state p { color: var(--text-muted); }

.wallet-hero { background: #000; padding: 40px 20px; text-align: center; }
.wallet-hero .amount { font-size: 36px; font-weight: 800; }
.wallet-boxes { display: flex; gap: 10px; padding: 16px; }
.wallet-box { flex: 1; background: var(--accent-red); border-radius: 10px; padding: 16px; text-align: center; }
.wallet-box .num { font-size: 20px; font-weight: 800; }

.menu-list { padding: 16px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; color: #222; border-radius: 10px; padding: 16px;
  margin-bottom: 12px; font-weight: 600;
}
.menu-item .left { display: flex; align-items: center; gap: 14px; }
.menu-item .icon { color: var(--accent-blue); font-size: 20px; }

.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
table.admin-table th { background: #f3f4f6; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.badge-green { background: #d4f8e8; color: #00875a; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-red { background: #fde2e1; color: #c0392b; }

/* Rank medals (leaderboard) */
.rank-medal { display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%; font-weight:800; font-size:13px; }
.rank-1 { background:#FFD700; color:#7a5800; }
.rank-2 { background:#C0C0C0; color:#555; }
.rank-3 { background:#CD7F32; color:#fff; }

/* Coin display (replaces emoji coin) */
.coin-icon { color:#f5a623; margin-right:3px; }
.coin-amount { display:inline-flex; align-items:center; gap:4px; }
