/* Sunset-over-the-village palette: sky blue fading into a burning
   orange-red horizon, the two colors most associated with Naruto himself
   (his jacket, his headband) -- plus the original "forehead protector"
   framing as a homage that doesn't reuse any show art. */
@font-face {
  font-family: "Kouzan";
  src: url("../assets/fonts/kouzan_mouhitsu.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg-top: #0c3b5e;
  --bg-bottom: #a8301a;
  --ink: #ffffff;
  --ink-dim: #a9c4dc;
  --accent: #ff7a1a;
  --accent-2: #29b6f6;
  --good: #4ade80;
  --bad: #ff4646;
  --gold: #ffb238;
  --panel: #11273b;
  --panel-light: #1e3f58;
  --player: #29b6f6;
  --enemy: #ff5a3c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -10%, #1c6aa0 0%, var(--bg-top) 45%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { color: var(--accent-2); }

.wrap {
  width: 100%;
  max-width: 960px;
  padding: 28px 20px 60px;
}

h1.title {
  font-family: "Kouzan", "Segoe UI", sans-serif;
  font-size: clamp(34px, 11vw, 64px);
  text-align: center;
  margin: 18px 0 2px;
  font-weight: 800;
  letter-spacing: clamp(1px, 0.6vw, 4px);
  text-shadow: 0 0 22px var(--accent), 0 0 48px rgba(255, 122, 26, 0.5);
}

.brush { font-family: "Kouzan", "Segoe UI", sans-serif; }

.subtitle {
  text-align: center;
  color: var(--accent-2);
  letter-spacing: clamp(1px, 1vw, 6px);
  font-weight: 700;
  margin-bottom: 28px;
  text-transform: uppercase;
  font-size: clamp(11px, 3vw, 14px);
}

/* "Forehead protector" framed panel: a beveled metal-plate header bar,
   evoking a hitai-ate without reproducing the show's actual leaf emblem. */
.plate-panel {
  background: linear-gradient(180deg, var(--panel-light), var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.plate-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -22px -22px 18px;
  padding: 10px 20px;
  background: linear-gradient(180deg, #2f4d63, #1a2e3f);
  border-bottom: 3px solid var(--gold);
  border-radius: var(--radius) var(--radius) 0 0;
}

.plate-emblem {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.plate-header .plate-title {
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 13px;
  color: #ddd;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  border: 2px solid var(--accent-2);
  background: var(--panel-light);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 122, 26, 0.4); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #ff8a2e, #d9490f); border-color: var(--gold); color: #1a0f06; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 10px;
}
input:focus { outline: 2px solid var(--accent-2); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { flex: 1; min-width: 220px; }

.muted { color: var(--ink-dim); font-size: 14px; }
.center { text-align: center; }
.error-text { color: var(--bad); font-size: 14px; min-height: 18px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink-dim);
  font-weight: 700;
}
.tab.active { background: var(--panel-light); color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }

.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.15);
  border: 1px solid var(--accent);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

canvas { display: block; }

.news-item { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-item .news-tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  padding: 2px 8px; border-radius: 4px; background: var(--accent-2); color: #052733; margin-right: 8px;
}
.news-item .news-date { color: var(--ink-dim); font-size: 12px; }
.news-item .news-title { font-weight: 800; font-size: 17px; margin: 6px 0 4px; color: var(--gold); }
.news-item .news-body { color: var(--ink-dim); font-size: 14px; line-height: 1.5; }

@media (max-width: 480px) {
  .wrap { padding: 20px 12px 40px; }
  .plate-panel { padding: 16px; }
  .plate-header { margin: -16px -16px 16px; padding: 9px 14px; }
  .plate-emblem { width: 22px; height: 22px; }
}

.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 22px; text-align: center; font-weight: 800; color: var(--ink-dim); }
.lb-rank.gold { color: var(--gold); text-shadow: 0 0 8px var(--gold); }
.lb-name { flex: 1; font-weight: 700; }
.lb-score { font-size: 13px; color: var(--ink-dim); }
.match-row { padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 13px; }
.match-row:last-child { border-bottom: none; }
.match-row .winner { color: var(--good); font-weight: 700; }
.match-row .loser { color: var(--ink-dim); }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ach-cell {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
}
.ach-cell.unlocked { border-color: var(--gold); background: rgba(255, 178, 56, 0.1); }
.ach-icon { font-size: 26px; filter: grayscale(1) opacity(0.3); flex-shrink: 0; }
.ach-cell.unlocked .ach-icon { filter: none; }
.ach-text { min-width: 0; }
.ach-name { font-weight: 700; font-size: 13px; }
.ach-cell:not(.unlocked) .ach-name { color: var(--ink-dim); }
.ach-desc { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
