/* ============================================================
   hiroakiishibashi.com - Global Styles
   ============================================================ */

:root {
  --bg:        #0d0d1a;
  --bg2:       #13132b;
  --surface:   #1a1a35;
  --accent:    #7c5cff;
  --accent2:   #00d4ff;
  --text:      #e8e8f0;
  --text-muted:#8888aa;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(124,92,255,0.15);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ---- Navigation ---- */
nav {
  background: var(--bg2);
  border-bottom: 1px solid rgba(124,92,255,0.2);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #6a4ee0; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,92,255,0.15) 0%, transparent 70%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* ---- Game Cards ---- */
.section { padding: 3rem 2rem; max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg2), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.game-info { padding: 1rem; }

.game-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }

.game-info p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.8rem; }

.game-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.tag {
  background: rgba(124,92,255,0.15);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---- Leaderboard Table ---- */
.leaderboard {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  padding: 0.9rem 1.2rem;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.lb-row:hover { background: rgba(255,255,255,0.03); }
.lb-row:last-child { border-bottom: none; }

.lb-rank { font-weight: 800; color: var(--text-muted); }
.lb-rank.gold   { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-score { font-weight: 700; color: var(--accent2); }

/* ---- Auth Forms ---- */
.auth-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-card h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.error-msg {
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.3);
  color: #ff8080;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* ---- Game Frame ---- */
.game-frame-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
}

.game-frame {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 80vh;
  border: none;
  border-radius: var(--radius);
  background: #000;
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a { color: var(--text-muted); margin: 0 0.8rem; }
footer a:hover { color: var(--text); }
