@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --bg-dark: #09070f;
  --card-bg: rgba(20, 16, 35, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --neon-cyan: #00f2fe;
  --neon-magenta: #ff00bb;
  --neon-yellow: #ffea00;
  --neon-green: #39ff14;
  --neon-purple: #cc33ff;
  
  --text-white: #ffffff;
  --text-gray: #a5a2bc;
  
  --font-title: 'Outfit', 'Noto Sans JP', sans-serif;
  --font-body: 'Inter', 'Noto Sans JP', sans-serif;
}

/* スキンバリエーション */
body.skin-cyber {
  --neon-board: var(--neon-cyan);
  --neon-board-g: rgba(0, 242, 254, 0.15);
}
body.skin-sakura {
  --neon-board: var(--neon-magenta);
  --neon-board-g: rgba(255, 0, 187, 0.15);
}
body.skin-gold {
  --neon-board: var(--neon-yellow);
  --neon-board-g: rgba(255, 234, 0, 0.15);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(at 10% 20%, rgba(12, 10, 32, 0.8) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(20, 8, 30, 0.8) 0px, transparent 50%);
}

#app-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(10, 8, 18, 0.95);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

@media (min-width: 500px) {
  #app-container {
    min-height: 700px;
    height: 800px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
  }
}

/* 画面管理 */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.4s ease-out;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* カード (Glassmorphism) */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  transition: border-color 0.3s;
}

.neon-card {
  border-color: rgba(0, 242, 254, 0.15);
}

.logo-text {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(204, 51, 255, 0.25);
}

.subtitle {
  font-size: 14px;
  color: var(--text-gray);
  text-align: center;
  margin-bottom: 24px;
}

.accent-text {
  color: var(--neon-cyan);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.desc {
  font-size: 13px;
  color: var(--text-gray);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* フォーム要素 */
.form-group {
  margin-bottom: 18px;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-white);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-group select option {
  background: #100b21;
  color: var(--text-white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.birthday-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.birthday-inputs input {
  flex: 1;
  text-align: center;
}

.birthday-inputs span {
  font-size: 12px;
  color: var(--text-gray);
  white-space: nowrap;
}

/* ボタン */
.btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon {
  background: linear-gradient(135deg, #0055ff, #9900ff);
  border: none;
  box-shadow: 0 4px 15px rgba(153, 0, 255, 0.3);
}

.btn-neon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(153, 0, 255, 0.5);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ホーム画面レイアウト */
.profile-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 51, 255, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.profile-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 11px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 242, 254, 0.3);
}

.fortune-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--neon-yellow);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fortune-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-gray);
  max-height: 120px;
  overflow-y: auto;
}

/* リバーシゲームボード */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.score-badge .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.score-badge.player .dot {
  background: linear-gradient(135deg, #1e1b30, #090810);
  border: 1.5px solid var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
}

.score-badge.opponent .dot {
  background: #ffffff;
  border: 1.5px solid var(--neon-magenta);
  box-shadow: 0 0 6px var(--neon-magenta);
}

.turn-banner {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--neon-yellow);
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(255, 234, 0, 0.2);
}

.board-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(14, 11, 26, 0.95);
  border: 3px solid var(--neon-board, var(--neon-cyan));
  border-radius: 12px;
  padding: 4px;
  box-shadow: 
    0 0 20px var(--neon-board-g, rgba(0, 242, 254, 0.15)),
    inset 0 0 10px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.cell {
  background: rgba(30, 25, 50, 0.65);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.cell.valid-move::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-cyan);
  opacity: 0.3;
  box-shadow: 0 0 6px var(--neon-cyan);
  transition: opacity 0.2s;
}

.cell.valid-move:hover::after {
  opacity: 0.7;
}

.stone {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.3s, border-color 0.3s;
}

