/* ============================================================
   styles.css — Sengoku AI  /  Neubrutalism UI Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Base palette */
  --bg: #F5F0E8;
  --bg-dark: #EDE8DF;
  --black: #1a1a1a;
  --white: #FFFFFF;
  --gray: #6B6B6B;
  --gray-light: #ADB5BD;

  /* Borders & shadows */
  --border: 3px solid var(--black);
  --shadow: 4px 4px 0 var(--black);
  --shadow-sm: 2px 2px 0 var(--black);
  --shadow-lg: 6px 6px 0 var(--black);
  --radius: 8px;

  /* Faction colours */
  --player:  #FF6B6B;
  --enemy1:  #845EF7;
  --enemy2:  #4ECDC4;
  --enemy3:  #FF922B;
  --enemy4:  #3B82F6;
  --neutral: #ADB5BD;

  /* Resource colours */
  --troop: #FF922B;
  --food:  #51CF66;
  --gold:  #FFD43B;

  /* UI accent */
  --accent: #FF6B6B;
  --accent-hover: #FF4F4F;

  /* Timing */
  --transition: 120ms ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
  font-size: 14px;
  color: var(--black);
  line-height: 1.5;
}

/* ============================================================
   Screen System
   ============================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  opacity: 0;
  transition: opacity 300ms ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

.screen.active {
  animation: screenFadeIn 300ms ease forwards;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.card-title {
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--black);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 10px 18px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
}

.btn-sm:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--black);
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* ---- Resource chip flash animations ---- */
@keyframes chipFlashUp {
  0%   { background: var(--bg); }
  30%  { background: #B8F5C8; box-shadow: 0 0 6px rgba(81, 207, 102, 0.7); }
  100% { background: var(--bg); }
}

@keyframes chipFlashDown {
  0%   { background: var(--bg); }
  30%  { background: #FFDAD8; box-shadow: 0 0 6px rgba(255, 107, 107, 0.7); }
  100% { background: var(--bg); }
}

.chip-flash-up {
  animation: chipFlashUp 600ms ease forwards;
}

.chip-flash-down {
  animation: chipFlashDown 600ms ease forwards;
}

/* Speed control buttons */
.speed-btn {
  font-size: 11px;
  padding: 5px 10px;
  font-weight: 900;
  min-width: 36px;
  border-radius: 6px;
}

.speed-btn.active {
  background: var(--black);
  color: var(--white);
  box-shadow: none;
  transform: translate(2px, 2px);
}

/* ============================================================
   Loading Screen
   ============================================================ */
#screen-loading {
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.loading-title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.02em;
  border: 4px solid var(--black);
  padding: 12px 28px;
  background: var(--white);
  box-shadow: 8px 8px 0 var(--black);
  border-radius: var(--radius);
}

.loading-box {
  width: 280px;
  text-align: center;
}

.progress-bar-track {
  width: 100%;
  height: 20px;
  border: var(--border);
  border-radius: 10px;
  background: var(--bg-dark);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 400ms ease;
}

.loading-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray);
  font-weight: 700;
}

/* ============================================================
   Title Screen
   ============================================================ */
#screen-title {
  align-items: center;
  justify-content: center;
  gap: 0;
}

.title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.title-kamon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 4px;
}

.title-h1 {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.03em;
  border-bottom: 5px solid var(--black);
  padding-bottom: 4px;
}

.title-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray);
  text-align: center;
  line-height: 1.6;
}

.title-start-btn {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
  padding: 14px 48px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.1em;
}

.title-start-btn:hover {
  background: var(--accent-hover);
}

.title-version {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 11px;
  color: var(--gray-light);
  font-weight: 700;
}

/* ============================================================
   Game Screen
   ============================================================ */
#screen-game {
  display: none;
  flex-direction: column;
}

#screen-game.active {
  display: flex;
}

/* ---- Top Bar ---- */
.top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--white);
  border-bottom: var(--border);
  box-shadow: 0 2px 0 var(--black);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.top-bar::-webkit-scrollbar { display: none; }

.resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border: 2px solid var(--black);
  border-radius: 6px;
  background: var(--bg);
  box-shadow: 2px 2px 0 var(--black);
  white-space: nowrap;
  flex-shrink: 0;
}

.resource-chip .chip-icon {
  font-size: 14px;
  line-height: 1;
}

