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

:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #141b3d;
  --bg-card: #1a2347;
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  padding: 40px 20px;
  min-height: 100vh;
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
}

h1 { 
  text-align: center; 
  margin-bottom: 48px;
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* 追加フォーム */
.add-game {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  padding: 24px;
  background: rgba(26, 35, 71, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.add-game input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(10, 14, 39, 0.6);
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s ease;
}

.add-game input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(10, 14, 39, 0.8);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-game input::placeholder {
  color: var(--text-muted);
}

.add-game button {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-game button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.add-game button:active {
  transform: translateY(0);
}

/* ゲームカード */
.game-card {
  background: rgba(26, 35, 71, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  position: relative;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
  border-color: rgba(102, 126, 234, 0.2);
}

.game-card img {
  width: 460px;
  height: 215px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover img {
  transform: scale(1.02);
}

.game-info {
  flex: 1;
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-info h3 { 
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 2px;
  padding-right: 50px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.price {
  color: var(--accent-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

/* ストアリンク */
.store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
  margin: -2px 0;
}

.store-link:hover {
  color: var(--accent-primary);
  background: rgba(102, 126, 234, 0.1);
  transform: translateX(2px);
}

.store-link svg {
  width: 14px;
  height: 14px;
}

/* 参加人数 */
.participant-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-success);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  width: fit-content;
  transition: all 0.3s ease;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.participant-count svg {
  width: 14px;
  height: 14px;
}

.participant-count.count-updated {
  background: rgba(16, 185, 129, 0.2);
  transform: scale(1.03);
  border-color: rgba(16, 185, 129, 0.4);
}

/* アクション */
.actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.toggle-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toggle-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.toggle-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  color: var(--accent-success);
  border-color: var(--accent-success);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.toggle-btn.active svg {
  opacity: 1;
}

/* 削除ボタン（右上） */
.delete-btn-top {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.delete-btn-top:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-danger);
  transform: scale(1.05) rotate(90deg);
}

.delete-btn-top svg {
  width: 16px;
  height: 16px;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 28px;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-game-name {
  color: var(--accent-primary) !important;
  font-weight: 600;
  font-size: 18px !important;
  margin-top: 16px !important;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.cancel-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.delete-confirm-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* レスポンシブ */
@media (max-width: 768px) {
  body {
    padding: 20px 12px;
  }

  h1 {
    font-size: 28px;
    margin-bottom: 32px;
  }

  .add-game {
    flex-direction: column;
    padding: 20px;
  }

  .game-card {
    flex-direction: column;
    gap: 0;
  }
  
  .game-card img {
    width: 100%;
    height: auto;
  }

  .game-info {
    padding: 20px;
  }

  .game-info h3 {
    font-size: 20px;
    padding-right: 0;
  }

  .delete-btn-top {
    top: 12px;
    right: 12px;
  }

  .modal-content {
    width: 95%;
    margin: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .toggle-btn {
    width: 100%;
    justify-content: center;
  }
}