/* ===================================
   Theme: RPG — 重厚ファンタジー
   =================================== */

html[data-theme="rpg"] {
  /* Colors — warm parchment + deep wood */
  --color-bg: #12100e;
  --color-bg-light: #1e1a15;
  --color-surface: #2a221a;
  --color-surface-light: rgba(42, 34, 26, 0.92);
  --color-primary: #c9943e;
  --color-primary-hover: #e0ae5a;
  --color-secondary: #5a8c4a;
  --color-secondary-hover: #72a85e;
  --color-text: #e0d5c0;
  --color-text-dim: #a89878;
  --color-text-dark: #3a3020;
  --color-accent-gold: #d4a843;
  --color-border: rgba(212, 168, 67, 0.35);
  --color-success: #5a8c4a;
  --color-warning: #d4a843;
  --color-danger: #a83232;

  /* Typography — serif for weight */
  --font-main: 'Georgia', 'Noto Serif JP', 'Yu Mincho', serif;
  --font-title: 'Georgia', 'Noto Serif JP', 'Yu Mincho', serif;

  /* Spacing — angular, sturdy */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* Shadows — heavy, dramatic */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.7);
}

/* --- Title Screen --- */
html[data-theme="rpg"] .title-slideshow::after {
  background: radial-gradient(ellipse at center, rgba(18, 16, 14, 0.35) 0%, rgba(18, 16, 14, 0.85) 100%);
}

html[data-theme="rpg"] .game-title {
  font-size: 3.2rem;
  text-shadow:
    0 2px 8px rgba(212, 168, 67, 0.5),
    0 0 40px rgba(212, 168, 67, 0.15);
  letter-spacing: 0.05em;
}

html[data-theme="rpg"] .game-subtitle {
  letter-spacing: 0.2em;
  font-size: 1rem;
}