.resource-chip.chip-troop  { border-color: var(--troop); }
.resource-chip.chip-food   { border-color: var(--food); }
.resource-chip.chip-gold   { border-color: var(--gold); }
.resource-chip.chip-territory { border-color: var(--player); }

.top-bar-sep {
  width: 2px;
  height: 24px;
  background: var(--black);
  border-radius: 2px;
  flex-shrink: 0;
}

.tick-display {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  flex-shrink: 0;
  white-space: nowrap;
}

.speed-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ---- Map Container ---- */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #D6EAF8;
  border-bottom: var(--border);
  min-height: 0;
}

/* Subtle noise texture overlay on the map */
.map-container::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.04;
}

/* Vignette effect on map edges */
.map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.18) 100%
  );
}

/* ---- Minimap ---- */
#minimap-canvas {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 100px;
  height: 80px;
  border: var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: #B8D4E8;
  cursor: pointer;
  z-index: 10;
  image-rendering: pixelated;
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#map-canvas.dragging {
  cursor: grabbing;
}

/* Intervention FAB */
.fab-intervention {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
  border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 10;
}

.fab-intervention:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--black);
}

.fab-intervention:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}

/* ---- Info Panel ---- */
.info-panel {
  flex-shrink: 0;
  height: 40%;
  min-height: 180px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  border-top: var(--border);
}

/* ============================================================
   Tab System
   ============================================================ */
.tab-bar {
  display: flex;
  border-bottom: var(--border);
  background: var(--bg-dark);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  background: transparent;
  border: none;
  border-right: 2px solid var(--black);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn:hover {
  background: var(--bg);
  color: var(--black);
}

.tab-btn.active {
  background: var(--white);
  color: var(--black);
  border-bottom: 3px solid var(--accent);
  position: relative;
  bottom: -1px;
}

.tab-pages {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-page {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--black) var(--bg);
  opacity: 0;
  transform: translateY(4px);
}

.tab-page::-webkit-scrollbar { width: 6px; }
.tab-page::-webkit-scrollbar-track { background: var(--bg); }
.tab-page::-webkit-scrollbar-thumb { background: var(--black); border-radius: 3px; }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-page.active {
  display: flex;
  animation: tabFadeIn 200ms ease forwards;
}

/* ---- Overview Tab ---- */
.overview-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.slider-label span:last-child {
  font-size: 11px;
  color: var(--gray);
  font-weight: 400;
}

.slider-track {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--bg-dark);
  border: 2px solid var(--black);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--white);
  border: var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Personality grid */
.personality-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.personality-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.personality-name {
  width: 64px;
  font-weight: 700;
  flex-shrink: 0;
}

.personality-bar-track {
  flex: 1;
  height: 12px;
  border: 2px solid var(--black);
  border-radius: 3px;
  background: var(--bg-dark);
  overflow: hidden;
}

.personality-bar-fill {
  height: 100%;
  background: var(--black);
  border-radius: 3px;
  transition: width 300ms ease;
}

.personality-value {
  width: 32px;
  text-align: right;
  font-size: 11px;
  color: var(--gray);
  flex-shrink: 0;
}

/* ---- Thought Log Tab ---- */
.thought-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.thought-entry {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--black);
  animation: slideIn 200ms ease;
}

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

.thought-tick {
  font-size: 10px;
  color: var(--gray);
  font-weight: 700;
  white-space: nowrap;
  padding-top: 1px;
  flex-shrink: 0;
}

.thought-text {
  line-height: 1.5;
  color: var(--black);
}

.thought-action {
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
  padding: 1px 5px;
  border: 1.5px solid var(--black);
  border-radius: 3px;
  margin-right: 4px;
  background: var(--bg-dark);
}

/* ---- News Feed Tab ---- */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.news-entry {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--black);
  animation: slideIn 200ms ease;
}

.news-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-tick {
  font-size: 10px;
  color: var(--gray);
  font-weight: 700;
}

