/* =============================
   lastMin.css - v4.91 Spacing Adjustment
   ============================= */

/* --- Global Reset --- */
#last-min-screen.screen {
  padding: 0 !important;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}
#last-min-screen * { box-sizing: border-box; }

/* --- Main Container --- */
#last-min-mainbox {
  width: 94%;
  max-width: 640px;
  margin: 0 auto !important;
  padding: 0 16px 80px 16px !important;
}

/* カード共通 */
#section-counters, #section-dangers, #section-combos {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.05);
  width: 100%;
}

/* --- Title & Desc --- */
#last-min-screen .main-catch-title {
  width: 100%;
  /* ★変更: ヘッダーとの距離を詰める (32px -> 12px) */
  margin-top: 12px; 
  margin-bottom: 8px;
  font-size: 2.2em;
  text-align: center;
  font-weight: 900;
  color: inherit;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
#last-min-screen .main-catch-title .prep { color: var(--accent, #32BAE7); }

#last-min-screen .main-catch-desc {
  text-align: center;
  font-size: 0.85em;
  color: var(--muted, #888);
  margin-bottom: 48px; 
  line-height: 1.4;
  padding: 0 10px;
  display: block;
}

/* --- Character Select Row --- */
.top-char-select-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px; 
  width: 100%;
}
.top-char-select-row label {
  display: flex; align-items: center; gap: 8px; font-size: 0.95em; font-weight: 700; opacity: 0.9; white-space: nowrap;
}
.top-char-select-row select {
  font-size: 1em; background: rgba(128,128,128,0.1); border: 1px solid rgba(128,128,128,0.2);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; color: inherit; font-weight: 600; min-width: 100px; text-align: center;
}

/* --- Section Headers --- */
.main-section-header {
  display: flex; align-items: center; justify-content: flex-start;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #fff !important;
  padding: 0 16px; height: 48px;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.main-section-header.inactive {
  background: #f1f5f9; color: #64748b !important; border-bottom: 1px solid rgba(0,0,0,0.05);
}

#last-min-screen .section-icon {
  font-size: 1.5em; margin-right: 12px; display: flex; align-items: center; justify-content: center;
  height: 100%; width: 28px; border: none !important;
  color: #fff !important;
}
#last-min-screen .section-title {
  flex: 1; font-size: 1.1em; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  text-align: left; display: flex; align-items: center; height: 100%;
  border: none !important; padding: 0 !important; margin: 0 !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
#last-min-screen .section-title::before, #last-min-screen .section-title::after { display: none !important; content: none !important; }

.add-item, button.add-item {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: rgba(255,255,255,0.25);
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.4); color: #fff;
  font-size: 1.4em; font-weight: 400; line-height: 1; cursor: pointer; margin-left: auto; transition: 0.2s;
}
.add-item:hover { background: rgba(255,255,255,0.5); }

/* --- LastMin Move Search --- */
.lastmin-move-search-shell {
  margin-bottom: 10px;
}

.lastmin-move-search-form {
  border-radius: 14px;
  padding: 8px;
}

.lastmin-move-search-character {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0 12px;
  font-size: 0.82em;
  font-weight: 800;
  white-space: nowrap;
}

.lastmin-move-search-message {
  text-align: left;
  margin: 6px 2px 0;
}

.lastmin-move-search-candidates {
  margin-top: 8px;
}

/* --- Content Area --- */
.section-accordion-content { display: none; background: transparent; width: 100%; }
.section-accordion-content.active { display: block; }
.counter-list-content-count {
  text-align: center; color: var(--muted, #888); font-size: 0.85em; padding: 16px 0; background: rgba(0,0,0,0.02);
}

/* --- List Items --- */
.counter-entry, .danger-item, .combo-starter-group {
  background: transparent; border: none; border-radius: 0; margin: 0;
  padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); transition: background 0.15s; width: 100%;
}
.counter-entry:last-child, .danger-item:last-child, .combo-starter-group:last-child { border-bottom: none; }
.counter-entry:hover, .danger-item:hover, .combo-starter-group:hover { background: rgba(0,0,0,0.02); }

/* Grid Layouts */
.counter-entry.gp-list-row {
  display: grid;
  grid-template-columns: 48px 1fr 20px 1fr 32px; 
  align-items: center; gap: 6px; min-height: 44px;
}
.danger-item-row {
  display: grid; grid-template-columns: 24px 24px 1fr 32px; align-items: center; gap: 8px; min-height: 36px;
}
.combo-entry-row {
  display: grid; grid-template-columns: auto 40px 1fr 32px; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(0,0,0,0.03);
}
.combo-entry-row:last-child { border-bottom: none; }