/* --- Buttons — ornate, embossed --- */
html[data-theme="rpg"] .btn {
  border: 2px solid var(--color-border);
  font-family: var(--font-title);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

html[data-theme="rpg"] .btn-primary {
  background: linear-gradient(180deg, #c9943e 0%, #a07228 100%);
  color: #1a1408;
  border-color: #d4a843;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.4);
}

html[data-theme="rpg"] .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e0ae5a 0%, #b8882e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 10px rgba(212, 168, 67, 0.3);
}

html[data-theme="rpg"] .btn-secondary {
  background: linear-gradient(180deg, #5a8c4a 0%, #3d6630 100%);
  color: #e0d5c0;
  border-color: #5a8c4a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.3);
}

html[data-theme="rpg"] .btn-secondary:hover {
  background: linear-gradient(180deg, #72a85e 0%, #4a7a38 100%);
}

html[data-theme="rpg"] .btn-back {
  border-color: rgba(212, 168, 67, 0.3);
  color: var(--color-text-dim);
}

html[data-theme="rpg"] .btn-back:hover {
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold);
}

/* --- Panels — parchment with ornate border --- */
html[data-theme="rpg"] .panel {
  background:
    linear-gradient(180deg, rgba(42, 34, 26, 0.95) 0%, rgba(30, 26, 21, 0.98) 100%);
  border: 2px solid var(--color-border);
  box-shadow:
    var(--shadow-lg),
    inset 0 0 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(212, 168, 67, 0.1);
}

html[data-theme="rpg"] .panel h2 {
  text-shadow: 0 2px 6px rgba(212, 168, 67, 0.3);
  letter-spacing: 0.1em;
}

/* Decorative divider under panel headings */
html[data-theme="rpg"] .panel h2::after {
  content: '⸻ ✦ ⸻';
  display: block;
  font-size: 0.7rem;
  color: rgba(212, 168, 67, 0.4);
  margin-top: 6px;
  letter-spacing: 0.3em;
}

/* --- Scenario cards — parchment feel --- */
html[data-theme="rpg"] .scenario-item {
  border: 2px solid rgba(212, 168, 67, 0.2);
  background: rgba(30, 26, 21, 0.8);
}

html[data-theme="rpg"] .scenario-item:hover {
  border-color: rgba(212, 168, 67, 0.5);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.1);
}

html[data-theme="rpg"] .scenario-item.selected {
  border-color: var(--color-accent-gold);
  box-shadow:
    0 0 12px rgba(212, 168, 67, 0.2),
    inset 0 0 20px rgba(212, 168, 67, 0.05);
}

/* --- Filter buttons --- */
html[data-theme="rpg"] .filter-btn {
  border-radius: 2px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  font-family: var(--font-title);
  font-size: 0.78rem;
}

html[data-theme="rpg"] .filter-btn.active {
  background: linear-gradient(180deg, #c9943e, #a07228);
  border-color: #d4a843;
  color: #1a1408;
}

/* --- Character cards --- */
html[data-theme="rpg"] .character-card {
  border: 2px solid rgba(212, 168, 67, 0.25);
  background: rgba(30, 26, 21, 0.85);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

html[data-theme="rpg"] .character-card .char-name {
  text-shadow: 0 1px 4px rgba(212, 168, 67, 0.3);
}

/* --- Play Screen --- */
html[data-theme="rpg"] .play-background {
  filter: brightness(0.35) sepia(0.15);
}

/* --- Dialogue — angular, parchment tint --- */
html[data-theme="rpg"] .dialogue-bubble .bubble-content {
  border-radius: 3px;
  border: 1px solid rgba(212, 168, 67, 0.2);
  background: rgba(42, 34, 26, 0.85);
}

html[data-theme="rpg"] .dialogue-bubble.player .bubble-content {
  background: rgba(160, 114, 40, 0.15);
  border-color: rgba(212, 168, 67, 0.3);
}

html[data-theme="rpg"] .dialogue-bubble.gm .bubble-content {
  background: rgba(212, 168, 67, 0.06);
  border-left: 3px solid rgba(212, 168, 67, 0.5);
  border-radius: 0;
}

html[data-theme="rpg"] .dialogue-bubble.npc .bubble-content {
  background: rgba(90, 140, 74, 0.1);
  border-color: rgba(90, 140, 74, 0.3);
}

/* --- Turn separator — decorative --- */
html[data-theme="rpg"] .turn-separator {
  font-family: var(--font-title);
  letter-spacing: 0.1em;
}

html[data-theme="rpg"] .turn-separator::before,
html[data-theme="rpg"] .turn-separator::after {
  background: linear-gradient(to right, transparent, rgba(212, 168, 67, 0.4), transparent);
  height: 2px;
}

/* --- Objective widget --- */
html[data-theme="rpg"] .objective-widget {
  border: 2px solid rgba(212, 168, 67, 0.25);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

html[data-theme="rpg"] .objective-label {
  font-family: var(--font-title);
  letter-spacing: 0.15em;
}

/* --- Progress bar --- */
html[data-theme="rpg"] .progress-fill {
  background: linear-gradient(90deg, #a07228, #d4a843, #c9943e);
}

/* --- Modal --- */
html[data-theme="rpg"] .modal-content {
  border: 2px solid rgba(212, 168, 67, 0.3);
  box-shadow:
    var(--shadow-lg),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* --- Chat input --- */
html[data-theme="rpg"] .chat-input-area input {
  border: 2px solid rgba(212, 168, 67, 0.2);
  font-family: var(--font-main);
}

html[data-theme="rpg"] .chat-input-area input:focus {
  border-color: var(--color-accent-gold);
  outline: none;
}

html[data-theme="rpg"] .btn-send {
  background: linear-gradient(180deg, #c9943e, #a07228);
  color: #1a1408;
  border: 1px solid #d4a843;
}

/* --- Choice panel --- */
html[data-theme="rpg"] .choice-panel {
  border: 2px solid rgba(212, 168, 67, 0.25);
}

html[data-theme="rpg"] .choice-btn {
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 2px;
  font-family: var(--font-main);
}

html[data-theme="rpg"] .choice-btn:hover {
  border-color: var(--color-accent-gold);
  background: rgba(212, 168, 67, 0.08);
  box-shadow: inset 0 0 8px rgba(212, 168, 67, 0.05);
}

/* --- Ending screen --- */
html[data-theme="rpg"] .ending-title {
  text-shadow:
    0 2px 12px rgba(212, 168, 67, 0.5),
    0 0 50px rgba(212, 168, 67, 0.15);
  letter-spacing: 0.08em;
}

/* --- Beat transition --- */
html[data-theme="rpg"] .beat-transition-name {
  text-shadow:
    0 2px 16px rgba(212, 168, 67, 0.6),
    0 0 60px rgba(212, 168, 67, 0.2);
  letter-spacing: 0.1em;
}

/* --- Scrollbar --- */
html[data-theme="rpg"] ::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 67, 0.3);
}
