/* =========================================================
   HIRANO GAMES — glass.css  (v2: Daylight Liquid Glass)
   デザインシステム: Windows 7 Aero × Apple Liquid Glass
   コンセプト修正: 暗い夜のガラス → 陽だまりのガラス張りゲームセンターへ。
   角R・不透明度を抑え、白を基調に「押したくなる」暖色CTAで導線を強調。
   ブランド: #1F2A5C / #3D4FA0 / #6B7EE8 (symbol.svg 由来) + 差し色 #FFB648
   ========================================================= */

:root {
  --navy:       #1F2A5C;
  --royal:      #3D4FA0;
  --violet:     #6B7EE8;
  --aero:       #9FD6FF;   /* 空色のガラス反射 */
  --sun:        #FFB648;   /* 差し色: 「押したくなる」暖色サイン */
  --sun-deep:   #FF8A3D;

  --paper:      #F4F6FC;   /* 陽だまりの背景 */
  --paper-hi:   #FFFFFF;

  --glass-bg:      rgba(255,255,255,.58);
  --glass-bg-hi:   rgba(255,255,255,.8);
  --glass-edge:    rgba(31,42,92,.10);   /* ガラス端の締め線(白背景での視認性用) */
  --glass-top:     rgba(255,255,255,.95); /* Aero 天面ハイライト */
  --glass-shadow:  rgba(31,42,92,.14);
  --text:       #1B2158;
  --text-dim:   rgba(27,33,88,.60);

  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --disp: "Sora", var(--sans);

  --radius:    18px;  /* 旧24pxから抑制 */
  --radius-sm: 10px;  /* 旧14pxから抑制 */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- 背景: 陽だまりの淡いオーブ ---------- */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1100px 750px at 88% -8%, rgba(107,126,232,.10), transparent 60%),
    radial-gradient(900px 700px at -8% 95%, rgba(255,182,72,.12), transparent 60%),
    var(--paper);
}
.bg-orbs::before, .bg-orbs::after {
  content: "";
  position: absolute;
  width: 44vmax; height: 44vmax;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .55;
  will-change: transform;
}
.bg-orbs::before {
  background: radial-gradient(circle at 30% 30%, rgba(107,126,232,.35), transparent 65%);
  top: -10vmax; left: -8vmax;
  animation: orbA 30s ease-in-out infinite alternate;
}
.bg-orbs::after {
  background: radial-gradient(circle at 60% 60%, rgba(255,182,72,.30), transparent 65%);
  bottom: -14vmax; right: -10vmax;
  animation: orbB 36s ease-in-out infinite alternate;
}
@keyframes orbA { to { transform: translate(7vmax, 6vmax) scale(1.12); } }
@keyframes orbB { to { transform: translate(-6vmax, -5vmax) scale(.92); } }

/* ---------- ガラスパネル ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow:
    0 16px 40px var(--glass-shadow),
    inset 0 1px 0 var(--glass-top);
  overflow: hidden;
}
/* Aero: 上半分のガラス光沢グラデーション(白背景向けに明るい艶) */
.glass::before {
  content: "";
  position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,0));
  pointer-events: none;
  border-radius: inherit;
}
/* Liquid Glass: ポインタ追従ハイライト(JSで --mx/--my を更新)。差し色を淡く通す */
.glass.liquid::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, -30%),
              rgba(255,182,72,.20), transparent 70%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.glass.liquid:hover::after { opacity: 1; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 12px; z-index: 100;
  margin: 12px auto 0;
  width: min(1080px, calc(100% - 24px));
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  border-radius: 20px; /* 旧999pxのピル形状から抑制 */
}
.site-header::before { border-radius: 20px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--navy);
  font-family: var(--disp);
  font-weight: 700; letter-spacing: .06em; font-size: 15px;
}
.brand img { width: 26px; height: auto; filter: drop-shadow(0 2px 6px rgba(61,79,160,.35)); }
.header-spacer { flex: 1; }
.nav-link {
  color: var(--text-dim); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: var(--radius-sm); transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--navy); background: rgba(31,42,92,.06); }

/* ---------- 認証チップ ---------- */
.auth-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim);
}
.auth-chip img.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--glass-edge);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 13.5px;
  color: var(--navy); text-decoration: none;
  padding: 9px 20px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.6));
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 4px 12px rgba(31,42,92,.10);
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(rgba(255,255,255,1), rgba(255,255,255,.75));
  box-shadow: inset 0 1px 0 var(--glass-top), 0 6px 18px rgba(61,79,160,.18);
}
.btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 2px;
}
/* CTAは差し色(暖色)のグラデーション + 呼吸する光で「押したくなる」を演出 */
.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, var(--sun), var(--sun-deep));
  border-color: rgba(255,182,72,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 20px rgba(255,138,61,.35);
  animation: cta-breathe 3.2s ease-in-out infinite;
}
.btn.primary:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 28px rgba(255,138,61,.5);
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 20px rgba(255,138,61,.30); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 26px rgba(255,138,61,.55); }
}
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; animation: none; }

