/* ══════════════════════════════════════════
   BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #09060a;
  --bg2:     #110c13;
  --accent:  #c84848;
  --accent2: #e06060;
  --text:    rgba(255,255,255,.85);
  --text-dim: rgba(255,255,255,.42);
  --border:  rgba(255,255,255,.1);
  --seg-hover: rgba(200, 72, 72, .14);
  --seg-sel:   rgba(200, 72, 72, .32);
  --correct:   #48b87a;
  --wrong:     #c84848;
  --partial:   #c8a040;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════
   OVERLAY UTILITY
══════════════════════════════════════════ */
.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 6, 10, .82);
  overflow-y: auto;
  padding: 24px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.screen-overlay.hidden { display: none; }

/* ══════════════════════════════════════════
   TITLE SCREEN
══════════════════════════════════════════ */
#title-screen {
  background-image: url('../assets/images/backgrounds/bg_title.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
#title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 6, 10, 0.45);
  z-index: 0;
}
#title-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px 40px;
  background: rgba(17, 12, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}

#title-logo {
  text-align: center;
}
#title-mark {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(200,72,72,.5));
}
#title-name {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: .25em;
  color: #fff;
  margin-bottom: 4px;
}
#title-sub {
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--accent);
  margin-bottom: 8px;
}
#title-site a {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .1em;
}
#title-site a:hover { color: var(--text); }

#title-rules {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#title-role {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,.68);
  text-align: center;
  padding: 10px 12px;
  border: 1px solid rgba(200,72,72,.22);
  border-radius: 6px;
  background: rgba(200,72,72,.05);
}
#title-role strong { color: #fff; }

#title-rules-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#title-rules-list li {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  line-height: 1.65;
}
#title-rules-list strong { color: #fff; }

#title-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: .04em;
}

#title-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#title-start-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: .2em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: opacity .2s, transform .15s;
}
#title-start-btn:hover { opacity: .85; transform: translateY(-1px); }
#title-save-info {
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .05em;
  text-align: center;
  padding: 7px 16px;
  border: 1px solid rgba(200, 72, 72, .2);
  border-radius: 20px;
  background: rgba(200, 72, 72, .06);
}
#title-new-btn {
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: .1em;
  background: transparent;
  color: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
#title-new-btn:hover {
  color: rgba(255, 255, 255, .75);
  border-color: rgba(255, 255, 255, .4);
}
#title-tutorial-btn {
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: .12em;
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
#title-tutorial-btn:hover { color: var(--text); border-color: rgba(255,255,255,.3); }

/* ══════════════════════════════════════════
   TUTORIAL INTRO OVERLAY
══════════════════════════════════════════ */
#tutorial-intro {
  background-image: url('../assets/images/backgrounds/bg_title.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-y: auto;
  align-items: flex-start;
  padding: 40px 20px;
  /* position/display は .screen-overlay に委譲 — IDセレクタで上書きしない */
}
#tutorial-intro.hidden { display: none; }
#tutorial-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 6, 10, 0.55);
  z-index: 0;
}
#tutorial-intro-inner {
  max-width: 500px;
  width: 100%;
  padding: 36px 40px;
  background: rgba(17, 12, 19, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}
#tutorial-intro-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
#tutorial-intro-mark {
  font-size: 28px;
  color: var(--accent);
}
#tutorial-intro-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text);
  margin: 0;
}
#tutorial-intro-lead {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 28px;
  padding: 16px 20px;
  background: rgba(200,72,72,.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.tutorial-section-heading {
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--text-dim);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
#tutorial-flow-block {
  margin-bottom: 24px;
}
#tutorial-flow-list {
  padding-left: 20px;
  margin: 0;
}
#tutorial-flow-list li {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}
#tutorial-categories-block {
  margin-bottom: 32px;
}
#tutorial-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#tutorial-cat-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}
.tcat-icon {
  font-size: 16px;
  flex-shrink: 0;
}
#tutorial-cat-list strong {
  color: var(--text);
  font-weight: 700;
  min-width: 4em;
}
.tcat-desc {
  color: var(--text-dim);
  font-size: 13px;
}
#tutorial-start-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
#tutorial-start-btn:hover { opacity: .85; transform: translateY(-1px); }

/* ══════════════════════════════════════════
   GAME SCREEN
══════════════════════════════════════════ */
#game-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
#game-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--game-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.18;
  transition: background-image 0.8s ease-in-out;
  pointer-events: none;
}
#game-header, #q-bar, #tutorial-hint, #scenario-wrap, #selection-status, #category-area, #action-bar {
  position: relative;
  z-index: 1;
}

