:root {
  --bg-gradient: linear-gradient(135deg, #1a1f3c 0%, #0d1226 100%);
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.22);
  --accent-blue: #00d2ff;
  --accent-pink: #ff3e7f;
  --accent-yellow: #ffd166;
  --accent-green: #06d6a0;
  --text-light: #ffffff;
  --text-muted: #b8c4e0;
  --font-kids: "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", "BIZ UDPGothic", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-kids);
  background: var(--bg-gradient);
  color: var(--text-light);
  touch-action: manipulation;
}

/* 縦向き警告オーバーレイ (スマートフォン・iPad縦持ち時) */
.orientation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(13, 18, 38, 0.96);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

@media (orientation: portrait) {
  .orientation-overlay {
    display: flex;
  }
}

.orientation-card {
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid var(--accent-yellow);
  border-radius: 28px;
  padding: 40px 32px;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.ipad-rotate-icon {
  font-size: 4.5rem;
  margin-bottom: 16px;
  animation: tilt-ipad 1.8s ease-in-out infinite alternate;
}

@keyframes tilt-ipad {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-90deg); }
}

.orientation-card h2 {
  font-size: 1.8rem;
  color: var(--accent-yellow);
  margin-bottom: 12px;
}

.orientation-card p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   ポータル（トップページ）
   =========================== */
.portal-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100dvw;
  height: 100dvh;
  padding: 24px 36px;
  max-width: 1400px;
  margin: 0 auto;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-badge {
  font-size: 2.6rem;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.header-titles {
  flex: 1;
}

.header-titles h1 {
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ffd166, #00d2ff, #ff70a6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: var(--text-muted);
  margin-top: 4px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.25);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
  flex: 1;
  margin: 20px 0;
  min-height: 0;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 3px solid var(--card-border);
  border-radius: 28px;
  padding: 20px;
  text-decoration: none;
  color: var(--text-light);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.game-card.active-game {
  border-color: var(--accent-blue);
  background: linear-gradient(160deg, rgba(0, 210, 255, 0.18) 0%, rgba(255, 62, 127, 0.16) 100%);
  box-shadow: 0 14px 36px rgba(0, 210, 255, 0.22);
}

.game-card.active-game:hover,
.game-card.active-game:active {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--accent-yellow);
  box-shadow: 0 18px 44px rgba(255, 209, 102, 0.35);
}

.game-card.coming-soon {
  opacity: 0.65;
  border-style: dashed;
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(255, 62, 127, 0.4);
}

.card-badge.soon-badge {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.card-preview {
  flex: 1;
  min-height: 150px;
  border-radius: 20px;
  background: rgba(10, 15, 32, 0.75);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

/* エアホッケーのミニプレビューアニメーション */
.preview-rink {
  position: relative;
  width: 90%;
  height: 82%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.3);
}

.preview-center-circle {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.preview-goal {
  position: absolute;
  top: 28%;
  bottom: 28%;
  width: 8px;
  border-radius: 6px;
}

.preview-goal.left-goal {
  left: -5px;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue);
}

.preview-goal.right-goal {
  right: -5px;
  background: var(--accent-pink);
  box-shadow: 0 0 12px var(--accent-pink);
}

.preview-mallet {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.preview-mallet.left-mallet {
  left: 16%;
  background: radial-gradient(circle, #70e4ff 0%, #0095ff 100%);
  border: 3px solid #fff;
  box-shadow: 0 0 14px var(--accent-blue);
  animation: mallet-left-move 2.2s ease-in-out infinite alternate;
}

.preview-mallet.right-mallet {
  right: 16%;
  background: radial-gradient(circle, #ff85b3 0%, #ff1e68 100%);
  border: 3px solid #fff;
  box-shadow: 0 0 14px var(--accent-pink);
  animation: mallet-right-move 2.2s ease-in-out infinite alternate;
}

.preview-puck {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 14px var(--accent-yellow);
  animation: puck-bounce 2.2s linear infinite alternate;
}

@keyframes mallet-left-move {
  0% { transform: translateY(-18px); }
  100% { transform: translateY(18px); }
}

@keyframes mallet-right-move {
  0% { transform: translateY(18px); }
  100% { transform: translateY(-18px); }
}

@keyframes puck-bounce {
  0% { left: 28%; top: 32%; }
  50% { left: 50%; top: 68%; }
  100% { left: 70%; top: 38%; }
}

.soon-icon {
  font-size: 4rem;
  opacity: 0.7;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-info h2 {
  font-size: 1.45rem;
  font-weight: 900;
}

.card-info p {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.card-info strong {
  color: var(--accent-yellow);
}

.play-btn-label {
  margin-top: 6px;
  background: linear-gradient(90deg, #00d2ff 0%, #008cff 100%);
  color: #fff;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 140, 255, 0.4);
}

.play-btn-label.disabled {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  box-shadow: none;
}

.portal-footer {
  display: flex;
  justify-content: center;
}

.tips-pill {
  background: rgba(255, 209, 102, 0.15);
  border: 2px solid rgba(255, 209, 102, 0.4);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 1rem;
}