/* ---------- ヒーロー ---------- */
.hero {
  width: min(1080px, calc(100% - 24px));
  margin: 48px auto 36px;
  text-align: center;
  padding: 56px 24px 48px;
}
.hero .symbol {
  width: 88px; height: auto;
  filter: drop-shadow(0 6px 16px rgba(61,79,160,.25));
}
.hero h1 {
  font-family: var(--disp);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 800; letter-spacing: .06em;
  margin: 18px 0 6px;
  background: linear-gradient(180deg, var(--navy) 10%, var(--royal) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead { color: var(--text-dim); font-size: 15px; margin: 0; }

/* Aero 走査光(バッジ・タイトル下線用) */
.scanline {
  position: relative; overflow: hidden;
}
.scanline::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 60px;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  animation: scan 3.5s ease-in-out infinite;
}
@keyframes scan { 0% { left: -80px; } 60%, 100% { left: 110%; } }

/* ---------- ゲームカードグリッド ---------- */
.section {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto 48px;
}
.section-title {
  font-family: var(--disp); font-weight: 700; letter-spacing: .12em;
  font-size: 13px; color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 16px 6px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.game-card {
  display: flex; flex-direction: column;
  padding: 0; text-decoration: none; color: var(--text);
  transition: transform .25s cubic-bezier(.2,.8,.3,1.2), box-shadow .25s;
}
.game-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 22px 44px var(--glass-shadow), inset 0 1px 0 var(--glass-top);
}
.game-card .card-visual {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 800; font-size: 26px; letter-spacing: .04em;
  color: var(--navy);
  position: relative;
}
/* シグネチャー要素: 「押したくなる」再生ボタン。常に静かに脈打ち、誘う */
.game-card .card-visual .play-tri {
  position: absolute; right: 18px; bottom: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--sun), var(--sun-deep));
  box-shadow: 0 6px 16px rgba(255,138,61,.4);
  transition: transform .2s, box-shadow .2s;
}
.game-card .card-visual .play-tri::before {
  content: "";
  width: 0; height: 0;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
  margin-left: 3px;
}
.game-card .card-visual .play-tri::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,182,72,.55);
  animation: play-pulse 2.2s ease-out infinite;
}
@keyframes play-pulse {
  0%   { transform: scale(.85); opacity: .8; }
  80%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
.game-card:hover .play-tri { transform: scale(1.12); box-shadow: 0 10px 22px rgba(255,138,61,.55); }
.game-card .card-body { padding: 16px 18px 18px; }
.game-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.game-card .tagline { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.game-card .badges { margin-top: 12px; display: flex; gap: 8px; }
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(31,42,92,.06); color: var(--text-dim);
  border: 1px solid var(--glass-edge);
}
.badge.maint { background: rgba(255,138,61,.14); color: #B5591C; border-color: rgba(255,138,61,.35); }
.game-card.is-maint { pointer-events: none; }
.game-card.is-maint .card-visual, .game-card.is-maint .card-body { opacity: .5; filter: saturate(.5); }
.game-card.is-maint .play-tri, .game-card.is-maint .play-tri::after { display: none; }

/* ---------- ランキング ---------- */
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th {
  text-align: left; font-size: 11px; letter-spacing: .1em; color: var(--text-dim);
  font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--glass-edge);
}
.rank-table td { padding: 10px 12px; border-bottom: 1px solid rgba(31,42,92,.06); }
.rank-table tr:last-child td { border-bottom: none; }
.rank-table .pos { font-family: var(--disp); font-weight: 800; width: 48px; color: var(--text-dim); }
.rank-table tr.top1 .pos { color: var(--sun-deep); }
.rank-table tr.top2 .pos { color: var(--royal); }
.rank-table tr.top3 .pos { color: #B5591C; }
.rank-table .score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.rank-table tr.me td { background: rgba(107,126,232,.10); }

/* ---------- フォーム / モーダル ---------- */
.login-panel {
  width: min(360px, calc(100% - 32px));
  margin: 18vh auto 0;
  padding: 36px 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.provider-btn { width: 100%; justify-content: center; }
.provider-btn svg { width: 18px; height: 18px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(27,33,88,.28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.show { display: flex; }

/* ---------- フッター ---------- */
.site-footer {
  width: min(1080px, calc(100% - 24px));
  margin: 64px auto 28px;
  text-align: center;
  color: var(--text-dim); font-size: 12px;
}
.site-footer a { color: var(--text-dim); text-decoration: none; margin: 0 10px; }
.site-footer a:hover { color: var(--navy); }

/* ---------- ユーティリティ ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .bg-orbs::before, .bg-orbs::after, .scanline::after,
  .btn.primary, .game-card .play-tri::after { animation: none; }
  .game-card, .btn { transition: none; }
}
@media (max-width: 640px) {
  .site-header { gap: 8px; padding: 8px 14px; }
  .nav-link { display: none; }
  .hero { padding: 40px 16px 36px; margin-top: 28px; }
}
