/* ── CSS Variables ── */
:root {
  --bg:           #0b0e14;
  --bg2:          #111620;
  --bg3:          #1a2030;
  --glass:        rgba(255,255,255,0.045);
  --glass-hover:  rgba(255,255,255,0.08);
  --border:       rgba(255,255,255,0.10);
  --text:         #e8eaf0;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;
  --up:           #22c55e;
  --up-bg:        rgba(34,197,94,0.12);
  --down:         #ef4444;
  --down-bg:      rgba(239,68,68,0.12);
  --blue:         #3b82f6;
  --blue-dark:    #1d4ed8;
  --gold:         #f59e0b;
  --gold-bg:      rgba(245,158,11,0.12);
  --radius:       12px;
  --radius-sm:    8px;
  --blur:         blur(14px);
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; font-size: inherit; }
input  { font-family: inherit; font-size: inherit; }
table  { border-collapse: collapse; width: 100%; }
a { color: var(--blue); text-decoration: none; }

/* ── Utility ── */
.text-right { text-align: right; }
.up   { color: var(--up)  !important; }
.down { color: var(--down)!important; }
.empty-msg { color: var(--text-muted); text-align: center; padding: 20px; font-size: 13px; }

/* ── Card / Glass panel ── */
.card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--glass-hover); }

.btn-danger {
  background: var(--down);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-danger:hover { opacity: 0.9; }
.btn-danger:active { transform: scale(0.97); }

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--down);
  color: var(--down);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.btn-danger-outline:hover { background: var(--down-bg); }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ── Splash screen ── */
.splash {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 60% 30%, #0a1628 0%, #050810 100%);
  overflow-y: auto;
  padding: 40px 20px;
}
.splash-inner { text-align: center; max-width: 840px; width: 100%; }
.splash-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.splash-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 40px; }
.mode-cards { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.mode-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 320px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}
.mode-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.mode-card h2 { font-size: 1.2rem; margin-bottom: 12px; color: #fff; }
.mode-icon { font-size: 2.5rem; margin: 12px 0; }
.mode-card ul { list-style: none; margin-bottom: 20px; }
.mode-card li { padding: 5px 0; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.mode-card li:last-child { border-bottom: none; }
.mode-card li strong { color: var(--text); }
.mode-card .btn-primary { width: 100%; text-align: center; }
.load-save-area { margin-top: 24px; }

/* ── Game layout ── */
#game {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
#header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}
.header-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.header-title-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  margin-left: 12px;
  white-space: nowrap;
}
.header-stats { display: flex; gap: 20px; flex: 1; }
.stat-item { display: flex; flex-direction: column; line-height: 1.2; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.header-date { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; white-space: nowrap; }
#hdr-date { font-size: 12px; color: var(--text-dim); }
.turn-badge {
  font-size: 11px; padding: 2px 6px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 4px;
}
.btn-next-day {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; padding: 8px 20px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; white-space: nowrap;
  box-shadow: 0 0 16px rgba(99,102,241,0.4);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-next-day:hover { opacity: 0.9; }
.btn-next-day:active { transform: scale(0.97); }
.btn-next-day:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Game body ── */
.game-body { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 140px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-btn:hover { background: var(--glass); color: var(--text); }
.nav-btn.active { background: rgba(59,130,246,0.15); color: var(--blue); font-weight: 600; }
.nav-icon { font-size: 16px; }
.badge {
  position: absolute; right: 8px; top: 8px;
  background: var(--down); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.view-header h2 { font-size: 1.3rem; font-weight: 700; }

/* ── Dashboard ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.kpi-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.kpi-change, .kpi-sub { font-size: 12px; color: var(--text-muted); }

.chart-panel {
  margin-bottom: 16px;
  min-height: 240px;
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.chart-header h3 { font-size: 1rem; font-weight: 600; }
.chart-range-btns { display: flex; gap: 6px; }
.range-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--glass); transition: all 0.15s;
}
.range-btn.active, .range-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.chart-container { height: 200px; position: relative; }

.dashboard-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portfolio-summary h3, .recent-news h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 10px; }
.summary-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.summary-row:last-child { border-bottom: none; }
.summary-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-val  { min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.summary-pnl  { min-width: 80px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

.news-row {
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-dim);
  display: flex; align-items: flex-start; gap: 8px;
}
.news-row:last-child { border-bottom: none; }
.news-row.big { color: var(--text); font-weight: 600; }
.news-row.kabushin { color: var(--gold); }
.news-type-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
  background: var(--text-muted);
}
.type-crash, .type-company_negative { background: var(--down) !important; }
.type-sector_boost, .type-company_positive { background: var(--up) !important; }
.type-kabushin { background: var(--gold) !important; }
.type-earnings { background: var(--blue) !important; }

/* Market status badge */
.market-status {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--border);
}
.market-status.bull { background: var(--up-bg); border-color: var(--up); color: var(--up); }
.market-status.bear { background: var(--down-bg); border-color: var(--down); color: var(--down); }
.market-status.crash { background: rgba(239,68,68,0.25); border-color: var(--down); color: #fca5a5; animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Market ── */
.market-controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 12px;
}
.search-input {
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text); outline: none; width: 200px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--blue); }

.sector-filter {
  display: flex; gap: 6px; flex-wrap: wrap; overflow-x: auto;
  max-width: 100%; padding-bottom: 2px;
}
.filter-btn {
  padding: 5px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--glass);
  transition: all 0.15s;
}
.filter-btn.active, .filter-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

.sort-select {
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text); outline: none;
}