/* Header */
#game-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
#mute-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  opacity: .5;
  transition: opacity .2s;
  line-height: 1;
}
#mute-btn:hover { opacity: 1; }
#site-link {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .06em;
}
#site-link:hover { color: var(--text); }
#game-title-label {
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--accent);
  text-align: center;
}
#header-score {
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

/* Tutorial in-game */
#tutorial-badge {
  font-size: 10px;
  letter-spacing: .12em;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
#tutorial-hint {
  padding: 8px 16px;
  background: rgba(200, 72, 72, .06);
  border-bottom: 1px solid rgba(200, 72, 72, .15);
  flex-shrink: 0;
}
#tutorial-hint-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#tutorial-hint-text {
  font-size: 12px;
  color: var(--accent2);
  letter-spacing: .05em;
}
#tutorial-hint-btn {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: 1px solid rgba(200, 72, 72, .4);
  border-radius: 12px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
#tutorial-hint-btn:hover { background: rgba(200, 72, 72, .1); }
#tutorial-content-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(200, 72, 72, .08);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
#tutorial-hint.hidden,
#tutorial-badge.hidden,
#tutorial-content-hint.hidden,
#tutorial-hint-btn.hidden { display: none; }

/* Question bar */
#q-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  gap: 8px;
}
#q-title-label {
  font-size: 13px;
  color: var(--text);
  letter-spacing: .08em;
  flex: 1;
}
#q-difficulty {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .05em;
  white-space: nowrap;
}
#q-progress {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: .04em;
}

/* Scenario */
#scenario-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 24px 28px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
#scenario-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 100%;
  font-size: 18px;
  line-height: 2.2;
  color: rgba(255,255,255,.88);
  letter-spacing: .12em;
}

/* Segments */
.seg-gap {
  display: inline-block;
  width: 0;
  height: .8em;
}
.segment {
  display: inline;
  cursor: pointer;
  border-radius: 3px;
  transition: background .15s;
  padding: 2px 0;
}
.segment:hover { background: var(--seg-hover); }
.segment.selected {
  background: var(--seg-sel);
  outline: 1px solid rgba(200,72,72,.5);
  border-radius: 3px;
}
.segment.reveal-correct {
  background: rgba(72,184,122,.22);
  outline: 1px solid rgba(72,184,122,.5);
}
.segment.reveal-wrong {
  background: rgba(200,72,72,.22);
  outline: 1px solid rgba(200,72,72,.5);
}

/* Selection status */
#selection-status {
  padding: 8px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  min-height: 36px;
}
#selection-label {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

/* Category area */
#category-area {
  padding: 10px 16px 8px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  transition: opacity .2s ease-in-out;
}
#category-area.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#category-heading {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .08em;
  margin-bottom: 8px;
}
#category-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-family: inherit;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.65);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: .06em;
  transition: background .15s, color .15s, border-color .15s;
}
.cat-btn:hover {
  background: rgba(200,72,72,.12);
  color: rgba(255,255,255,.88);
  border-color: rgba(200,72,72,.4);
}
.cat-btn.active {
  background: rgba(200,72,72,.25);
  color: #fff;
  border-color: var(--accent);
}

/* Action bar */
#action-bar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
#giveup-btn {
  flex: 1;
  padding: 11px 0;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .1em;
  transition: color .2s, border-color .2s;
}
#giveup-btn:hover { color: rgba(255,255,255,.65); border-color: rgba(255,255,255,.3); }

#submit-btn {
  flex: 2;
  padding: 11px 0;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .15em;
  transition: opacity .2s;
}
#submit-btn:disabled {
  background: rgba(200,72,72,.25);
  color: rgba(255,255,255,.3);
  cursor: not-allowed;
}
#submit-btn:not(:disabled):hover { opacity: .85; }

/* ══════════════════════════════════════════
   RESULT OVERLAY
══════════════════════════════════════════ */
#result-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 40px;
  background: rgba(17, 12, 19, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#result-icon {
  font-size: 40px;
  text-align: center;
}
#result-icon.correct { color: var(--correct); }
#result-icon.partial { color: var(--partial); }
#result-icon.wrong   { color: var(--wrong); }
#result-icon.giveup  { color: var(--text-dim); }

#result-heading {
  font-size: 20px;
  letter-spacing: .15em;
  text-align: center;
  color: #fff;
}

#result-score-delta {
  font-size: 14px;
  text-align: center;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
#result-score-delta.correct { color: var(--correct); }
#result-score-delta.partial { color: var(--partial); }
#result-score-delta.wrong   { color: var(--wrong); }
#result-score-delta.giveup  { color: var(--text-dim); }

