/*
 * 주식서바이벌 고대비 테마
 * 기존 레이아웃과 기능은 그대로 두고 색상, 글자 대비, 카드 구분만 보강합니다.
 */

:root {
  --contrast-navy: #0f1d31;
  --contrast-navy-deep: #081322;
  --contrast-navy-soft: #1d3049;
  --contrast-light: #f4f7fa;
  --contrast-card: #ffffff;
  --contrast-ink: #132238;
  --contrast-mint: #00c98b;
  --contrast-mint-dark: #008d64;
  --ui-bg: #0f1d31;
  --ui-bg-deep: #081322;
  --ui-surface: #17283f;
  --ui-surface-soft: #1d3049;
  --ui-surface-raised: #253b58;
  --ui-border: #4a6381;
  --ui-border-strong: #7890ab;
  --ui-text: #ffffff;
  --ui-muted: #d7e0eb;
  --ui-subtle: #b1c0d2;
  --ui-up: #ff4968;
  --ui-down: #52a3ff;
  --ui-gold: #ffc857;
  --ui-success: var(--contrast-mint);
  --ui-shadow-card: 0 14px 34px rgba(2, 9, 20, .25);
  --ui-shadow-float: 0 24px 64px rgba(2, 9, 20, .44);
}

html { background: var(--contrast-navy-deep); }

body {
  background:
    radial-gradient(circle at 12% 0, rgba(0, 201, 139, .10), transparent 34rem),
    var(--ui-bg);
}