.market-table-wrapper {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: calc(100vh - 260px);
}
.market-table thead {
  position: sticky; top: 0;
  background: var(--bg3);
  z-index: 10;
}
.market-table th, .market-table td {
  padding: 9px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.market-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.market-table .stock-row { cursor: pointer; transition: background 0.1s; }
.market-table .stock-row:hover { background: var(--glass-hover); }
.ticker { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 12px; }
.stock-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.price-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.sector-tag { font-size: 11px; color: var(--text-muted); }

.rank-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.rank-bc { background: rgba(59,130,246,0.2); color: #93c5fd; }
.rank-gr { background: rgba(34,197,94,0.2); color: #86efac; }
.rank-ps { background: rgba(239,68,68,0.2); color: #fca5a5; }

.market-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--border); background: var(--glass); color: var(--text-muted);
  transition: all 0.15s;
}
.page-btn.active, .page-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-info { font-size: 12px; color: var(--text-muted); margin-right: 8px; }

/* ── Portfolio ── */
.portfolio-kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px;
}
.portfolio-charts-row { display: flex; gap: 16px; flex-wrap: wrap; }
.chart-container-sm { height: 220px; position: relative; }

.portfolio-table th, .portfolio-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.portfolio-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.portfolio-table tbody tr:hover { background: var(--glass-hover); }

.btn-sell-quick {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: rgba(239,68,68,0.15); color: var(--down); border: 1px solid var(--down);
  transition: background 0.15s;
}
.btn-sell-quick:hover { background: rgba(239,68,68,0.3); }

.trade-history-table th, .trade-history-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12px; white-space: nowrap;
}
.trade-history-table th { font-size: 10px; text-transform: uppercase; color: var(--text-muted); }
.trade-buy  { color: var(--up);   font-weight: 700; }
/* Trade Modal Specifics */
.modal-trade-area {
  padding-top: 20px;
}