.news-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border: 2px solid var(--black);
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-tag-battle  { background: #FFEAEA; color: var(--accent); }
.news-tag-diplo   { background: #EAF0FF; color: var(--enemy4); }
.news-tag-recruit { background: #FFF8EA; color: var(--troop); }
.news-tag-build   { background: #EAFFF0; color: var(--food); }
.news-tag-ai      { background: #F3EAFF; color: var(--enemy1); }

.news-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--black);
}

/* ============================================================
   Province Modal (Bottom Sheet)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: none;
  align-items: flex-end;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  background: var(--bg);
  border-top: var(--border);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 0 var(--black);
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.22,1,0.36,1);
  max-height: 70dvh;
  overflow-y: auto;
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 48px;
  height: 5px;
  background: var(--black);
  border-radius: 3px;
  margin: 0 auto 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--gray);
  font-weight: 700;
  margin-bottom: 14px;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-block {
  background: var(--white);
  border: var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-block .stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-block .stat-value {
  font-size: 20px;
  font-weight: 900;
}

.modal-adj {
  margin-top: 12px;
  margin-bottom: 12px;
}

.modal-adj-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.modal-adj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-adj-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 4px;
  box-shadow: 1px 1px 0 var(--black);
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ---- Intervention Buttons ---- */
.btn-attack {
  background: var(--danger, #FF6B6B);
  color: var(--white);
  flex: 1;
  min-width: 80px;
}

.btn-attack:hover { background: #e55a5a; }

.btn-recruit {
  background: var(--accent, #FFDD57);
  color: var(--black);
  flex: 1;
  min-width: 80px;
}

.btn-recruit:hover { background: #f5d000; }

.btn-retreat {
  background: var(--info, #3B82F6);
  color: var(--white);
  flex: 1;
  min-width: 80px;
}

.btn-retreat:hover { background: #2563eb; }

.btn-intervention {
  font-size: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn-intervention .btn-cd {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
}

.btn-intervention:disabled .btn-cd {
  font-weight: 700;
}

.btn-no-action {
  font-size: 12px;
  color: var(--gray);
  padding: 8px 12px;
  background: var(--bg-dark);
  border: 2px dashed var(--gray-light);
  border-radius: var(--radius);
  cursor: default;
  width: 100%;
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

/* ============================================================
   Result Screen
   ============================================================ */
#screen-result {
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}

.result-banner {
  font-size: 40px;
  font-weight: 900;
  text-align: center;
  border: 4px solid var(--black);
  padding: 14px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--white);
  letter-spacing: -0.02em;
}

.result-banner.win  { border-color: var(--gold); box-shadow: 6px 6px 0 #B8860B; }
.result-banner.lose { border-color: var(--accent); }

.result-stats {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--white);
  border: var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 700;
}

.result-stat-row span:last-child {
  font-size: 15px;
  font-weight: 900;
}

.result-buttons {
  display: flex;
  gap: 12px;
}

/* ============================================================
   Faction Colour Helpers
   ============================================================ */
.color-player  { color: var(--player); }
.color-enemy1  { color: var(--enemy1); }
.color-enemy2  { color: var(--enemy2); }
.color-enemy3  { color: var(--enemy3); }
.color-enemy4  { color: var(--enemy4); }
.color-neutral { color: var(--neutral); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--black);
  flex-shrink: 0;
}

/* ============================================================
   Utility
   ============================================================ */
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.fw-bold  { font-weight: 700; }
.fw-black { font-weight: 900; }
.text-gray { color: var(--gray); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ============================================================
   Mobile — Larger touch targets for coarse pointer (touch) devices
   ============================================================ */
/* ---- Pause overlay ---- */
.pause-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.1em;
  z-index: 10;
  pointer-events: none;
}

.pause-overlay.visible {
  display: flex;
}

@media (pointer: coarse) {
  .tab-btn         { min-height: 44px; }
  .speed-btn       { min-width: 44px; min-height: 38px; }
  .btn-intervention { min-height: 48px; }
}

/* ============================================================
   Responsive — Mobile (≤ 480px) tweaks
   ============================================================ */
@media (max-width: 480px) {
  .loading-title { font-size: 36px; }
  .title-h1      { font-size: 40px; }
  .title-kamon   { font-size: 44px; }

  .info-panel {
    height: 35%;
    min-height: 160px;
    max-height: 260px;
  }

  .personality-grid {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .modal-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   Responsive — Desktop (≥ 768px) — Side Panel Layout
   ============================================================ */
@media (min-width: 768px) {
  #screen-game {
    flex-direction: column;
  }

  .game-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
  }

  .map-container {
    flex: 1;
    border-bottom: none;
    border-right: var(--border);
  }

  .info-panel {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    max-height: none;
    border-bottom: none;
  }

  .modal-sheet {
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    border: var(--border);
    box-shadow: var(--shadow-lg);
  }

  .modal-overlay {
    align-items: center;
    justify-content: center;
  }

  .result-banner { font-size: 52px; }
}
