:root {
  --bg: #e6f6fd;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --text-main: #14384a;
  --text-sub: #557d8e;
  --border: rgba(150, 200, 220, 0.45);
  --accent: #1795c6;
  --accent-hover: #1180ad;
  --sky: #3ab5e0;
  --sky-hover: #2b9dc6;
  --sand: #f0e3c0;
  --discord: #5865f2;
  --danger: #e0685f;
  --success: #17a68a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: linear-gradient(180deg, #bfe4fa 0%, #dcf1fc 38%, #eef8fc 68%, #f7efdd 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  touch-action: manipulation;
}

/* 海面の光のようなゆらぎ（ごく控えめ） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 300px at 15% 12%, rgba(255, 255, 255, 0.5), transparent 70%),
    radial-gradient(520px 360px at 85% 30%, rgba(120, 205, 240, 0.28), transparent 70%),
    radial-gradient(460px 320px at 45% 85%, rgba(240, 227, 192, 0.35), transparent 70%);
  animation: sea-drift 16s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes sea-drift {
  from { transform: translate3d(0, 0, 0); opacity: 0.9; }
  to   { transform: translate3d(-18px, 10px, 0); opacity: 1; }
}

body > * { position: relative; z-index: 1; }

a { color: var(--sky-hover); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.container h1 { font-size: 1.6rem; margin: 8px 0 6px; }
.container > p { margin-top: 4px; }
canvas { max-width: 100%; }

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  z-index: 10;
}

header.site-header .logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #1180ad, #3ab5e0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.site-header nav {
  display: flex;
  gap: 12px 16px;
  align-items: center;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

header.site-header nav > * { white-space: nowrap; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 28px rgba(23, 120, 165, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-up 0.4s ease both;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.game-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(23, 120, 165, 0.10);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: fade-up 0.45s ease both;
}
.game-grid .game-card:nth-child(2) { animation-delay: 0.04s; }
.game-grid .game-card:nth-child(3) { animation-delay: 0.08s; }
.game-grid .game-card:nth-child(4) { animation-delay: 0.12s; }
.game-grid .game-card:nth-child(5) { animation-delay: 0.16s; }
.game-grid .game-card:nth-child(6) { animation-delay: 0.20s; }
.game-grid .game-card:nth-child(7) { animation-delay: 0.24s; }
.game-grid .game-card:nth-child(8) { animation-delay: 0.28s; }

.game-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(23, 120, 165, 0.18);
}

.game-card .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sky), var(--accent) 60%, #6fd3c0);
  box-shadow: 0 4px 12px rgba(58, 181, 224, 0.35);
  transition: transform 0.25s ease;
}
.game-card:hover .icon { transform: translateY(-2px) rotate(-4deg) scale(1.06); }
.game-card h3 { margin: 0 0 4px; color: var(--text-main); }
.game-card p { margin: 0; color: var(--text-sub); font-size: 0.85rem; }
.game-card .tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(58, 181, 224, 0.16);
  color: var(--accent-hover);
  font-size: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--sky));
  color: white;
  box-shadow: 0 4px 12px rgba(23, 149, 198, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(23, 149, 198, 0.38); filter: brightness(1.05); }
.btn:active { transform: scale(0.97); }
.btn.sky { background: linear-gradient(135deg, var(--sky), #6fd3c0); }
.btn.discord { background: var(--discord); }
.btn.discord:hover { background: #4752c4; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

input[type="email"], input[type="text"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="email"]:focus, input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(58, 181, 224, 0.2);
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-sub); font-weight: 600; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.5); }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.tab:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.85); }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--sky)); color: white; border-color: transparent; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(23, 166, 138, 0.14); color: var(--success); font-size: 0.75rem; }
.msg { padding: 12px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; animation: fade-up 0.3s ease both; }
.msg.success { background: rgba(23, 166, 138, 0.13); color: var(--success); }
.msg.error { background: rgba(224, 104, 95, 0.12); color: var(--danger); }

footer { text-align: center; color: var(--text-sub); font-size: 0.8rem; padding: 40px 20px; }

/* ===== ポップバナー（連鎖・攻撃演出などの共通スタイル） ===== */
.pop-banner-wrap {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
.pop-banner-wrap.show { animation: pop-banner-in 1.5s cubic-bezier(0.22, 0.9, 0.3, 1) forwards; }
@keyframes pop-banner-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-6deg); }
  35%  { opacity: 1; transform: translate(-50%, -50%) scale(1.22) rotate(3deg); }
  50%  { transform: translate(-50%, -50%) scale(0.95) rotate(-2deg); }
  65%  { transform: translate(-50%, -50%) scale(1.05) rotate(1deg); }
  80%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
.pop-banner {
  display: inline-block;
  padding: 10px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent), var(--sky));
  box-shadow: 0 5px 0 rgba(0,0,0,0.18), 0 12px 26px rgba(0,0,0,0.25);
  text-shadow: 0 2px 0 rgba(0,0,0,0.22);
  border: 2px solid rgba(255,255,255,0.5);
}
.pop-banner.pop-danger { background: linear-gradient(135deg, #ff9d8a, var(--danger)); }
.pop-banner.pop-gold { background: linear-gradient(135deg, #ffe08a, #f0b429); color: #5b3d00; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.pop-banner.pop-purple { background: linear-gradient(135deg, #c39bf0, #9b51e0); }
