/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: dark;
  accent-color: #818cf8;

  --bg-page: #0b1020;
  --bg-panel: #131b31;
  --bg-card: #1b2544;
  --bg-card-accent: #222e54;
  --bg-input: #0d1428;

  --border-subtle: #2d3b66;
  --border-accent: #6366f1;
  --border-purple: #8b5cf6;

  --text-primary: #eef2ff;
  --text-heading: #e0e7ff;
  --text-muted: #a5b4cf;
  --text-link: #60a5fa;
  --text-link-hover: #93c5fd;
  --text-accent: #c084fc;

  --gradient-header: linear-gradient(90deg, #1d4ed8 0%, #4f46e5 52%, #7c3aed 100%);
  --gradient-primary: linear-gradient(90deg, #3b82f6 0%, #7c3aed 100%);
  --gradient-primary-hover: linear-gradient(90deg, #60a5fa 0%, #8b5cf6 100%);

  --status-success-bg: #0f2e22;
  --status-success-border: #22c55e;
  --status-success-text: #86efac;

  --status-warn-bg: #2d210b;
  --status-warn-border: #f59e0b;
  --status-warn-text: #fde68a;

  --status-error-bg: #33141c;
  --status-error-border: #f87171;
  --status-error-text: #fecaca;
}

::selection {
  background: rgba(124, 58, 237, 0.45);
  color: #ffffff;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(59, 130, 246, 0.16), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(139, 92, 246, 0.16), transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-y: scroll;
  min-height: 100vh;
}

a {
  color: var(--text-link);
}

a:hover {
  color: var(--text-link-hover);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"] {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
  outline: 2px solid var(--border-accent);
  outline-offset: 1px;
  border-color: var(--border-purple);
}

/* ヘッダー */
.site-header {
  background: var(--gradient-header);
  color: #ffffff;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35);
  border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}

.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.site-logo {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.4em;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.45);
}

.site-logo:hover {
  color: #e0e7ff;
}

.site-main {
  max-width: 900px;
  margin: 24px auto;
  padding: 24px;
  background: var(--bg-panel);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.18);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

/* ボタン共通 */
.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--gradient-primary);
  color: #ffffff;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(79, 70, 229, 0.4);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--gradient-primary-hover);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #28334e;
  color: #7c8aa8;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-header-login {
  padding: 8px 16px;
  font-weight: bold;
  background: #ffffff;
  color: #4338ca;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9em;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-header-login:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}

.btn-header-logout {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.35);
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
}

.btn-header-logout:hover {
  background: rgba(15, 23, 42, 0.55);
}

/* 各ページの共通大見出しスタイル */
.page-heading {
  font-size: 1.6em;
  color: var(--text-heading);
  border-bottom: 2px solid var(--border-accent);
  padding-bottom: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-heading h1,
.page-heading h2 {
  font-size: 1em; /* 親の1.6emをそのまま使う */
  margin: 0;
  color: inherit;
}

/* カード・パネル */
.game-card {
  padding: 15px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.game-panel {
  background: var(--bg-card);
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

/* ステータス・アラート */
.alert-error {
  color: var(--status-error-text);
  background: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9em;
  font-weight: bold;
}

.alert-notice {
  color: var(--status-success-text);
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-weight: bold;
}

/* ログインモーダル */
dialog#global-login-modal {
  padding: 30px;
  border-radius: 12px;
  border: 2px solid var(--border-accent);
  background: var(--bg-panel);
  color: var(--text-primary);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(124, 58, 237, 0.3);
}

dialog#global-login-modal::backdrop {
  background: rgba(5, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}