.stone.player1 {
  background: linear-gradient(135deg, #1e1b30, #090810);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
}

.stone.player2 {
  background: linear-gradient(135deg, #ffffff, #dcdada);
  border: 2px solid var(--neon-magenta);
  box-shadow: 0 0 12px var(--neon-magenta);
}

/* 3Dひっくり返りアニメーション */
.stone.flipping {
  animation: stone-flip 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

@keyframes stone-flip {
  0% { transform: scale(1) rotateY(0deg); filter: brightness(1); }
  50% { transform: scale(1.6) rotateY(90deg) translateZ(40px); filter: brightness(2.5) drop-shadow(0 0 30px #ffffff); box-shadow: 0 0 50px rgba(255,255,255,1), 0 0 80px rgba(0, 242, 254, 0.8); }
  100% { transform: scale(1) rotateY(180deg); filter: brightness(1); }
}

/* 設定スキン選択 */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.skin-btn {
  padding: 10px;
  font-size: 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.25s;
}

.skin-btn.active {
  border-color: var(--neon-cyan);
  color: var(--text-white);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

/* アチーブメント/バッジリスト */
.badge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-item.unlocked {
  border-color: rgba(57, 255, 20, 0.25);
  background: rgba(57, 255, 20, 0.02);
}

.badge-icon {
  font-size: 20px;
  opacity: 0.3;
}

.badge-item.unlocked .badge-icon {
  opacity: 1;
}

.badge-info h5 {
  font-size: 13px;
  margin-bottom: 2px;
}

.badge-info p {
  font-size: 10px;
  color: var(--text-gray);
}

/* オーバーレイ・モーダル */
.overlay-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 4, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.overlay-modal.active {
  display: flex;
}

.modal-box {
  width: 100%;
  max-height: 90%;
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ランキングリスト */
.ranking-list {
  width: 100%;
}

.ranking-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.ranking-row.header {
  font-weight: 600;
  border-bottom: 1px dashed rgba(0, 242, 254, 0.2);
  color: var(--neon-cyan);
}

/* 各種ユーティリティ */
.flex-row {
  display: flex;
  gap: 10px;
}

.badge-showcase-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge-select-item {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-select-item.selected {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.badge-select-item.locked {
  opacity: 0.15;
  cursor: not-allowed;
}

.buff-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(57, 255, 20, 0.2);
  margin-bottom: 12px;
}

.game-control-btn {
  padding: 10px;
  font-size: 12px;
}

/* ど派手演出用エフェクトキャンバス */
#effects-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* カスタム通知バナー */
.banner-notify {
  position: absolute;
  top: 15%;
  left: 5%;
  width: 90%;
  padding: 16px;
  background: rgba(14, 11, 26, 0.9);
  border: 1px solid var(--neon-cyan);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  animation: bannerSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.banner-notify.fade-out {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.4s ease;
}

@keyframes bannerSlideIn {
  from { transform: translateY(-40px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* 勝利時の You Win テキストど派手アニメーション */
#result-title {
  font-family: var(--font-title);
  font-weight: 800;
  text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
  animation: victoryPulse 1.2s infinite alternate ease-in-out;
}

@keyframes victoryPulse {
  0% { transform: scale(1); text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow); }
  100% { transform: scale(1.1); text-shadow: 0 0 20px var(--neon-yellow), 0 0 35px var(--neon-yellow), 0 0 50px #ff6600; }
}

/* マッチング画面のインジケーター */
.matching-loader {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 242, 254, 0.1);
  border-radius: 50%;
  border-top-color: var(--neon-cyan);
  border-bottom-color: var(--neon-magenta);
  animation: matchSpinner 1.2s linear infinite;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

@keyframes matchSpinner {
  to { transform: rotate(360deg); }
}

/* エンディングのスタッフロールアニメーション */
@keyframes scrollCredits {
  0% { top: 120px; }
  100% { top: -280px; }
}

@keyframes scaleUp {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.glow-text-ending {
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
}

/* サン・ラッシュで変換された石を強調表示するアニメーション */
@keyframes sunRushFlash {
  0% { transform: scale(1); box-shadow: 0 0 20px #ff8c00, inset 0 0 10px #ff8c00; }
  50% { transform: scale(1.15); box-shadow: 0 0 35px #ffd700, 0 0 15px #ff4500, inset 0 0 15px #ffd700; }
  100% { transform: scale(1); }
}

.sun-rush-converted {
  animation: sunRushFlash 1s ease-in-out 3; /* 1秒のアニメーションを3回繰り返す */
  z-index: 10;
}