#result-body {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#result-category-row {
  font-size: 12px;
  color: var(--accent2);
  letter-spacing: .1em;
}
#result-explanation {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,.7);
}

#result-correction-block {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#result-correction-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .12em;
}
#result-correction-text {
  font-size: 14px;
  line-height: 1.85;
  color: rgba(255,255,255,.82);
}

#next-btn {
  align-self: center;
  padding: 11px 44px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .15em;
  transition: opacity .2s;
}
#next-btn:hover { opacity: .85; }

/* ══════════════════════════════════════════
   GAME OVER
══════════════════════════════════════════ */
#gameover-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 40px;
  text-align: center;
  background: rgba(17, 12, 19, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
#gameover-heading {
  font-size: 14px;
  letter-spacing: .35em;
  color: var(--text-dim);
}
#gameover-score {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: .05em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
#gameover-score::after { content: ' pt'; font-size: 18px; color: var(--text-dim); }
#gameover-rank {
  font-size: 22px;
  letter-spacing: .15em;
  color: var(--accent2);
}
#gameover-desc {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  letter-spacing: .06em;
  line-height: 1.7;
  max-width: 340px;
}
#gameover-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
#replay-btn {
  padding: 11px 36px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .12em;
  transition: opacity .2s;
}
#replay-btn:hover { opacity: .85; }
#go-game-link {
  display: inline-flex;
  align-items: center;
  padding: 11px 28px;
  font-size: 13px;
  background: transparent;
  color: rgba(255,255,255,.48);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  letter-spacing: .1em;
  transition: color .2s, border-color .2s;
}
#go-game-link:hover { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.4); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 480px) {
  #scenario-text { font-size: 14px; line-height: 1.9; }
  #title-name { font-size: 24px; }
  .cat-btn { padding: 6px 10px; font-size: 11px; }
}

/* ══════════════════════════════════════════
   SMALL SCREEN NOTICE (VGA以下 = 横936px以下)
   ══════════════════════════════════════════ */
#small-screen-notice {
  display: none;
}

@media (max-width: 935px), (max-height: 639px) {
  #small-screen-notice {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: #09060a;
    padding: 32px 24px;
  }

  /* ゲーム本体の各種画面を隠す */
  #game-screen,
  #title-screen,
  #tutorial-intro,
  #result-overlay,
  #gameover-overlay {
    display: none !important;
  }
}

#small-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  max-width: 320px;
}

#small-screen-icon {
  font-size: 36px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(200,72,72,.5));
  animation: icon-pulse 2.4s ease-in-out infinite;
}

#small-screen-title {
  font-size: 20px;
  letter-spacing: .2em;
  color: #fff;
  font-weight: 400;
}

#small-screen-msg {
  font-size: 13px;
  color: var(--accent2);
  font-weight: 700;
  line-height: 1.5;
}

#small-screen-sub {
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
}

#small-screen-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  width: 100%;
}

@keyframes icon-pulse {
  0%, 100% {
    opacity: .4;
    transform: scale(1);
  }
  50% {
    opacity: .9;
    transform: scale(1.12);
  }
}

/* ══ 報酬シーンCG ══════════════════════════════════════ */
#result-reward {
  margin: 12px 0 8px;
  text-align: center;
}
#result-reward img.reward-thumb {
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(180,60,60,.3);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
#result-reward img.reward-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(180,60,60,.4);
}

/* ゲームオーバーCGギャラリー */
#gameover-gallery {
  margin: 16px 0 8px;
}
.gallery-label {
  font-size: 11px;
  opacity: .55;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
img.gallery-thumb {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(180,60,60,.25);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
img.gallery-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(180,60,60,.4);
}

/* 報酬CG 全画面モーダル */
#reward-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
}
#reward-modal.visible { display: flex; }
#reward-modal-frame {
  position: relative;
  display: inline-flex;
  max-width: 92vw;
  max-height: 82vh;
}
#reward-modal-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
  display: block;
}
#reward-modal-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.78) 100%);
  border-radius: 0 0 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
#reward-chapter-title {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "游明朝", serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .18em;
  text-shadow: 0 2px 8px rgba(0,0,0,.9);
}
#reward-editor-comment {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "游明朝", serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.82);
  letter-spacing: .1em;
  text-shadow: 0 1px 4px rgba(0,0,0,.95);
  font-style: italic;
}
#reward-editor-comment::before {
  content: "── ";
  opacity: .7;
}
#reward-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1;
}
#reward-modal-hint {
  margin-top: 10px;
  font-size: 11px;
  opacity: .4;
  pointer-events: none;
}

/* ══ 画像保護 ══════════════════════════════════════════ */
img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
}