/* Text Styles */
.gp-move {
  font-size: 0.95em; font-weight: 600; white-space: normal; word-break: break-word; overflow: visible; line-height: 1.25;
}
.combo-recipe {
  font-size: 0.95em; color: #444; white-space: normal; word-break: break-word; overflow: visible; line-height: 1.25; text-align: left;
}
.danger-opp-move { text-align: left !important; padding-left: 8px; white-space: normal; word-break: break-word; line-height: 1.25; }
.gp-arrow { color: #ccc; font-size: 0.9em; text-align: center; }
.skill-frame-link {
  color: #2178e7; font-weight: 700; font-size: 0.85em; text-decoration: none; text-align: center;
  background: rgba(33, 120, 231, 0.1); border-radius: 4px; padding: 3px 0; display: block;
}

.danger-drag-handle { color: #ccc; cursor: grab; text-align: center; font-size: 1.2em; }
.danger-toggle { background: none; border: none; color: #888; cursor: pointer; text-align: center; font-size: 0.8em; width: 100%; }
.danger-item-body {
  margin-top: 8px; padding: 12px 16px; background: rgba(0,0,0,0.03); border-radius: 8px; font-size: 0.9em; color: #555; margin-left: 56px; line-height: 1.5; text-align: left;
}

.combo-starter-header {
  font-weight: 800; color: #368ad1; font-size: 1.15em;
  padding: 6px 0; margin-bottom: 4px; display: inline-block; width: 100%; text-align: left !important;
}
.combo-chip { font-size: 0.75em; padding: 3px 8px; border-radius: 4px; text-align: center; white-space: nowrap; }
.abbr-chip { background: #eef6fa; color: #555; font-weight: 600; border: 1px solid rgba(0,0,0,0.05); }
.dmg-chip { color: #444; font-weight: 700; text-align: right; font-family: monospace; font-size: 1.1em; }

.gp-edit-btn button, .danger-edit-btn, .edit-entry {
  background: transparent; border: none; color: #ccc; font-size: 1.2em; cursor: pointer; padding: 0; text-align: center; width: 100%; display: flex; justify-content: center; transition: color 0.2s;
}
.gp-edit-btn button:hover, .danger-edit-btn:hover, .edit-entry:hover { color: #32BAE7; }
#edit-modal-box, .vfp-popup-box { background-color: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.3); padding: 24px; border: 1px solid rgba(0,0,0,0.1); }

/* Floating Buttons */
#last-min-screen .button-group {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; justify-content: center; gap: 12px; z-index: 1000;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); border: 1px solid rgba(0,0,0,0.05);
  width: auto; max-width: 90%; margin: 0 !important;
}
#last-min-screen .button-group button.common-btn {
  min-width: 80px; font-size: 0.9em; padding: 10px 14px;
  border-radius: 10px; background: #f0f2f5; color: #333; border: none; font-weight: 700; box-shadow: none;
}
#last-min-screen .button-group button.common-btn:hover { background: #32BAE7; color: #fff; }

/* --- Dark Mode Overrides --- */
:root[data-theme="dark"] #section-counters, :root[data-theme="dark"] #section-dangers, :root[data-theme="dark"] #section-combos { background: #151922; border: 1px solid rgba(255,255,255,0.1); }

/* Dark Mode Header */
:root[data-theme="dark"] .main-section-header { 
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); 
  border-bottom-color: rgba(255,255,255,0.08); 
}
:root[data-theme="dark"] .main-section-header.inactive { 
  background: #0f172a; color: #64748b !important; border-bottom-color: rgba(255,255,255,0.03); 
}

:root[data-theme="dark"] .counter-entry, :root[data-theme="dark"] .danger-item, :root[data-theme="dark"] .combo-starter-group { border-bottom-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .counter-entry:hover, :root[data-theme="dark"] .danger-item:hover, :root[data-theme="dark"] .combo-starter-group:hover { background: rgba(255,255,255,0.03); }
:root[data-theme="dark"] .top-char-select-row select { background: #1e293b; border-color: rgba(255,255,255,0.15); color: #e9f0f6; }
:root[data-theme="dark"] .lastmin-move-search-character { background: rgba(255,255,255,0.05); }
:root[data-theme="dark"] .gp-move, :root[data-theme="dark"] #last-min-screen .section-title, :root[data-theme="dark"] .combo-recipe { color: #e9f0f6 !important; }
:root[data-theme="dark"] .skill-frame-link { color: #63b3ed; background: rgba(99, 179, 237, 0.15); }
:root[data-theme="dark"] .danger-item-body { background: rgba(255,255,255,0.05); color: #cbd5e0; }
:root[data-theme="dark"] .combo-starter-header { color:#63b3ed; }
:root[data-theme="dark"] .abbr-chip { background: rgba(99,179,237,0.15); color: #bee3f8; border-color: rgba(255,255,255,0.1); }
:root[data-theme="dark"] .dmg-chip { color: #e9f0f6; }
:root[data-theme="dark"] #edit-modal-box, :root[data-theme="dark"] .vfp-popup-box { background-color: #1e2432 !important; color: #e9f0f6; border-color: rgba(255,255,255,0.1); }
:root[data-theme="dark"] #last-min-screen .button-group { background: rgba(30, 36, 50, 0.9); border: 1px solid rgba(255,255,255,0.1); }
:root[data-theme="dark"] #last-min-screen .button-group button.common-btn { background: #2d3748; color: #e9f0f6; }