::selection { background: var(--contrast-mint); color: #071a17; }

:where(button, a, input, select, textarea):focus-visible {
  outline-color: var(--contrast-mint);
  outline-offset: 3px;
}

input,
select,
textarea {
  border-color: var(--ui-border-strong);
  background: #0c192b;
  color: #fff;
}

input::placeholder,
textarea::placeholder { color: #b6c5d6; }

.section-kicker,
.eyebrow,
.rule-number {
  color: var(--ui-gold);
  font-size: .78rem;
  letter-spacing: .09em;
}

.button-primary {
  border-color: #52e0b4;
  background: linear-gradient(135deg, #10d99a, var(--contrast-mint-dark));
  color: #061a16;
  box-shadow: 0 12px 28px rgba(0, 201, 139, .25);
}

.button-secondary {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-raised);
  color: #fff;
}

.button:hover:not(:disabled) { filter: brightness(1.08); }
.button:disabled { opacity: .58; color: #d7e0eb; cursor: not-allowed; }

/* 메인: 게임 본편과 이어지는 단일 블루·네이비 팔레트를 사용합니다. */
.start-screen {
  gap: 18px;
  background:
    radial-gradient(circle at 78% 8%, rgba(0, 201, 139, .10), transparent 34rem),
    linear-gradient(180deg, #10243c 0, #081728 58%, #061221 100%);
}

.start-screen::before {
  opacity: .34;
  background-image:
    linear-gradient(rgba(171, 201, 230, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(171, 201, 230, .07) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
}

.start-card {
  padding: 48px 14px 16px;
  border: 1px solid #263d5b;
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 5%, rgba(0, 201, 139, .18), transparent 22rem),
    linear-gradient(145deg, #152844, #0c192b 74%);
  color: #fff;
  box-shadow: 0 28px 70px rgba(15, 29, 49, .22);
}

.hero-language {
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  border-color: #5a718e;
  background: #10233b;
}

.hero-language button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 8px;
  color: #dce6f1;
}
.hero-language button.is-active { background: var(--contrast-mint); color: #062019; }
.logo-mark, .brand-mark { background: linear-gradient(145deg, #ff4c69, #d71b42); }
.start-card .eyebrow {
  max-width: calc(100% - 88px);
  margin-bottom: 8px;
  font-size: .625rem;
  line-height: 1.35;
}
.logo-lockup { gap: 8px; }
.logo-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
.logo-mark svg { width: 24px; height: 24px; }
.logo-lockup h1 {
  color: #fff;
  font-size: clamp(2rem, 10vw, 3rem);
}
.start-card .hero-slogan {
  margin-top: 12px;
  color: #fff;
  font-size: clamp(1.05rem, 4.7vw, 1.3rem);
}
.logo-lockup h1 em { color: #ff4968; }
.start-card .start-copy { margin-top: 4px; color: #dce6f1; font-size: .8rem; line-height: 1.5; }

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.feature-grid article {
  min-height: 58px;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  justify-items: center;
  gap: 2px;
  padding: 6px 3px;
  text-align: center;
  border-color: #49617f;
  background: rgba(255, 255, 255, .075);
}

.feature-grid article > span { grid-row: auto; color: #4ee5b7; font-size: 1.05rem; }
.feature-grid b { color: #fff; font-size: .72rem; white-space: nowrap; }
.feature-grid small { display: none; color: #dce6f1; font-size: .8rem; }

.start-form,
.active-survivals {
  border-color: #45617f;
  background: #172b44;
  color: #fff;
  box-shadow: 0 16px 34px rgba(2, 9, 20, .34);
  backdrop-filter: none;
}

.start-form > label,
.start-form .profile-setup > label { color: #d7e0eb; font-size: .875rem; }

.start-form input,
.start-form select {
  border-color: #5c7692;
  background: #10243c;
  color: #fff;
}

.start-form input::placeholder { color: #aebed0; }

.profile-open-button,
.game-mode-buttons button {
  border-color: #536d89;
  background: #203852;
  color: #fff;
}

.profile-open-button small,
.profile-open-button i,
.game-mode-buttons small { color: #cbd8e6; }
.profile-open-button b { color: #fff; }

.game-mode-buttons button.is-active {
  border-color: var(--contrast-mint-dark);
  background: #174657;
  color: #fff;
  box-shadow: inset 4px 0 var(--contrast-mint-dark);
}

.join-form input { border-color: #5c7692; background: #10243c; color: #fff; }
.solo-text-link { color: #b9c8d8; }
.active-survivals > header { border-color: #45617f; }
.active-survivals h2 { color: #fff; }
.active-survivals header button { border-color: #5c7692; background: #203852; color: #fff; }

.active-survival-card,
.active-survival-empty {
  border-color: #45617f;
  background: #10243c;
  color: #fff;
}

.active-survival-empty p { color: #cbd8e6; font-size: .9rem; }
.start-meta, .service-disclaimer, .developer-email { color: #cbd7e4; font-size: .8rem; }
.developer-email a { color: #fff; }
.developer-board-button { border-color: #617895; background: #1b304b; color: #fff; }
.developer-board-button span { color: #54e2b6; }

.start-rules {
  border-color: #45617f;
  background: #172b44;
  color: #fff;
  box-shadow: 0 18px 46px rgba(2, 9, 20, .34);
  backdrop-filter: none;
}

.start-rules .section-kicker { color: #54e2b6; }
.start-rules > strong, .start-rules h3 { color: #fff; }
.start-rules > p { color: #d7e0eb; font-size: .94rem; line-height: 1.65; }
.start-rules .hall-of-fame { border-color: #45617f; }
.hall-row { color: #eef5fc; font-size: .75rem; border-color: rgba(150, 178, 207, .18); }
.hall-row b { color: #fff; }
.hall-row small { color: #d7e0eb; }

/* 로비와 매칭 */
.matchmaking-screen,
.lobby-screen {
  background:
    radial-gradient(circle at 50% 5%, rgba(0, 201, 139, .16), transparent 28rem),
    var(--contrast-navy);
}

.matchmaking-card,
.lobby-card {
  border-color: var(--ui-border-strong);
  background: linear-gradient(150deg, #243b58, #14253c);
}

.matching-spinner { border-color: #516984; border-top-color: var(--contrast-mint); }
.room-code { border-color: var(--contrast-mint); background: rgba(0, 201, 139, .12); }
.lobby-members { border-color: var(--ui-border-strong); background: #0f1e32; }

/* 게임: 패널 표면을 한 단계씩 분리해 정보 위계를 선명하게 합니다. */
.app-shell {
  background: linear-gradient(180deg, #0b1728, var(--contrast-navy) 28rem);
}

/* 이전 모바일 테마의 검정 본문색을 제거하고 앱 셸의 네이비 배경을 그대로 사용합니다. */
.game-layout { background: transparent; }

.battle-hud {
  border-color: #526b88;
  background: rgba(9, 22, 38, .97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .36);
}

.topbar { background: transparent; }

/* 로고 아이콘은 축소되지 않게 고정하고 긴 닉네임은 진행 막대 영역을 밀지 않습니다. */
.brand { min-width: 0; overflow: hidden; }
.brand-mark { flex: 0 0 40px; }
.brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand > span:last-child small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-status { overflow: hidden; }
.timer-wrap { width: 100%; }
.timer-line span, .turn-badge span, .turn-badge small { color: #d8e2ed; }
.progress-track { background: #4b617b; }
.progress-track > div { background: linear-gradient(90deg, var(--contrast-mint), #4e9fff); }

.game-room-code,
.icon-button { border-color: #607895; background: #1b304b; }
.game-room-code small { color: #66ecc4; }

.survival-status {
  min-height: 0;
  align-items: stretch;
}

.survival-status > div {
  min-height: 58px;
  border-color: #49627f;
  background: #162941;
}

.survival-status small { color: #c8d4e2; font-size: .72rem; }
.survival-status strong { color: #fff; font-size: .9rem; }

.panel,
.identity-card,
.battle-arena-panel {
  border-color: #49627f;
  background: linear-gradient(145deg, #203550, #15263d 72%);
  box-shadow: 0 16px 38px rgba(2, 9, 20, .30);
}

.panel-header {
  border-color: #48617e;
  background: rgba(255, 255, 255, .035);
}

.panel-header h2, .identity-card, .identity-card strong, .identity-card b { color: #fff; }
.identity-card small, .identity-card p { color: #d4dfeb; }

/* 프로필 배경 단축 속성이 밈 스프라이트를 지우지 않도록 이미지를 다시 지정합니다. */
.identity-card > .avatar.profile-image.meme {
  background-image: url("assets/stock-meme-avatars.png");
  background-repeat: no-repeat;
  background-size: 400% 300%;
}

.my-goal-panel { border-color: #506985; background: #12243a; }

.asset-total,
.portfolio-empty,
.holding-row,
.alternative-assets > div,
.battle-stepper i,
.battle-result,
.chart-card,
.market-intelligence,
.info-ticker,
.intelligence-row,
.order-summary,
.rank-row,
.log-row,
.global-chat-message,
.onboarding-steps li,
.stock-detail-character,
.rules-grid > div,
.modal-cost,
.holdings-modal-summary,
.notice-row,
.board-post,
.holdings-list .holding-row,
.elimination-stats > div,
.top-stock-card,
.player-history-summary,
.history-chart-grid > div {
  border-color: #49627f;
  background-color: #112239;
}

.asset-breakdown > div { border-color: #49627f; background: #192e48; }
.asset-breakdown span, .asset-breakdown small, .asset-footer, .portfolio-empty p, .holding-row small { color: #d4dfeb; }
.alternative-assets > div { border: 1px solid #526b88; }
.alternative-assets button { border-color: #617996; color: #fff; }

#portfolio-summary { color: #fff; font-size: .875rem; }
.portfolio-empty strong { color: #fff; font-size: 1rem; }
.portfolio-empty p { font-size: .875rem; }
.alternative-assets b { color: #fff; font-size: .875rem; }
.alternative-assets small { color: #d7e0eb; font-size: .75rem; }
.skill-hand > small { color: #d7e0eb; font-size: .8125rem; }

/* 좁은 3열 카드에서도 자산명과 증감 버튼이 같은 칸을 차지하지 않게 분리합니다. */
.alternative-assets > div {
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 2px 6px;
  min-height: 112px;
  padding: 8px;
  text-align: left;
}

.alternative-assets > div > .asset-icon {
  grid-column: 1;
  grid-row: 1;
  width: 24px;
  height: 24px;
}

.alternative-assets > div > b {
  grid-column: 2;
  grid-row: 1;
  display: block;
  margin: 0;
  overflow: hidden;
  font-size: .8125rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alternative-assets > div > small {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alternative-assets > div > i {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 4px;
}

.alternative-assets > div > i button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

/* 자산과 스킬은 형태와 색을 모두 달리해 작은 화면에서도 즉시 구분합니다. */
.asset-icon,
.skill-icon,
.nav-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-icon { width: 28px; height: 28px; }
.asset-icon-gold { color: #ffc857 !important; }
.asset-icon-copper { color: #e98d52 !important; }
.asset-icon-coin { color: #8b9cff !important; }

.skill-icon { width: 22px; height: 22px; margin: 0 auto 4px; }
.skill-icon-tax-audit { color: #54e2b6; }
.skill-icon-short-sell { color: #ff6680; }
.skill-icon-inside-info { color: #68aaff; }
.skill-icon-default { color: #ffc857; }

.nav-icon { width: 25px; height: 25px; }
.nav-icon-home { color: #54e2b6; }
.nav-icon-market { color: #ffc857; }
.nav-icon-trade { color: #68aaff; }
.nav-icon-ranking { color: #ff6680; }
.nav-icon-logs { color: #b99cff; }
.game-bottom-nav button.is-active .nav-icon,
.game-bottom-nav button[aria-current="page"] .nav-icon { color: #062019; }

.sector-market-panel, .survival-intelligence { border-color: #4e6784; }
.sector-toolbar, .sector-search { border-color: #4e6784; background: #192d46; }
.sector-search input { background: #0e1d31; }

.sector-card {
  border-color: #617996;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
}

/* CEO 이미지는 가로 3칸 스프라이트이므로 현재 감정 프레임 한 칸만 채웁니다. */
.stock-row.sector-card > .sector-ceo {
  background-repeat: no-repeat;
  background-size: 300% 100%;
}

.stock-row.sector-card > .sector-ceo.ceo-technology {
  background-size: 300% auto;
}

.stock-detail-character > .sector-ceo {
  background-repeat: no-repeat;
  background-size: 300% 100%;
}

.stock-detail-character > .sector-ceo.ceo-technology {
  background-size: 300% auto;
}

.sector-card::after { background: linear-gradient(180deg, rgba(4, 10, 20, .03), rgba(4, 10, 20, .92) 78%); }
.sector-card :where(h2, h3, strong, b) { text-shadow: 0 2px 8px rgba(0, 0, 0, .9); }
.sector-card :where(p, small, span) { color: #f1f5f9; }

.survival-intelligence { background: #172b44; }
.intelligence-row { border-bottom-color: #4a6380; }
.intelligence-row :where(span, small, p) { color: #d9e3ee; }
.intelligence-row strong { color: #fff; }
.order-tabs button { color: #c5d2df; }
.order-tabs button.is-active { color: #fff; }
.order-quantity input { border-color: #657d98; }

.game-bottom-actions { background: linear-gradient(180deg, transparent, rgba(8, 19, 34, .98) 30%); }

.game-bottom-nav {
  border-color: #425b78;
  background: rgba(10, 23, 40, .98);
}

.game-bottom-nav button { color: #b9c8d8; }
.game-bottom-nav button > small { color: inherit; font-size: .75rem; }
.game-bottom-nav button.is-active,
.game-bottom-nav button[aria-current="page"] { background: var(--contrast-mint); color: #062019; }

.rank-row { border-bottom-color: #465f7c; }
.rank-person small, .rank-move, .log-row, .log-row time { color: #c8d5e3; }
.rank-assets { color: #fff; font-size: .84rem; }

/* 채팅, 모달, 바텀시트 */
.global-chat-sheet, .modal-backdrop { background: rgba(3, 10, 20, .82); }

/* 구형 bottom 좌표가 남아 알림 영역 전체가 늘어나지 않도록 위치 축을 초기화합니다. */
.toast-region {
  right: auto;
  bottom: auto;
  width: min(calc(100% - 24px), 380px);
  align-items: start;
}

.toast {
  width: 100%;
  max-width: 100%;
  height: auto;
  padding: 10px 12px;
  border: 1px solid rgba(147, 167, 189, .7);
  border-left-width: 4px;
  background: #172b44;
  color: #fff;
  line-height: 1.45;
}

.toast.error {
  border-color: #ff4968;
  background: #9f1831;
  color: #fff;
}

.global-chat,
.modal,
.sheet-card {
  border-color: #7690ad;
  background: linear-gradient(165deg, #263d5b, #17283f 72%);
}

.global-chat-header, .global-chat-compose, .message-compose { border-color: #526b88; }
.global-chat-message { background: #102138; }
.global-chat-message.mine, .message-bubble.mine { background: #087fbd; }
.global-chat-message span, .message-bubble { color: #fff; }
.modal::before, .sheet-card::before { background: #93a7bd; }
.modal-close { border-color: #6e86a1; background: #203651; }
.modal > p, .modal :where(small, .data-note, .holdings-helper) { color: #d5e0eb; }
.profile-upload-button { border-color: #7890ab; background: #13253c; color: #e0e8f1; }
.message-thread, .message-contact { border-color: #506986; background: #112239; }
.message-contact.is-active { border-color: var(--contrast-mint); background: rgba(0, 201, 139, .12); }

.toast,
.leader-announcement {
  border: 1px solid #88a0b9;
  background: #172b44;
  color: #fff;
  box-shadow: var(--ui-shadow-float);
}

/* 모바일에서 작은 라벨도 읽을 수 있는 최소 크기를 보장합니다. */
.game-room-code small,
.rank-person small,
.rank-person em,
.rank-move,
.log-row time,
.message-contact small,
.message-bubble small,
.global-chat-message time { font-size: .68rem; }

/* 모바일 종목 상세창: CEO 카드부터 주문까지 한 화면 흐름으로 읽히게 압축합니다. */
@media (max-width: 767px) {
  .modal-backdrop:has(.stock-detail-modal-card) { align-items: flex-start; padding: 0; }

  .stock-detail-modal-card {
    width: 100%;
    max-height: 100dvh;
    padding: 10px;
    padding-bottom: 9px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0;
  }

  .stock-detail-modal-card > .modal-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .stock-detail-character {
    min-height: 96px;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
    margin-top: 0;
    overflow: hidden;
    border-radius: 14px;
  }

  .stock-detail-character > .sector-ceo {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    width: 80px;
    height: 96px;
    min-height: 96px;
    align-self: stretch;
    border-radius: 0;
    background-repeat: no-repeat;
    background-size: 300% 100%;
    transform: none;
  }

  .stock-detail-character-copy {
    min-width: 0;
    padding: 6px 44px 4px 0;
  }

  .stock-detail-character-copy .section-kicker {
    display: block;
    overflow: hidden;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stock-detail-character-copy h2 {
    overflow: hidden;
    margin: 3px 0;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stock-detail-character-copy p {
    min-height: 15px;
    font-size: .72rem;
    line-height: 1.35;
    -webkit-line-clamp: 1;
  }

  .stock-detail-actions { gap: 5px; margin-top: 4px; }
  .stock-detail-actions button { min-height: 32px; padding: 0 8px; font-size: .74rem; }

  .stock-detail-sector-switcher {
    margin-top: 6px;
    padding: 6px;
    border-radius: 12px;
  }

  .stock-detail-sector-switcher > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .stock-detail-sector-switcher > div:first-child .section-kicker { font-size: .64rem; }
  .stock-detail-sector-switcher > div:first-child strong { font-size: .78rem; }
  .stock-detail-sector-switcher > div:first-child small { display: none; }
  .stock-detail-sector-list { gap: 5px; margin-top: 4px; }

  .stock-detail-sector-list button {
    height: 34px;
    min-height: 34px;
    max-width: 132px;
    padding: 0 9px;
    overflow: hidden;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stock-detail-sector-list button b,
  .stock-detail-sector-list button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stock-detail-sector-list button small { display: none; }

  .stock-detail-body { gap: 8px; margin-top: 4px; }
  .stock-detail-body .chart-panel,
  .stock-detail-body .trade-panel { border-radius: 14px; }

  .stock-detail-body .chart-header { min-height: 58px; gap: 8px; padding: 8px 10px; }
  .stock-detail-body .selected-stock-icon { flex-basis: 36px; width: 36px; height: 36px; font-size: 1rem; }
  .stock-detail-body .stock-title { gap: 8px; }
  .stock-detail-body .stock-title span:not(.flag) { font-size: .62rem; }
  .stock-detail-body .stock-title h2 { margin-top: 2px; font-size: 1rem; }
  .stock-detail-body .quote strong { font-size: 1.15rem; }
  .stock-detail-body .quote span { font-size: .68rem; }

  .stock-detail-body .selected-position-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-radius: 0;
  }

  .stock-detail-body .selected-position-grid > div { min-height: 44px; padding: 5px 6px; }
  .stock-detail-body .selected-position-grid small { font-size: .58rem; white-space: nowrap; }
  .stock-detail-body .selected-position-grid strong {
    margin-top: 2px;
    overflow: hidden;
    font-size: .68rem;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stock-detail-body .chart-meta { min-height: 38px; padding: 3px 8px; }
  .stock-detail-body .chart-meta > span:first-child { display: none; }
  .stock-detail-body .chart-controls { width: 100%; flex-wrap: nowrap; justify-content: flex-end; }
  .stock-detail-body .chart-type-toggle button { min-height: 34px; padding: 0 8px; font-size: .64rem; }
  .stock-detail-body .turn-marker { font-size: .62rem; }
  .stock-detail-body .volume-alert { max-width: 82px; overflow: hidden; font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
  .stock-detail-body .chart-wrap { height: 120px; min-height: 120px; margin: 0 8px; }
  .stock-detail-body .chart-stats { min-height: 42px; margin-top: 8px; padding: 0; }
  .stock-detail-body .chart-stats span { min-height: 42px; padding: 3px; font-size: .54rem; }
  .stock-detail-body .chart-stats b { font-size: .62rem; }

  .stock-detail-body .tabs { min-height: 42px; padding: 0 4px; }
  .stock-detail-body .tab { min-height: 40px; padding: 0 8px; font-size: .72rem; }
  .stock-detail-body .tab-content { padding: 8px; }
  .stock-detail-body .trade-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .stock-detail-body .side-toggle { min-height: 40px; padding: 2px; }
  .stock-detail-body .side-toggle button,
  .stock-detail-body .trade-grid input { min-height: 38px; height: 38px; }
  .stock-detail-body .trade-grid > label { min-width: 0; font-size: .68rem; }
  .stock-detail-body .input-suffix { margin-top: 2px; }
  .stock-detail-body .quick-amounts,
  .stock-detail-body .order-summary,
  .stock-detail-body .trade-submit,
  .stock-detail-body .holdings-mini { grid-column: 1 / -1; }
  .stock-detail-body .quick-amounts button { min-height: 36px; font-size: .68rem; }
  .stock-detail-body .order-summary { min-height: 40px; padding: 7px 9px; }
  .stock-detail-body .order-summary span,
  .stock-detail-body .order-summary strong { font-size: .72rem; }
  .stock-detail-body .trade-submit { min-height: 42px; font-size: .8rem; }
  .stock-detail-body .emergency-sell-button { display: none; }
  .stock-detail-body .holdings-mini {
    min-height: 28px;
    height: 28px;
    padding: 4px 0 0;
    overflow: hidden;
    flex-wrap: nowrap;
    font-size: .62rem;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .start-screen { padding: 40px 28px; }
  .start-card { padding: 72px 28px 28px; }
  .hero-language { top: 16px; right: 16px; }
  .start-card .eyebrow { max-width: none; margin-bottom: 14px; font-size: .78rem; }
  .logo-lockup { gap: 14px; }
  .logo-mark { width: 52px; height: 52px; flex-basis: 52px; border-radius: 14px; }
  .logo-mark svg { width: 30px; height: 30px; }
  .logo-lockup h1 { font-size: clamp(2.75rem, 7vw, 4.25rem); }
  .start-card .hero-slogan { margin-top: 20px; font-size: clamp(1.45rem, 3vw, 2rem); }
  .start-card .start-copy { margin-top: 8px; font-size: 1rem; line-height: 1.65; }
  .start-form { padding: 22px; }
  .feature-grid { gap: 12px; }
  .feature-grid article {
    min-height: 104px;
    grid-template-columns: 38px 1fr;
    grid-template-rows: auto auto;
    justify-items: start;
    gap: 4px 10px;
    padding: 16px;
    text-align: left;
  }
  .feature-grid article > span { grid-row: 1 / 3; font-size: inherit; }
  .feature-grid b { font-size: 1rem; }
  .feature-grid small { display: block; }
  .panel-header { padding: 18px 20px; }
}

@media (min-width: 1180px) {
  .start-screen { gap: 30px; padding: 56px 48px; }
  .start-card { padding: 78px 32px 32px; }
  .start-rules { margin-top: 64px; padding: 28px; }
  .battle-hud { padding-left: 104px; }
  .topbar {
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto;
    column-gap: 18px;
  }
  .brand { width: auto; }
  .survival-status {
    grid-template-columns: repeat(6, minmax(132px, 1fr));
    min-height: 0;
  }
  .survival-status > div {
    min-height: 62px;
    padding: 9px 12px;
  }
  .game-bottom-nav {
    align-content: start;
    padding-top: 84px;
  }
  #tab-home .identity-card {
    position: sticky;
    z-index: 65;
    top: 142px;
    background: linear-gradient(145deg, #263d5b, #17283f 74%);
  }
  .game-bottom-nav button.is-active,
  .game-bottom-nav button[aria-current="page"] { box-shadow: inset 4px 0 #78f0ca; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .game-bottom-nav button { transition: none; }
}