.trade-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.trade-calc-row {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.type-btn {
  flex: 1;
  background: none;
  border: none;
  color: #94a3b8;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 600;
}

.type-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.type-btn.active {
  background: #3b82f6; 
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.type-btn[data-type="MARGIN_SELL"].active {
  background: #ec4899;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* Portfolio badges */
.type-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
.type-badge.type-mb { color: #3b82f6; background: rgba(59, 130, 246, 0.1); font-weight: bold; }
.type-badge.type-ms { color: #ec4899; background: rgba(236, 72, 153, 0.1); font-weight: bold; }

.trade-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.trade-info-grid div {
  color: var(--text-muted);
}
.trade-info-grid .down {
  color: var(--down);
}

.trade-cash-row {
  margin: 15px 0;
  min-height: 40px;
}

.trade-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.trade-info-grid div {
  color: var(--text-muted);
}

.trade-info-grid .down {
  color: var(--down);
}

.trade-fields {
 color: var(--down); font-weight: 700; }

/* ── News view ── */
.news-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
.news-layout h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-dim);
}
.news-item.big { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.05); color: var(--text); font-weight: 600; }
.news-item.kabushin { border-color: rgba(245,158,11,0.4); background: var(--gold-bg); color: var(--gold); }
.news-turn { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }
.news-headline { flex: 1; line-height: 1.4; }
.news-flag { font-size: 10px; padding: 2px 6px; background: var(--gold); color: #000; border-radius: 4px; font-weight: 700; white-space: nowrap; }

/* ── Kabu-tter ── */
.kabu-tter h3 { color: var(--text); }
.kabutterFeed { display: flex; flex-direction: column; gap: 10px; }
.tweet {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.tweet.kabushin-tweet { border-color: var(--gold); background: var(--gold-bg); }
.tweet-author { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.tweet-handle { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.tweet-text { font-size: 13px; line-height: 1.5; color: var(--text-dim); margin-bottom: 6px; }
.kabushin-tweet .tweet-text { color: var(--gold); }
.tweet-turn { font-size: 10px; color: var(--text-muted); }

/* ── Ranking ── */
.achievements-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.ach-badge {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 90px; text-align: center; transition: all 0.15s;
}
.ach-badge.locked { opacity: 0.3; filter: grayscale(1); }
.ach-badge.unlocked { border-color: var(--gold); background: var(--gold-bg); }
.ach-icon { font-size: 1.5rem; }
.ach-name { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.ach-badge.unlocked .ach-name { color: var(--gold); }

.ranking-table th, .ranking-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.ranking-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.ranking-table tbody tr { transition: background 0.1s; }
.ranking-table tbody tr:hover { background: var(--glass); }
.player-row { background: rgba(59,130,246,0.08) !important; }
.player-row td { color: var(--blue); }
.rank-num { font-weight: 700; width: 40px; }
.title-badge { font-size: 11px; padding: 2px 8px; background: var(--gold-bg); border: 1px solid var(--gold); border-radius: 4px; color: var(--gold); }

/* ── Market info (market view header) ── */
.market-info {
  font-size: 13px; color: var(--text-muted); padding: 4px 12px;
  background: var(--glass); border-radius: 20px; border: 1px solid var(--border);
}
.market-info.up { color: var(--up); }
.market-info.down { color: var(--down); }

/* ── Trade modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto;
  background: #111824;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.modal-stock-name { font-size: 1.1rem; font-weight: 700; }
.modal-stock-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-close { font-size: 16px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: var(--glass-hover); }
.modal-chart { height: 120px; position: relative; margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.modal-price-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-price { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.modal-change { font-size: 14px; margin-left: 8px; }
.modal-owned { font-size: 12px; color: var(--text-muted); }

.trade-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.trade-tab {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--glass); font-weight: 600; transition: all 0.15s;
}
.trade-tab[data-action="buy"].active  { background: rgba(34,197,94,0.15); border-color: var(--up); color: var(--up); }
.trade-tab[data-action="sell"].active { background: rgba(239,68,68,0.15); border-color: var(--down); color: var(--down); }
.trade-tab:disabled { opacity: 0.3; cursor: not-allowed; }

.trade-input-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.trade-input-row label { color: var(--text-muted); font-size: 13px; width: 36px; }
.trade-qty-input {
  flex: 1; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; outline: none;
}
.trade-qty-input:focus { border-color: var(--blue); }
.trade-calc-row { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.trade-cash-row { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.btn-trade {
  width: 100%; padding: 12px; font-size: 15px; font-weight: 700;
  border-radius: var(--radius-sm); text-align: center;
}

/* ── Achievement modal ── */
.achievement-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
}
.achievement-modal.hidden { display: none; }
.achievement-inner {
  background: #111824; border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 40px 50px; text-align: center;
  box-shadow: 0 0 40px rgba(245,158,11,0.3);
  animation: achPop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes achPop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
.achievement-icon { font-size: 3rem; margin-bottom: 8px; }
.achievement-title { font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.achievement-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; }
.achievement-inner .btn-primary { margin: 0 auto; display: block; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: #1e2638; border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 13px; max-width: 300px;
  opacity: 0; transform: translateX(20px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { border-color: var(--up); background: rgba(34,197,94,0.1); color: var(--up); }
.toast-error   { border-color: var(--down); background: rgba(239,68,68,0.1); color: var(--down); }
.toast-info    { border-color: var(--blue); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Event Banner ── */
.event-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  animation: bannerSlide 0.35s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
}
.event-banner.hidden { display: none; }
@keyframes bannerSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.event-banner-text { flex: 1; }
.event-banner-close {
  flex-shrink: 0;
  opacity: 0.6;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.event-banner-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }

.banner-crash    { background: rgba(220,38,38,0.25);  color: #fca5a5; border-color: rgba(220,38,38,0.5); }
.banner-earnings { background: rgba(245,158,11,0.2);  color: #fcd34d; border-color: rgba(245,158,11,0.5); }
.banner-positive { background: rgba(34,197,94,0.18);  color: #86efac; border-color: rgba(34,197,94,0.4); }
.banner-negative { background: rgba(239,68,68,0.18);  color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.banner-info     { background: rgba(59,130,246,0.18); color: #93c5fd; border-color: rgba(59,130,246,0.4); }

/* ── Responsive tweaks ── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .news-layout { grid-template-columns: 1fr; }
  .portfolio-charts-row { flex-direction: column; }
  .header-stats .stat-item:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  .sidebar { width: 52px; }
  .nav-btn span:not(.nav-icon) { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Lifestyle (Refined Premium UI) ── */
.lifestyle-intro {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}

/* Status Progress Header */
.lifestyle-header-area {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lifestyle-status-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lifestyle-status-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.lifestyle-status-badge {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
}
.status-progress-container {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.status-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #fbbf24);
  box-shadow: 0 0 10px rgba(245,158,11,0.5);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lifestyle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.lifestyle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
}
.lifestyle-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.lifestyle-card.owned {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(245,158,11,0.08) 0%, rgba(245,158,11,0.02) 100%);
}

.lifestyle-card-top {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}
.lifestyle-emoji {
  font-size: 3rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
  transition: transform 0.3s;
}
.lifestyle-card:hover .lifestyle-emoji {
  transform: scale(1.1) rotate(5deg);
}
.lifestyle-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.lifestyle-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.lifestyle-card-body {
  padding: 16px 20px;
  background: rgba(0,0,0,0.15);
  flex: 1;
}

/* Perk Styling */
.lifestyle-perk {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.lifestyle-perk.active {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
}
.lifestyle-perk.locked {
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border);
  opacity: 0.6;
}
.perk-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lifestyle-perk.active .perk-header { color: var(--blue); }
.lifestyle-perk.locked .perk-header { color: var(--text-muted); }

.perk-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.lifestyle-perk.active .perk-label { color: #fff; }

.perk-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.lifestyle-card-footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
}
.lifestyle-price-info {
  display: flex;
  flex-direction: column;
}
.lifestyle-price {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lifestyle-price.down { color: var(--down); }
.status-pts-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
}

.lifestyle-buy-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.lifestyle-owned-badge {
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Daily Summary Modal ── */
.daily-summary-card {
  max-width: 420px;
  width: 90%;
  text-align: center;
  padding: 32px 28px;
  animation: ds-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes ds-pop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.ds-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.ds-pnl-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.ds-pnl {
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
  line-height: 1;
}
.ds-pnl.up   { color: var(--up); }
.ds-pnl.down { color: var(--down); }
.ds-details {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.ds-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ds-detail-row:last-child { border-bottom: none; }
.ds-detail-label { color: var(--text-muted); }
.ds-detail-val   { font-weight: 600; font-variant-numeric: tabular-nums; }
.ds-close-btn    { width: 100%; font-size: 15px; padding: 12px; }

/* ── Asset Breakthrough Modal ── */
.breakthrough-inner {
  position: relative;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  overflow: hidden;
  animation: bt-appear 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bt-appear {
  from { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);  opacity: 1; }
}
.bt-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: bt-bounce 0.6s ease 0.3s both;
}
@keyframes bt-bounce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.bt-title {
  font-size: 1rem;
  color: #a78bfa;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.bt-milestone {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.bt-total {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* ── Confetti ── */
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Turn Slot Overlay ── */
.turn-slot-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.turn-slot-overlay.hidden { display: none; }
.slot-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 320px;
}
.slot-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  animation: slot-row-in 0.2s ease both;
}
@keyframes slot-row-in {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
.slot-row-name { font-weight: 600; }
.slot-row-delta {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.slot-row-delta.up   { color: var(--up); }
.slot-row-delta.down { color: var(--down); }

/* ── Daily Missions ── */
.missions-card { margin-bottom: 16px; }
.missions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.missions-header h3 { font-size: .95rem; font-weight: 600; }
.missions-turn { font-size: 12px; color: var(--text-muted); }
.missions-list { display: flex; flex-direction: column; gap: 8px; }
.mission-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  font-size: 13px;
  transition: background 0.2s;
}
.mission-row.completed {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
}
.mission-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
  transition: all 0.2s;
}
.mission-row.completed .mission-check {
  background: var(--up); border-color: var(--up); color: #fff;
}
.mission-text { flex: 1; color: var(--text-dim); }
.mission-row.completed .mission-text { color: var(--text); text-decoration: line-through; opacity: 0.7; }
.mission-reward {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ── Earnings Countdown Badge ── */
.earnings-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,0.15);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,0.35);
  margin-left: 6px;
  white-space: nowrap;
}
.earnings-badge.urgent {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.4);
  animation: badge-pulse 1s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.confidence-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}
.confidence-badge.conf-low {
  background: rgba(148,163,184,0.15);
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.3);
}
.confidence-badge.conf-mid {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.35);
}
.confidence-badge.conf-high {
  background: rgba(251,191,36,0.18);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.45);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

/* ── Hint System ── */
.hint-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  cursor: default;
}
.btn-hint {
  background: var(--gold-bg);
  border: 1px solid rgba(245,158,11,0.4);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-hint:hover  { background: rgba(245,158,11,0.2); }
.btn-hint:disabled { opacity: 0.35; cursor: not-allowed; }

.hint-prediction {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: ds-pop 0.25s ease;
}
.hint-prediction.hidden { display: none; }
.hint-icon { font-size: 1.6rem; }
.hint-body { flex: 1; }
.hint-label { font-weight: 700; font-size: 14px; }
.hint-prob  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Rival Alert Toast ── */
.toast-rival {
  background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(239,68,68,0.25));
  border: 1px solid rgba(245,158,11,0.5);
  color: #fcd34d;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  max-width: 360px;
}

/* ── Lifestyle Perk (特殊能力) ── */
.lifestyle-perk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
}
.lifestyle-perk.locked {
  background: rgba(100,116,139,0.1);
  border: 1px dashed rgba(100,116,139,0.3);
  color: var(--text-muted);
}
.lifestyle-perk.active {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.35);
  color: #93c5fd;
}
.perk-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.perk-label {
  font-weight: 700;
  flex-shrink: 0;
}
.perk-desc {
  color: var(--text-muted);
  flex: 1;
}
.lifestyle-perk.active .perk-desc {
  color: #93c5fd;
}

/* ── Earnings Bias Badge (決算傾向バッジ) ── */
.bias-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  white-space: nowrap;
}
.bias-badge.good {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.35);
}
.bias-badge.ok {
  background: rgba(34,197,94,0.08);
  color: #6ee7b7;
  border: 1px solid rgba(34,197,94,0.2);
}
.bias-badge.bad {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.35);
}
.bias-badge.warn {
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
}
.bias-badge.neutral {
  background: rgba(148,163,184,0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148,163,184,0.2);
}

/* ── Active Perks Card (ダッシュボード) ── */
.perks-card { margin-bottom: 16px; }
.perks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.perks-header h3 { font-size: .95rem; font-weight: 600; }
.active-perks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.active-perk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  font-size: 12px;
  animation: perk-fadein 0.3s ease;
}
@keyframes perk-fadein {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.active-perk-emoji {
  font-size: 16px;
  flex-shrink: 0;
}
.active-perk-name {
  font-weight: 700;
  color: #93c5fd;
  flex-shrink: 0;
}
.active-perk-desc {
  color: var(--text-muted);
  flex: 1;
}

/* ── Weekend Event Modal ──────────────────────────────────────────────────── */
.weekend-modal-card {
  max-width: 460px;
  width: 90%;
  padding: 28px;
  text-align: left;
}
.weekend-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.weekend-icon {
  font-size: 36px;
  line-height: 1;
}
.weekend-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.weekend-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.weekend-event-type {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 3px 12px;
  margin-bottom: 14px;
}
.weekend-headline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.weekend-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.weekend-effect-box {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #86efac;
}
.weekend-highlights {
  margin-top: 4px;
}
.wh-divider {
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.wh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.wh-label {
  font-size: 13px;
  color: var(--text-muted);
}
.wh-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.wh-comment {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* ── IPO Page ────────────────────────────────────────────────────────────── */
.ipo-day-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 3px 12px;
}
.ipo-day-open {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  font-weight: 700;
}
.ipo-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}
.ipo-card {
  margin-bottom: 16px;
}
.ipo-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ipo-sector-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 2px 10px;
}
.ipo-new-badge {
  font-size: 10px;
  font-weight: 800;
  background: rgba(245,158,11,0.2);
  color: #fbbf24;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 1px;
}
.ipo-company-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}
.ipo-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.ipo-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ipo-info-item {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.ipo-info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ipo-info-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.ipo-preview-note {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 4px;
}
.ipo-applied-badge {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #86efac;
  margin-top: 4px;
}
.ipo-apply-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}
.ipo-apply-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.ipo-apply-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.ipo-apply-label { color: var(--text-muted); }
.ipo-apply-value { font-weight: 600; color: var(--text-primary); }
.ipo-hints-select {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.ipo-warning {
  font-size: 12px;
  color: #f87171;
  margin: 8px 0;
}
.ipo-apply-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 15px;
}
.ipo-history-card h3 {
  font-size: 14px;
  color: var(--text-secondary);
}
.ipo-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.ipo-history-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}
.ipo-history-result {
  color: var(--text-muted);
  margin: 0 12px;
}
.ipo-history-return {
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}
/* 週末モーダル IPO結果 */
.weekend-ipo-result {
  margin-top: 4px;
}
.ipo-result-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ipo-result-body {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.ipo-result-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ipo-result-verdict {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ipo-result-detail {
  font-size: 12px;
  color: var(--text-muted);
}
.ipo-shares-input {
  background: var(--surface, var(--bg3));
  color: var(--text-primary, var(--text));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  width: 110px;
  text-align: right;
}
.ipo-shares-input:focus {
  outline: none;
  border-color: var(--blue);
}

/* ── Stock Detail View ───────────────────────────────────────────────────── */
.detail-chart-card { margin-bottom: 16px; }
.detail-price-row {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.detail-price { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-change { font-size: 15px; }
.detail-owned { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.detail-chart-container { height: 400px; position: relative; }
.detail-action-card { display: flex; gap: 12px; }
.detail-action-btn { flex: 1; padding: 12px; font-size: 15px; font-weight: 600; }

/* ── Skill Tree ── */
.skill-tree-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px; }
@media (max-width: 900px) { .skill-tree-container { grid-template-columns: 1fr; } }
.skill-tree-col { display: flex; flex-direction: column; gap: 12px; }
.skill-tree-title { font-size: 14px; font-weight: 700; padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; }
.skill-tree-title.trade { background: rgba(59,130,246,0.15); color: #3b82f6; }
.skill-tree-title.info  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.skill-tree-title.manip { background: rgba(239,68,68,0.15);  color: #ef4444; }
.skill-card { background: var(--glass); border: 1px solid var(--border); border-radius: 10px; padding: 12px; transition: all 0.2s; }
.skill-card.unlocked { border-color: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.2); }
.skill-card.locked { opacity: 0.5; }
.skill-card.available { border-color: #f59e0b; }
.skill-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.skill-name { font-weight: 700; font-size: 14px; }
.skill-status-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.skill-status-badge.unlocked { background: rgba(34,197,94,0.2); color: #22c55e; }
.skill-status-badge.available { background: rgba(245,158,11,0.2); color: #f59e0b; }
.skill-status-badge.locked { background: rgba(107,114,128,0.2); color: #6b7280; }
.skill-perk-desc { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; line-height: 1.4; }
.skill-unlock-cond { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.skill-cd { font-size: 11px; color: #f59e0b; margin-bottom: 6px; }
.skill-requires { font-size: 11px; color: var(--text-muted); font-style: italic; }
.skill-use-btn { font-size: 12px; padding: 4px 10px; }
