/* ── AntiVillage ── Dark Social RPG Theme ─────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg-parchment: #1a1a2e;
  --bg-card: #16213e;
  --bg-dark: #0a0a14;
  --gold: #e94560;
  --gold-light: #f48fb1;
  --green: #00e676;
  --red: #ff1744;
  --blue: #1e3a5f;
  --brown: #e0e0e0;
  --brown-light: #757575;
  --text: #e0e0e0;
  --text-light: #9e9e9e;
  --shadow: rgba(0, 0, 0, 0.4);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-parchment);
  color: var(--text);
  overflow: hidden;
}

/* ── Layout ──────────────────────────────────────────────────────── */

.game-container {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 280px;
  height: 100vh;
  gap: 0;
}

.top-bar {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-dark), #0f0f20);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 200; /* Above modal overlay so HUD stays visible */
  position: relative;
  overflow: visible;
}

.game-title {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-eye {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

.logo-text {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.logo-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.logo-eye-large {
  height: 60px;
  width: 60px;
  object-fit: contain;
}

.logo-text-large {
  height: 110px;
  width: auto;
  object-fit: contain;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.turn-counter {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 14px;
  white-space: nowrap;
}

.btn-mute {
  background: none;
  border: 1px solid var(--gold-light);
  color: var(--gold-light);
  font-size: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-mute:hover {
  background: rgba(201, 162, 39, 0.2);
}

.btn-mute.muted {
  opacity: 0.4;
  text-decoration: line-through;
}

/* ── HUD Stats ───────────────────────────────────────────────────── */

.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: center;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ddd;
  font-size: 15px;
  font-weight: 600;
}

.stat-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ── Resource Tooltips ────────────────────────────────────────────── */

.stat {
  position: relative;
  cursor: help;
  padding: 4px 6px;
  border-radius: 4px;
}

.stat-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: rgba(10, 10, 20, 0.96);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 220px;
  max-width: 300px;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
  white-space: normal;
}

.stat-tooltip.visible {
  display: block;
}

/* Prevent tooltips near edges from going off-screen */
.hud .stat:first-child .stat-tooltip {
  left: 0;
  transform: none;
}

.hud .stat:last-child .stat-tooltip {
  left: auto;
  right: 0;
  transform: none;
}

.stat-tooltip-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 4px;
}

.stat-tooltip-desc {
  font-size: 12px;
  color: #ddd;
  line-height: 1.4;
  margin-bottom: 4px;
}

.stat-tooltip-detail {
  font-size: 11px;
  color: #aaa;
  line-height: 1.4;
  border-top: 1px solid rgba(201,162,39,0.2);
  padding-top: 4px;
  margin-top: 4px;
}

.stat-icon.power { color: #ff6b6b; }
.stat-icon.health { color: #66bb6a; }
.stat-icon.gold { color: var(--gold); }
.stat-icon.xp { color: #82b1ff; }
.stat-icon.level { color: #ce93d8; }

.stat-value {
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 16px;
}

.health-bar-container {
  width: 80px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-left: -4px;
}

.health-bar-fill {
  height: 100%;
  background: #66bb6a;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

.health-bar-fill.warning {
  background: #ff9800;
}

.health-bar-fill.critical {
  background: #e53935;
}

.xp-glow {
  animation: xpPulse 1.5s ease-in-out infinite;
}

@keyframes xpPulse {
  0%, 100% { text-shadow: 0 0 4px rgba(130, 177, 255, 0.3); }
  50% { text-shadow: 0 0 12px rgba(130, 177, 255, 0.8); }
}

/* ── Map Area ────────────────────────────────────────────────────── */

.map-area {
  position: relative;
  background:
    url('../assets/bg_parchment.png') center / cover no-repeat,
    var(--bg-parchment);
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Side Panel ──────────────────────────────────────────────────── */

.side-panel {
  background: var(--bg-card);
  border-left: 2px solid rgba(233, 69, 96, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(233, 69, 96, 0.15);
}

.panel-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ── Relic Panel ─────────────────────────────────────────────────── */

.relic-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.relic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(233, 69, 96, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(233, 69, 96, 0.2);
  cursor: help;
  transition: background 0.2s;
}

.relic-item:hover {
  background: rgba(233, 69, 96, 0.2);
}

.relic-icon {
  font-size: 18px;
}

.relic-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
}

.relic-equipped {
  border-color: var(--gold);
  background: rgba(233, 69, 96, 0.15);
}

.relic-empty-slot {
  border: 1px dashed rgba(233, 69, 96, 0.2);
  background: rgba(0,0,0,0.15);
}

.relic-bagged {
  opacity: 0.7;
  border-style: dashed;
}

.relic-slot-tag {
  font-size: 10px;
  color: var(--gold);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.relic-bag-label {
  font-size: 11px;
  color: var(--brown-light);
  margin-top: 6px;
  padding: 2px 0;
  border-top: 1px solid rgba(233, 69, 96, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.relic-empty {
  color: var(--brown-light);
  font-style: italic;
  font-size: 13px;
}

/* ── Event Log ───────────────────────────────────────────────────── */

.event-log-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.event-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.log-entry {
  font-size: 13px;
  color: var(--text-light);
  padding: 4px 0;
  border-bottom: 1px solid rgba(233, 69, 96, 0.08);
  line-height: 1.4;
}

.log-entry-new {
  animation: logSlideIn 0.4s ease-out;
}

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

/* ── Modal Overlay ───────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  /* Start below the top bar so HUD resources stay fully visible */
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Modal Images ────────────────────────────────────────────────── */

.modal-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(233, 69, 96, 0.2);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.modal-image img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.combat-hint {
  text-align: center;
  font-size: 13px;
  color: var(--brown-light);
  font-style: italic;
  margin-top: 8px;
}

.combat-title { color: var(--red); }
.levelup-title { color: var(--gold); }
.relic-title { color: #7b1fa2; }
.event-title { color: #ff9800; }
.reward-title { color: var(--gold); }
.shrine-title { color: var(--blue); }
.resource-title { color: var(--green); }
.victory-title { color: var(--gold); font-size: 32px; }
.gameover-title { color: var(--red); }

/* ── Combat Modal ────────────────────────────────────────────────── */

.combat-versus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 16px 0;
}

.combat-side {
  text-align: center;
  padding: 12px 20px;
  border-radius: 8px;
  min-width: 100px;
}

.player-side {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.enemy-side {
  background: rgba(255, 23, 68, 0.1);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.combat-label {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.combat-power {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--brown);
}

.combat-sublabel {
  font-size: 12px;
  color: var(--brown-light);
  text-transform: uppercase;
}

.combat-vs {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--brown-light);
}

.combat-chance {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin: 12px 0;
}

.combat-rewards, .combat-damage {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}

.reward-item {
  padding: 6px 14px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 6px;
  font-weight: 600;
  color: var(--green);
}

.damage-item {
  padding: 6px 14px;
  background: rgba(255, 23, 68, 0.1);
  border: 1px solid rgba(255, 23, 68, 0.3);
  border-radius: 6px;
  font-weight: 600;
  color: var(--red);
}

.result-detail {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 8px;
  font-size: 14px;
}

.result-win .modal-title { color: var(--green); }
.result-lose .modal-title { color: var(--red); }

/* ── Level Up Modal ──────────────────────────────────────────────── */

.levelup-subtitle {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--brown);
}

.levelup-base {
  text-align: center;
  font-size: 14px;
  color: var(--green);
  margin: 8px 0;
}

.levelup-prompt {
  text-align: center;
  font-size: 15px;
  color: var(--text-light);
  margin: 12px 0 8px;
}

.levelup-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-upgrade {
  text-align: left;
  padding: 12px 16px;
}

.upgrade-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.upgrade-desc {
  font-size: 13px;
  color: var(--text-light);
}

/* ── Relic Modal ─────────────────────────────────────────────────── */

.relic-display {
  text-align: center;
  margin: 16px 0;
}

.relic-big-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.relic-big-name {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #7b1fa2;
  margin-bottom: 4px;
}

.relic-big-desc {
  font-size: 14px;
  color: var(--text-light);
}

/* ── Event Modal ─────────────────────────────────────────────────── */

.event-desc {
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 16px;
  font-style: italic;
}

.event-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-result-text {
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
  font-style: italic;
}

.event-effects {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.effect-good { color: var(--green); font-weight: 600; }
.effect-bad { color: var(--red); font-weight: 600; }

/* ── Shrine Modal ────────────────────────────────────────────────── */

.shrine-desc {
  text-align: center;
  font-size: 15px;
  font-style: italic;
  margin-bottom: 8px;
}

.shrine-xp {
  text-align: center;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 12px;
}

.shrine-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Resource Modal ──────────────────────────────────────────────── */

.resource-desc {
  text-align: center;
  font-size: 15px;
  margin-bottom: 8px;
}

.resource-income {
  text-align: center;
  color: var(--green);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 16px;
}

/* ── Victory / Game Over ─────────────────────────────────────────── */

.victory-desc, .gameover-desc {
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.victory-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.victory-stat {
  padding: 6px 12px;
  background: rgba(233, 69, 96, 0.12);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}

.reward-name {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 12px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--shadow);
}

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

.btn-fight {
  background: var(--red);
  color: #fff;
  border-color: #a00;
}

.btn-fight:hover { background: #a00000; }

.btn-retreat {
  color: var(--brown-light);
  border-color: var(--brown-light);
}

.btn-retreat:hover { background: rgba(141, 123, 94, 0.1); }

.btn-continue {
  background: var(--green);
  color: #fff;
  border-color: #1a4a1d;
}

.btn-continue:hover { background: #1a4a1d; }

.btn-retry {
  background: var(--gold);
  color: var(--brown);
  border-color: #a08020;
}

.btn-retry:hover { background: #a08020; color: #fff; }

.btn-shrine {
  background: var(--blue);
  color: #fff;
  border-color: #14294a;
}

.btn-shrine:hover { background: #14294a; }

.btn-event {
  background: #ff9800;
  color: #fff;
  border-color: #e68900;
}

.btn-event:hover { background: #e68900; }

.btn-upgrade {
  background: var(--bg-card);
  border-color: var(--gold);
  color: var(--text);
  width: 100%;
}

.btn-upgrade:hover {
  background: rgba(233, 69, 96, 0.15);
}

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Scrollbar ───────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--brown-light);
  border-radius: 3px;
}

/* ── Responsive ──────────────────────────────────────────────────── */

/* ── Loading Screen ───────────────────────────────────────────────── */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.loading-subtitle {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  color: var(--gold-light);
  opacity: 0.7;
  margin-bottom: 32px;
  text-align: center;
  max-width: 300px;
}

.loading-bar-container {
  width: 220px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-bar {
  height: 100%;
  background: #e040fb;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.loading-tip {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  text-align: center;
  max-width: 280px;
}

/* ── Mobile Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  /* Show journal at bottom on mobile */
  .side-panel {
    grid-column: 1;
    grid-row: 3;
    display: block;
    max-height: 25vh;
    overflow-y: auto;
    border-top: 1px solid rgba(233, 69, 96, 0.3);
    background: var(--bg-dark);
  }

  /* Hide bonds/items panels on mobile — only show journal */
  .side-panel .panel-section:not(.event-log-section) {
    display: none;
  }

  .side-panel .event-log-section {
    height: 100%;
  }

  .side-panel .event-log {
    max-height: calc(25vh - 30px);
  }

  /* ── Two-row header via grid ─────────────────────────────────── */
  /* Logo (left, both rows) | Stats (center, 2 rows of 3-4) | Mute+Turn (right, both rows) */
  .top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr 1fr;
    gap: 1px 6px;
    padding: 4px 8px;
    align-items: center;
  }

  .game-title {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .logo-eye {
    height: 26px;
    width: 26px;
  }

  .logo-text {
    height: 34px;
  }

  .top-bar-right {
    grid-column: 3;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  /* Stats fill center column across both rows */
  .hud {
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: 1fr 1fr;
    gap: 1px 6px;
    justify-content: center;
    align-items: center;
    flex: none;
  }

  .stat {
    font-size: 12px;
    padding: 1px 2px;
    gap: 2px;
  }

  .stat-label {
    display: none;
  }

  .stat-value {
    font-size: 12px;
  }

  .stat-icon {
    font-size: 12px;
    width: 14px;
    height: 14px;
  }

  .stat-tooltip {
    min-width: 180px;
    max-width: 250px;
    font-size: 11px;
    left: 0;
    transform: none;
  }

  .turn-counter {
    font-size: 10px;
  }

  .btn-mute {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  /* ── Modal: tight, no image clipping ─────────────────────────── */
  .modal-overlay {
    top: 0;
    padding-top: 70px;
  }

  .modal-box {
    padding: 12px 14px;
    max-width: 96%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    border-radius: 10px;
  }

  .modal-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .modal-image {
    margin-bottom: 8px;
  }

  .modal-image img {
    max-height: 160px;
    object-fit: cover;
    object-position: center 20%; /* Show face/head area, not cropped at top */
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 42px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 6px;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .combat-versus {
    gap: 8px;
  }

  .combat-power {
    font-size: 24px;
  }

  .combat-side {
    padding: 6px 10px;
    min-width: 70px;
  }

  .combat-hint {
    font-size: 12px;
    margin-top: 4px;
  }

  /* Map: horizontal scroll, no vertical scroll */
  .map-area {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* Remove background from container — it's on the canvas wrapper instead */
    background: var(--bg-parchment) !important;
  }

  #game-canvas {
    display: block;
    height: 100%;
    /* width set dynamically by renderer */
    background:
      url('../assets/bg_parchment.png') left top / cover no-repeat,
      var(--bg-parchment);
  }

  .health-bar-container {
    width: 40px;
  }
}

@media (max-width: 400px) {
  .logo-eye {
    height: 24px;
    width: 24px;
  }

  .logo-text {
    height: 30px;
  }

  .stat {
    font-size: 11px;
    padding: 1px 2px;
  }

  .stat-value {
    font-size: 12px;
  }

  .stat-icon {
    font-size: 12px;
    width: 14px;
    height: 14px;
  }
}

/* ── Tactic Encounter Styles ───────────────────────────────────────── */

.tactic-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.tactic-portrait-small .modal-image {
  width: 80px;
  max-height: 80px;
  margin: 0;
  border-radius: 6px;
  flex-shrink: 0;
}

.tactic-portrait-small .modal-image img {
  width: 80px;
  height: 80px;
  max-height: 80px;
  object-fit: cover;
}

.tactic-info {
  flex: 1;
  min-width: 0;
}

.tactic-npc-name {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--gold);
}

.tactic-hint {
  font-size: 12px;
  color: var(--gold-light);
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  margin: 4px 0;
  line-height: 1.3;
}

.tactic-vs-inline {
  font-size: 12px;
  color: var(--brown);
  margin-top: 4px;
}

.tactic-buttons-compact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin: 4px 0;
}

.btn-tactic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: 'Inter', -apple-system, sans-serif;
}

.btn-tactic:hover {
  border-color: var(--gold);
  background: rgba(233, 69, 96, 0.08);
}

.btn-tactic .tactic-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.btn-tactic .tactic-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.btn-tactic .tactic-desc {
  display: none; /* hide long descriptions — name + icon is enough */
}

.tactic-relic-bonus {
  display: inline-block;
  background: var(--green);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Social tactic hover colors */
.btn-tactic-flex:hover { border-color: #ff1744; background: rgba(255,23,68,0.08); }
.btn-tactic-flatter:hover { border-color: #e91e63; background: rgba(233,30,99,0.08); }
.btn-tactic-gift:hover { border-color: #00e676; background: rgba(0,230,118,0.08); }
.btn-tactic-trick:hover { border-color: #7c4dff; background: rgba(124,77,255,0.08); }
.btn-tactic-confide:hover { border-color: #448aff; background: rgba(68,138,255,0.08); }
.btn-tactic-stonewall:hover { border-color: #78909c; background: rgba(120,144,156,0.08); }

.tactic-bottom-actions {
  margin-top: 8px;
  border-top: 1px solid var(--gold-light);
  padding-top: 10px;
}

/* Tactic Result */

.tactic-result-approach {
  font-size: 14px;
  color: var(--brown);
  text-align: center;
  margin: 6px 0;
  font-family: 'Cinzel', Georgia, serif;
}

.tactic-result-text {
  font-size: 14px;
  color: var(--text);
  text-align: center;
  font-style: italic;
  margin: 10px 0;
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(233, 69, 96, 0.05);
  border: 1px solid rgba(233, 69, 96, 0.15);
  border-radius: 6px;
}

.result-partial {
  border-left: 4px solid #ff9800;
}

.result-partial .modal-title {
  color: #ff9800;
}

/* ── Avatar Selection Screen ─────────────────────────────────────── */

.avatar-select-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
}
.avatar-select-screen h1 {
  font-family: 'Cinzel', serif; color: var(--gold); font-size: 28px;
}
.avatar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 400px;
}
.avatar-option {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 8px; border: 2px solid transparent; border-radius: 8px;
  transition: all 0.2s;
}
.avatar-option:hover:not(.avatar-locked) { border-color: var(--gold); background: rgba(233,69,96,0.1); }
.avatar-option img { width: 64px; height: 64px; border-radius: 50%; }
.avatar-option span { font-size: 11px; color: var(--text); }

.avatar-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.avatar-locked:hover { opacity: 0.6; }

.avatar-img-wrap {
  position: relative;
  display: inline-block;
}

.avatar-lock {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 16px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  padding: 2px 4px;
  line-height: 1;
}

.avatar-skill {
  font-size: 9px;
  color: #e040fb;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.avatar-skill-standard {
  color: var(--green);
}

.avatar-tier {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
