:root {
  --font-game: 'Jua', 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  --ink: #090b25;
  --ink-2: #101337;
  --panel: rgba(19, 20, 57, .86);
  --panel-solid: #15163f;
  --line: rgba(134, 145, 255, .24);
  --line-strong: rgba(174, 181, 255, .48);
  --text: #f5f5ff;
  --muted: #a5a8d0;
  --yellow: #ffd83d;
  --yellow-2: #ffb838;
  --cyan: #4de8f4;
  --pink: #fb5982;
  --green: #7ef5a2;
  --shadow: 0 18px 50px rgba(3, 5, 23, .45);
}

* { box-sizing: border-box; }

html { background: var(--ink); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-game);
  background:
    radial-gradient(circle at 78% 3%, rgba(91, 80, 194, .25), transparent 28rem),
    radial-gradient(circle at 12% 30%, rgba(31, 143, 166, .12), transparent 25rem),
    linear-gradient(rgba(99, 100, 182, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 100, 182, .055) 1px, transparent 1px),
    var(--ink);
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
  min-height: 100vh;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.24) .6px, transparent .7px);
  background-size: 6px 6px;
  mix-blend-mode: soft-light;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(155, 159, 255, .16);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--ink); font-size: 23px; font-weight: 800;
  background: var(--yellow); border: 2px solid #fff28b;
  box-shadow: 4px 4px 0 #5446a7, 0 0 25px rgba(255,216,61,.28);
  transform: rotate(-5deg);
}
.brand-name { font-family: 'Black Han Sans', sans-serif; font-size: 26px; letter-spacing: -.08em; }
.brand-name span { color: var(--yellow); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.mini-status { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.mini-status i { width: 7px; height: 7px; display: block; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.header-button, .tool-button {
  border: 1px solid var(--line-strong); color: var(--muted); background: rgba(15, 16, 47, .75);
  cursor: pointer; transition: .18s ease; }
.header-button { padding: 9px 15px; font-size: 12px; }
.header-button:hover, .tool-button:hover { color: var(--text); border-color: var(--cyan); background: rgba(58, 117, 169, .25); }

.breadcrumb { display: flex; align-items: center; gap: 12px; margin: 42px 0 28px; color: #8c90c1; font: 500 12px 'IBM Plex Mono', monospace; }
.breadcrumb a { transition: color .18s ease; }
.breadcrumb a:hover { color: var(--yellow); }
.breadcrumb strong { color: var(--yellow); font-weight: 500; }

.hero-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow, .panel-kicker { margin: 0 0 12px; color: var(--cyan); font: 700 10px 'IBM Plex Mono', monospace; letter-spacing: .22em; }
.eyebrow span { display: inline-block; width: 18px; height: 2px; margin: 0 8px 3px 0; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-family: 'Black Han Sans', sans-serif; font-size: clamp(39px, 5vw, 66px); line-height: .98; letter-spacing: -.08em; text-shadow: 4px 4px 0 rgba(65, 48, 126, .7); }
h1 em { color: var(--yellow); font-style: normal; margin-left: 10px; text-shadow: 4px 4px 0 #a34050; }
.hero-copy { margin: 17px 0 0; color: var(--muted); font-size: 14px; }
.hero-badge { display: flex; align-items: center; gap: 11px; min-width: 206px; padding: 13px 15px; border: 1px solid rgba(255,216,61,.34); background: linear-gradient(135deg, rgba(74,59,138,.64), rgba(26,27,68,.8)); box-shadow: 5px 5px 0 rgba(8, 9, 37, .45); }
.badge-icon { color: var(--yellow); font-size: 24px; text-shadow: 0 0 16px rgba(255,216,61,.8); }
.hero-badge b, .hero-badge small { display: block; }
.hero-badge b { color: var(--yellow); font-size: 11px; }
.hero-badge small { margin-top: 2px; color: var(--text); font-size: 12px; }

.game-layout { display: grid; grid-template-columns: 294px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.panel-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(28, 28, 73, .91), rgba(12, 14, 42, .92)); box-shadow: var(--shadow); }
.character-panel { padding: 20px 18px 17px; }
.selection-steps { display: flex; align-items: center; gap: 7px; margin-bottom: 21px; color: #686da3; font: 700 9px 'IBM Plex Mono', monospace; }
.selection-steps span { white-space: nowrap; }
.selection-steps span.is-active { color: var(--yellow); }
.selection-steps b { margin-right: 3px; font-weight: 700; }
.selection-steps i { width: 14px; height: 1px; display: block; background: rgba(140, 147, 255, .3); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title-row h2, .how-to h2 { margin: 0; font-family: 'Black Han Sans', sans-serif; font-size: 25px; letter-spacing: -.06em; }
.selected-chip { display: grid; place-items: center; width: 30px; height: 25px; color: var(--ink); background: var(--yellow); font: 700 11px 'IBM Plex Mono', monospace; }
.panel-description { margin: 8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.dino-list { display: grid; gap: 9px; }
.dino-card { position: relative; width: 100%; min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 7px 9px; color: var(--text); text-align: left; border: 1px solid rgba(140, 147, 255, .16); background: rgba(11, 13, 39, .58); cursor: pointer; transition: .2s ease; }
.dino-card:hover { border-color: rgba(77, 232, 244, .65); background: rgba(31, 45, 80, .7); transform: translateX(2px); }
.dino-card.is-selected { border-color: var(--yellow); background: linear-gradient(135deg, rgba(65, 55, 126, .85), rgba(22, 28, 69, .9)); box-shadow: inset 3px 0 0 var(--yellow); }
.dino-card.is-selected::after { content: '✓'; position: absolute; top: 6px; right: 8px; color: var(--yellow); font: 700 11px 'IBM Plex Mono', monospace; }
.dino-preview { position: relative; display: block; width: 55px; height: 48px; min-height: 0; overflow: hidden; flex: 0 0 auto; background: linear-gradient(135deg, #232a64, #121634); border: 1px solid rgba(255,255,255,.1); }
.dino-meta { min-width: 0; display: block; }
.dino-meta b, .dino-meta small { display: block; }
.dino-meta b { font-size: 13px; }
.dino-meta small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.card-index { align-self: start; margin-left: auto; color: #787cac; font: 500 10px 'IBM Plex Mono', monospace; }
.selection-section + .selection-section { margin-top: 19px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.section-heading h3 { margin: 0; color: #dfe2ff; font-size: 11px; }
.section-heading > span { color: var(--yellow); font: 600 9px 'IBM Plex Mono', monospace; }
.map-list { display: grid; gap: 6px; }
.map-card { width: 100%; min-height: 51px; display: flex; align-items: center; gap: 8px; padding: 5px 7px; color: var(--text); text-align: left; border: 1px solid rgba(140, 147, 255, .16); background: rgba(11, 13, 39, .58); cursor: pointer; transition: .2s ease; }
.map-card:hover { border-color: rgba(77, 232, 244, .65); background: rgba(31, 45, 80, .7); transform: translateX(2px); }
.map-card.is-selected { border-color: var(--yellow); background: linear-gradient(135deg, rgba(65, 55, 126, .85), rgba(22, 28, 69, .9)); box-shadow: inset 3px 0 0 var(--yellow); }
.map-card > span:last-child { min-width: 0; }
.map-card strong, .map-card small { display: block; }
.map-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.map-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.map-preview { position: relative; width: 60px; height: 38px; overflow: hidden; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.12); background: #20386b; }
.map-preview::before { content: ''; position: absolute; left: 23px; top: -5px; width: 22px; height: 54px; background: #151a3a; transform: skew(-11deg); box-shadow: -4px 0 0 rgba(108, 240, 237, .65), 18px 0 0 rgba(108, 240, 237, .18); }
.map-preview::after { content: ''; position: absolute; left: 34px; top: 4px; width: 2px; height: 8px; background: var(--yellow); box-shadow: 0 12px 0 var(--yellow), 0 24px 0 var(--yellow); }
.map-preview i { position: absolute; z-index: 1; left: 5px; bottom: 8px; width: 8px; height: 16px; background: #42c7cf; box-shadow: 11px -7px 0 #ff80ba, 20px 1px 0 #ffc353; }
.map-preview b { position: absolute; z-index: 2; top: 3px; right: 4px; color: rgba(255,255,255,.8); font: 700 8px 'IBM Plex Mono', monospace; }
.map-canyon { background: linear-gradient(180deg, #e88464 0, #6a2c52 54%, #352044 55%); }
.map-canyon::before { background: #321b35; box-shadow: -4px 0 0 #ff9966, 18px 0 0 #9a4b53; }
.map-canyon i { background: #b84c45; box-shadow: 11px -8px 0 #e27b58, 20px 1px 0 #f7c15a; }
.map-ice { background: linear-gradient(180deg, #9defff 0, #416ea2 58%, #24325d 59%); }
.map-ice::before { background: #162549; box-shadow: -4px 0 0 #d4ffff, 18px 0 0 #6ddce8; }
.map-ice i { background: #b9ffff; box-shadow: 11px -8px 0 #77c7f2, 20px 1px 0 #dcf4ff; }
.map-classic2d { background: #ffffff url('./assets/map-concepts/map-classic-2d-preview.png') center / cover no-repeat; }
.map-classic2d::before, .map-classic2d::after { content: none; }
.map-classic2d i { left: 13%; bottom: 8px; width: 7px; height: 11px; background: #42464d; box-shadow: 6px -5px 0 #42464d, 11px 1px 0 #42464d; }
.map-classic2d b { color: #42464d; }
.map-card[data-map="classic2d"] .map-meta small b { color: #f7f7f7; background: #555a64; }
.selection-summary { display: flex; align-items: center; gap: 7px; margin-top: 17px; padding: 9px 10px; color: #dfe8ff; border: 1px solid rgba(77, 232, 244, .25); background: rgba(41, 108, 129, .14); font-size: 10px; }
.summary-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.selection-summary small { margin-left: auto; color: var(--cyan); font-size: 8px; white-space: nowrap; }
.menu-start-button { width: 100%; margin-top: 9px; padding: 11px 13px; color: var(--ink); border: 1px solid #fff09a; background: linear-gradient(180deg, #ffe867, #ffc82f); box-shadow: 3px 3px 0 #7e416d; cursor: pointer; font-weight: 800; font-size: 11px; transition: .16s ease; }
.menu-start-button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #7e416d, 0 0 20px rgba(255,216,61,.28); }
.menu-start-button span { margin-right: 5px; }
.stat-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.stat-box div { padding: 10px; background: rgba(6, 8, 29, .44); border: 1px solid rgba(130, 138, 225, .12); }
.stat-box span, .stat-box strong { display: block; }
.stat-box span { color: var(--muted); font-size: 9px; }
.stat-box strong { margin-top: 6px; color: var(--yellow); font: 700 18px 'IBM Plex Mono', monospace; }
.tip-box { display: flex; align-items: start; gap: 8px; margin-top: 13px; padding: 10px; border-left: 2px solid var(--cyan); background: rgba(44, 122, 144, .13); }
.tip-box span { color: var(--cyan); }
.tip-box p { margin: 0; color: #bdc7ed; font-size: 10px; line-height: 1.5; }

.map-list, .ranking-map-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.game-panel { min-width: 0; padding: 13px 13px 12px; }
.game-toolbar { min-height: 62px; display: flex; align-items: center; gap: 8px; padding: 0 5px 12px; }
.score-block { min-width: 73px; padding: 7px 11px 6px; border-left: 2px solid var(--cyan); background: rgba(7, 9, 31, .52); }
.score-block:nth-child(2) { border-color: var(--yellow); }
.score-block:nth-child(3) { border-color: var(--pink); }
.score-block span { display: block; color: var(--muted); font-size: 9px; }
.score-block strong { display: block; margin-top: 1px; color: var(--text); font: 700 19px 'IBM Plex Mono', monospace; letter-spacing: -.06em; }
.score-block small { margin-left: 3px; color: var(--yellow); font-size: 10px; }
.score-coin strong { color: var(--yellow); }
.toolbar-spacer { flex: 1; }
.speed-readout { display: inline-flex; align-items: center; gap: 6px; padding: 8px 9px; color: var(--muted); font: 600 10px 'IBM Plex Mono', monospace; }
.speed-readout i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.tool-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; font-weight: 700; font-size: 14px; }
.pause-button { color: var(--cyan); border-color: rgba(77, 232, 244, .55); background: rgba(21, 50, 77, .72); font-family: Arial, sans-serif !important; font-size: 18px; line-height: 1; }
.pause-button:hover { color: var(--ink); border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 14px rgba(77, 232, 244, .35); }
.tool-button:disabled { opacity: .34; cursor: not-allowed; }
.pause-button:disabled { color: #8b94bb; border-color: rgba(139, 148, 187, .36); background: rgba(21, 25, 62, .54); }
.tool-button.restart { color: var(--yellow); font-size: 19px; }
.canvas-wrap { position: relative; overflow: hidden; isolation: isolate; border: 2px solid #252862; background: #12214f; box-shadow: 0 0 0 1px rgba(255,255,255,.08), inset 0 0 30px rgba(0,0,0,.45); }
#gameCanvas { width: 100%; height: auto; display: block; image-rendering: auto; touch-action: none; }
.scanlines { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .09; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(8, 6, 25, .78) 4px); mix-blend-mode: multiply; }
.game-overlay { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6, 8, 31, .23); transition: opacity .25s ease; }
.game-overlay.is-hidden { opacity: 0; pointer-events: none; }
.overlay-card { width: min(390px, 92%); padding: 29px 30px 24px; text-align: center; border: 1px solid rgba(242, 229, 255, .48); background: linear-gradient(145deg, rgba(34, 29, 86, .95), rgba(12, 17, 48, .96)); box-shadow: 8px 8px 0 rgba(9, 8, 33, .68), 0 0 36px rgba(70, 71, 181, .33); }
.overlay-card.compact { width: min(350px, 92%); }
.overlay-tag { color: var(--cyan); font: 700 10px 'IBM Plex Mono', monospace; letter-spacing: .22em; }
.overlay-tag.danger { color: var(--pink); }
.overlay-card h2 { margin: 13px 0 8px; font-family: 'Black Han Sans', sans-serif; font-size: 42px; letter-spacing: -.08em; }
.overlay-card h2 span { color: var(--yellow); }
.overlay-card p { margin: 0 0 20px; color: #bfc4ea; font-size: 12px; line-height: 1.7; }
.overlay-card p b { color: var(--yellow); font-weight: 700; }
.overlay-selection { display: inline-flex; align-items: center; gap: 7px; margin: -4px 0 19px; padding: 6px 9px; color: #bfc4ea; border: 1px solid rgba(77, 232, 244, .24); background: rgba(44, 122, 144, .13); font: 500 9px 'IBM Plex Mono', monospace; }
.overlay-selection span:first-child { padding: 3px 5px; color: var(--ink); background: var(--cyan); font-weight: 800; }
.start-button { min-width: 194px; padding: 14px 20px; color: var(--ink); border: 2px solid #fff09a; background: linear-gradient(180deg, #ffe867, #ffc82f); box-shadow: 4px 4px 0 #7e416d; cursor: pointer; font-weight: 800; font-size: 13px; transition: .16s ease; }
.start-button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 #7e416d, 0 0 20px rgba(255,216,61,.35); }
.start-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #7e416d; }
.start-button span { margin-right: 6px; }
.quick-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; color: #8d93bf; font: 500 9px 'IBM Plex Mono', monospace; }
.result-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 21px; border-block: 1px solid var(--line); }
.result-row > div { padding: 12px; }
.result-row > div + div { border-left: 1px solid var(--line); }
.result-row small, .result-row strong { display: block; }
.result-row small { color: var(--muted); font-size: 10px; }
.result-row strong { margin-top: 4px; color: var(--yellow); font: 700 24px 'IBM Plex Mono', monospace; }
.result-row .result-rank-value { margin-top: 9px; color: var(--cyan); font: 700 17px 'IBM Plex Mono', monospace; white-space: nowrap; }
.result-row i { margin-left: 2px; color: var(--muted); font-size: 11px; font-style: normal; }
.gameover-ranking-button { width: min(194px, 100%); height: 48px; min-height: 48px; display: block; margin: 10px auto 0; padding: 14px 20px; color: #e4eaff; border: 2px solid rgba(161, 181, 239, .32); border-radius: 4px; background: rgba(73, 91, 145, .78); cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; line-height: 16px; transition: .16s ease; }
.gameover-ranking-button:hover { color: #fff; border-color: rgba(115, 221, 255, .72); background: rgba(61, 113, 181, .9); box-shadow: 0 0 16px rgba(75, 197, 255, .2); }
.gameover-ranking-button:active { transform: translateY(1px); }
.gameover-ad, .ranking-ad { width: 100%; min-height: 90px; margin-top: 10px; overflow: hidden; }
.gameover-ad .portal-ranking-ad, .ranking-ad .portal-ranking-ad { min-height: 90px; margin: 0; padding: 8px 0; }
#gameoverOverlay { display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; }
#gameoverOverlay .overlay-card { flex: 0 0 auto; margin: 20px auto; }
.toast { position: absolute; z-index: 4; left: 50%; bottom: 20px; padding: 8px 14px; color: var(--ink); background: var(--yellow); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); font: 700 11px 'IBM Plex Mono', monospace; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.game-hint { padding-top: 13px; color: #9296c3; text-align: center; font: 500 10px 'IBM Plex Mono', monospace; }
.key-hint { display: inline-block; padding: 3px 6px; color: var(--text); border: 1px solid rgba(170, 177, 255, .35); background: rgba(41, 42, 94, .55); font-size: 9px; }
.dot { margin: 0 6px; color: var(--yellow); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.info-card { display: flex; align-items: flex-start; gap: 13px; padding: 18px; }
.info-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); background: var(--yellow); font-size: 17px; box-shadow: 3px 3px 0 rgba(55, 38, 105, .7); }
.info-icon.sun { color: var(--ink); background: var(--cyan); }
.info-icon.coin { color: var(--ink); background: var(--pink); }
.info-card h3 { margin: 1px 0 6px; font-size: 13px; }
.info-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.how-to { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 21px 24px; }
.how-to .panel-kicker { margin-bottom: 5px; }
.control-guide { display: flex; align-items: center; gap: 28px; }
.control-guide > div { display: flex; align-items: center; gap: 10px; }
.key, .key-group b { width: 27px; height: 27px; display: inline-grid; place-items: center; color: var(--text); border: 1px solid rgba(185, 190, 255, .44); background: rgba(45, 47, 103, .8); font: 700 14px 'IBM Plex Mono', monospace; box-shadow: 2px 2px 0 rgba(3, 4, 22, .38); }
.key-group { display: flex; gap: 3px; }
.control-guide strong, .control-guide small { display: block; }
.control-guide strong { font-size: 11px; }
.control-guide small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 36px; color: #7075a5; font: 500 10px 'IBM Plex Mono', monospace; }

@media (max-width: 960px) {
  .site-shell { width: min(100% - 28px, 720px); }
  .hero-heading { align-items: start; flex-direction: column; }
  .hero-badge { align-self: stretch; min-width: 0; }
  .game-layout { grid-template-columns: 1fr; }
  .character-panel { padding: 18px; }
  .dino-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dino-card { min-height: 104px; display: block; padding: 8px; }
  .dino-preview { width: 100%; height: 54px; margin-bottom: 8px; }
  .dino-meta b { font-size: 11px; }
  .card-index { position: absolute; top: 7px; right: 8px; }
  .dino-preview::before { left: 32%; }
  .dino-preview::after { left: 33%; }
  .dino-eye { left: calc(50% - 2px); }
  .dino-horn { left: calc(50% - 6px); }
  .map-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-card { display: block; min-height: 91px; padding: 7px; }
  .map-preview { width: 100%; height: 46px; margin-bottom: 7px; }
  .map-card strong { font-size: 10px; }
  .map-card small { font-size: 8px; }
  .stat-box, .tip-box { display: none; }
  .how-to { align-items: flex-start; flex-direction: column; }
  .control-guide { width: 100%; justify-content: space-between; gap: 10px; }
}

@media (max-width: 620px) {
  .site-shell { width: min(100% - 20px, 520px); }
  .site-header { min-height: 70px; }
  .brand-name { font-size: 21px; }
  .brand-mark { width: 30px; height: 30px; font-size: 18px; }
  .mini-status { display: none; }
  .breadcrumb { margin: 25px 0 21px; }
  h1 { font-size: 42px; }
  .hero-copy { font-size: 12px; }
  .game-panel { padding: 8px 8px 11px; }
  .game-toolbar { min-height: 53px; gap: 4px; padding: 0 1px 9px; }
  .score-block { min-width: 0; padding: 5px 7px; }
  .score-block span { font-size: 8px; }
  .score-block strong { font-size: 15px; }
  .speed-readout { display: none; }
  .tool-button { width: 30px; height: 30px; }
  .dino-list { gap: 6px; }
  .dino-card { min-height: 91px; padding: 5px; }
  .dino-preview { height: 45px; margin-bottom: 5px; }
  .dino-meta b { font-size: 10px; }
  .dino-meta small { font-size: 8px; }
  .dino-preview::before { left: 31%; }
  .dino-preview::after { left: 33%; }
  .dino-eye { left: calc(50% - 2px); }
  .dino-horn { left: calc(50% - 6px); }
  .map-list { gap: 5px; }
  .map-card { min-height: 88px; padding: 5px; }
  .map-preview { height: 42px; margin-bottom: 5px; }
  .map-card strong { font-size: 9px; }
  .map-card small { font-size: 7px; }
  .selection-summary small { display: none; }
  .info-grid { grid-template-columns: 1fr; gap: 9px; }
  .info-card { padding: 13px; }
  .how-to { padding: 18px 15px; }
  .control-guide { display: grid; grid-template-columns: 1fr 1fr; }
  .control-guide > div { min-width: 0; }
  .control-guide small { line-height: 1.35; }
  .game-hint { display: none; }
  .site-footer { display: block; padding: 22px 0 29px; line-height: 1.8; }
  .site-footer span { display: block; }
  .site-footer span + span { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* 시작 화면은 반짝 범퍼볼처럼 모바일 폭을 기준으로 구성합니다. */
body { overflow-x: hidden; background: #dbe8f5; }
body::before { display: none; }
.site-shell { width: min(520px, 100%); min-height: 100dvh; padding: 0 18px; background: linear-gradient(180deg, #111a45 0%, #0b1133 72%, #080d28 100%); box-shadow: 0 0 44px rgba(23, 43, 69, .32); }
.site-header { min-height: 70px; border-bottom-color: rgba(169, 200, 255, .18); }
.header-actions { gap: 10px; }
.header-button { padding: 8px 11px; font-size: 10px; }
.breadcrumb { margin: 19px 0 14px; font-size: 10px; }
.hero-heading { display: block; margin-bottom: 17px; text-align: center; }
.hero-heading .eyebrow { justify-content: center; margin-bottom: 8px; font-size: 9px; }
h1 { font-size: clamp(34px, 9vw, 42px); text-shadow: 3px 3px 0 rgba(65, 48, 126, .7); }
.hero-copy { margin-top: 9px; font-size: 11px; }
.hero-badge { display: none; }
.game-layout { display: flex; flex-direction: column; gap: 12px; }
.selection-panel { order: 0; padding: 19px 16px 16px; border-color: rgba(134, 191, 255, .3); background: linear-gradient(145deg, rgba(24, 43, 91, .98), rgba(13, 25, 64, .98)); box-shadow: 0 18px 45px rgba(5, 12, 39, .33); }
.selection-steps { margin-bottom: 18px; }
.selection-section + .selection-section { margin-top: 16px; }
.dino-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dino-card { display: block; min-height: 112px; padding: 7px; }
.dino-preview { width: 100%; height: 58px; margin-bottom: 7px; }
.dino-preview::before { left: 31%; }
.dino-preview::after { left: 33%; }
.dino-eye { left: calc(50% - 2px); }
.dino-horn { left: calc(50% - 6px); }
.dino-meta b { font-size: 11px; }
.dino-meta small { font-size: 9px; }
.card-index { position: absolute; top: 6px; right: 7px; }
.map-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.map-card { display: block; min-height: 102px; padding: 6px; }
.map-preview { width: 100%; height: 51px; margin-bottom: 6px; }
.map-card strong { font-size: 10px; }
.map-card small { font-size: 8px; }
.selection-summary { margin-top: 15px; }
.stat-box, .tip-box { display: none; }
.game-panel { order: 1; padding: 8px 8px 11px; }

/* 공룡 선택 카드는 종류별 정면 에셋을 한눈에 보여줍니다. */
.dino-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-life strong { color: var(--green); }
.dino-trex { --dino-main: #ff8d70; --dino-dark: #a83e59; --dino-light: #ffe18d; --dino-accent: #ff6b65; }
.dino-brachio { --dino-main: #8af0aa; --dino-dark: #258c78; --dino-light: #e4ffe0; --dino-accent: #ffe16b; }
.dino-trike { --dino-main: #64d9e7; --dino-dark: #226f9d; --dino-light: #fff0a2; --dino-accent: #ffcf62; }
.dino-ptera { --dino-main: #b892ff; --dino-dark: #5d43b3; --dino-light: #f3d8ff; --dino-accent: #68e9ff; }

@media (max-width: 620px) {
  .dino-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dino-card { min-height: 126px; padding: 8px; }
  .dino-preview { height: 70px; margin-bottom: 8px; }
  .dino-meta b { font-size: 12px; }
  .dino-meta small { font-size: 9px; }
}
.game-toolbar { min-height: 54px; gap: 4px; padding: 0 1px 9px; }
.score-block { min-width: 0; padding: 5px 7px; }
.score-block span { font-size: 8px; }
.score-block strong { font-size: 15px; }
.speed-readout { display: none; }
.tool-button { width: 30px; height: 30px; }
.info-grid { grid-template-columns: 1fr; gap: 9px; }
.how-to { padding: 18px 15px; }
.control-guide { display: grid; grid-template-columns: 1fr 1fr; }
.game-hint { display: none; }
.site-footer { display: block; padding: 21px 0 30px; line-height: 1.8; }
.site-footer span { display: block; }
.site-footer span + span { margin-top: 5px; }

@media (max-width: 380px) {
  .site-shell { padding-inline: 11px; }
  .selection-panel { padding-inline: 11px; }
  .selection-steps { gap: 4px; font-size: 8px; }
  .selection-steps i { width: 9px; }
  .map-card small { font-size: 6px; }
  .selection-summary { font-size: 9px; }
  .selection-summary small { display: none; }
}

/* 시작 전에는 설정 패널만, 출발 후에는 게임 패널만 노출합니다. */
.game-panel { display: none; }
.site-shell.is-playing .breadcrumb,
.site-shell.is-playing .hero-heading,
.site-shell.is-playing .selection-panel { display: none; }
.site-shell.is-playing .game-intro { display: none; }
.site-shell.is-playing .game-panel { display: block; }
.site-shell.is-playing .game-layout { gap: 0; }
.site-shell.is-playing main { padding-bottom: 16px; }

/* 메인 로비: 반짝게임처럼 귀여운 카드와 빛나는 로컬 기록 보드 */
.site-shell { position: relative; overflow: hidden; border-inline: 1px solid rgba(170, 183, 255, .12); }
.site-shell::before, .site-shell::after { position: absolute; z-index: 0; pointer-events: none; color: rgba(255, 226, 95, .75); font-size: 18px; text-shadow: 0 0 14px rgba(255, 216, 61, .9); }
.site-shell::before { content: '✦  ·  ✧'; top: 112px; right: 19px; transform: rotate(8deg); }
.site-shell::after { content: '✦'; bottom: 155px; left: 18px; font-size: 13px; animation: lobbyTwinkle 2.4s ease-in-out infinite; }
.site-shell > * { position: relative; z-index: 1; }
.site-header { position: relative; }
.header-button { border-radius: 7px; color: #fff0a4; border-color: rgba(255, 216, 61, .42); background: linear-gradient(135deg, rgba(77, 57, 146, .8), rgba(23, 31, 77, .88)); box-shadow: 0 0 18px rgba(255, 216, 61, .08); }
.header-button:hover { color: var(--ink); background: var(--yellow); box-shadow: 0 0 22px rgba(255, 216, 61, .35); }
.hero-heading h1 { color: #fff; text-shadow: 3px 3px 0 #5948a3, 0 0 24px rgba(111, 222, 255, .16); }
.hero-heading h1 em { text-shadow: 3px 3px 0 #a34050, 0 0 18px rgba(255, 216, 61, .32); }
.selection-panel { overflow: hidden; border-radius: 12px; }
.selection-section { min-width: 0; }
.dino-list, .map-list { min-width: 0; }
.dino-card, .map-card { min-width: 0; overflow: hidden; border-radius: 10px; }
.dino-card.is-selected { box-shadow: inset 4px 0 0 var(--yellow), 0 0 20px rgba(255, 216, 61, .08); }
.dino-preview { border-radius: 9px; background: radial-gradient(circle at 50% 24%, rgba(116, 224, 255, .3), transparent 46%), linear-gradient(145deg, #2c3272, #111735); }
.dino-preview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; padding: 2px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(2, 4, 18, .35)); }
.dino-meta { min-width: 0; max-width: 100%; overflow: hidden; }
.dino-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dino-meta small { display: block; line-height: 1.35; }
.dino-detail { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 8px; padding: 8px 9px; border: 1px solid rgba(77, 232, 244, .23); border-radius: 7px; background: linear-gradient(135deg, rgba(22, 87, 125, .34), rgba(15, 28, 70, .56)); }
.dino-detail-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; color: var(--ink); border-radius: 6px; background: var(--yellow); box-shadow: 0 0 13px rgba(255, 216, 61, .2); font-size: 14px; }
.dino-detail-copy { display: grid; min-width: 0; gap: 2px; }
.dino-detail-copy strong, .dino-detail-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dino-detail-copy strong { color: #f7fbff; font-size: 10px; }
.dino-detail-copy small { color: #b8d6ea; font-size: 8px; line-height: 1.35; }
.map-card > span:last-child { display: block; min-width: 0; overflow: hidden; }
.map-card strong, .map-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-heading { min-width: 0; gap: 8px; }
.section-heading h3, .section-heading > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-summary { min-width: 0; border-radius: 8px; box-shadow: inset 0 0 16px rgba(68, 227, 245, .05); }
.selection-summary > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-start-button { border-radius: 8px; box-shadow: 4px 4px 0 #7e416d, 0 0 18px rgba(255, 216, 61, .12); }
.menu-start-button:hover { box-shadow: 5px 5px 0 #7e416d, 0 0 24px rgba(255, 216, 61, .35); }
.score-block:nth-child(4) { border-color: var(--green); }

.ranking-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-width: 0; padding: 7px 8px; border: 1px solid rgba(145, 157, 255, .14); border-radius: 7px; background: rgba(8, 10, 35, .42); }
.ranking-place { display: grid; place-items: center; width: 25px; color: #aab0dc; font: 700 12px 'IBM Plex Mono', monospace; }
.ranking-place.top-three { font-size: 19px; }
.ranking-info { min-width: 0; }
.ranking-info strong, .ranking-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-info strong { color: var(--text); font-size: 12px; }
.ranking-info small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.ranking-score { color: var(--yellow); font: 700 12px 'IBM Plex Mono', monospace; white-space: nowrap; }
.ranking-empty { margin: 0; padding: 9px 4px 2px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }

.ranking-modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 16px; }
.ranking-modal.is-hidden { display: none; }
.ranking-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 23, .74); backdrop-filter: blur(7px); }
.ranking-sheet { position: relative; width: min(440px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; padding: 25px 20px 18px; border: 1px solid rgba(255, 224, 109, .48); border-radius: 14px; background: radial-gradient(circle at 100% 0, rgba(97, 79, 188, .42), transparent 42%), linear-gradient(145deg, #242260, #0d1236 78%); box-shadow: 8px 8px 0 rgba(4, 5, 22, .7), 0 0 42px rgba(107, 106, 236, .32); }
.ranking-close { position: absolute; top: 9px; right: 12px; width: 31px; height: 31px; color: #d8dcff; border: 1px solid rgba(194, 202, 255, .3); border-radius: 7px; background: rgba(8, 10, 35, .45); cursor: pointer; font-size: 22px; line-height: 1; }
.ranking-close:hover { color: var(--ink); background: var(--yellow); }
.ranking-sheet .panel-kicker { margin-bottom: 6px; }
.ranking-sheet h2 { margin: 0; color: #fff; font-family: 'Black Han Sans', sans-serif; font-size: 29px; letter-spacing: -.07em; }
.ranking-caption { margin: 5px 0 16px; color: var(--muted); font-size: 12px; }
.ranking-self-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(77, 232, 244, .19); border-radius: 8px; background: rgba(14, 30, 72, .5); }
.ranking-self-summary span { color: #dce4ff; font-size: 12px; font-weight: 800; }
.ranking-self-summary strong { min-width: 0; overflow: hidden; color: var(--yellow); text-overflow: ellipsis; white-space: nowrap; font: 700 14px 'IBM Plex Mono', monospace; }
.ranking-self-summary b { min-width: 0; overflow: hidden; color: #7beaf3; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ranking-list { display: grid; gap: 6px; margin: 14px 0 12px; }
.ranking-list .ranking-row { min-height: 48px; padding: 8px; }
.ranking-list .ranking-info strong { font-size: 13px; }
.ranking-list .ranking-info small { font-size: 11px; }
.ranking-list .ranking-score { font-size: 13px; }
.ranking-map-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
.ranking-map-tabs button { min-width: 0; min-height: 36px; overflow: hidden; padding: 5px 4px; color: #dbe2ff; border: 1px solid rgba(139, 157, 255, .25); border-radius: 6px; background: rgba(8, 14, 44, .48); cursor: pointer; font-size: 10px; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; transition: .16s ease; }
.ranking-map-tabs button:hover { border-color: rgba(77, 232, 244, .65); color: #fff; }
.ranking-map-tabs button.is-selected { color: var(--ink); border-color: var(--yellow); background: var(--yellow); box-shadow: 0 0 13px rgba(255, 216, 61, .2); }

@keyframes lobbyTwinkle {
  0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(18deg); }
}

@media (max-width: 620px) {
  .hero-heading { padding-inline: 6px; }
  .selection-panel { padding-inline: 12px; }
  .dino-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .dino-card { min-height: 102px; padding: 6px; }
  .dino-preview { height: 54px; margin-bottom: 6px; }
  .dino-meta b { font-size: 10px; }
  .dino-meta small { font-size: 7px; }
  .game-toolbar { overflow: hidden; }
}

@media (max-width: 380px) {
  .site-shell { padding-inline: 9px; }
  .selection-panel { padding-inline: 9px; }
  .selection-steps { gap: 3px; font-size: 8px; }
  .selection-steps i { width: 7px; }
  .dino-card { min-height: 96px; padding: 5px; }
  .dino-preview { height: 49px; margin-bottom: 5px; }
  .dino-meta b { font-size: 9px; }
  .dino-meta small { font-size: 6px; }
  .map-card { min-height: 94px; }
  .map-card small { font-size: 7px; }
  .ranking-highlight strong { font-size: 18px; }
}

/* 범퍼볼 스타일의 단일 모바일 로비 */
.game-intro { width: min(410px, 100%); margin: 30px auto 0; padding: 14px 15px 16px; border: 1px solid rgba(109, 167, 255, .34); border-radius: 10px 10px 0 0; background: linear-gradient(145deg, rgba(25, 52, 112, .98), rgba(14, 30, 74, .98)); box-shadow: 0 16px 35px rgba(4, 10, 33, .38); }
.intro-topline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.intro-brand { min-width: 0; flex: 0 1 auto; }
.intro-brand h1 { margin: 0 0 8px; color: var(--yellow); font-family: 'Black Han Sans', sans-serif; font-size: clamp(22px, 6vw, 29px); line-height: 1; letter-spacing: -.08em; text-shadow: 2px 3px 0 #a65d48, 0 0 15px rgba(255, 216, 61, .2); white-space: nowrap; }
.intro-brand h1 span { color: #ffe56b; }
.gamehub-badge { display: inline-flex; align-items: center; padding: 8px 11px; color: #f4fbff; border: 1px solid rgba(119, 211, 255, .62); border-radius: 6px; background: linear-gradient(180deg, #429bea, #2672c6); box-shadow: 0 4px 11px rgba(36, 116, 217, .28); font-size: 10px; font-weight: 800; }
.qr-badge { display: flex; flex: 0 0 64px; flex-direction: column; align-items: center; gap: 3px; padding: 5px 4px 4px; border-radius: 7px; background: #fff; color: #1e2742; }
.qr-badge img { display: block; width: 50px; height: 50px; }
.qr-badge span { font-size: 7px; font-weight: 800; }
.intro-topline { justify-content: center; }
.intro-title-row { justify-content: center; }
.intro-title-row h1 { flex: 0 1 auto; }
.game-player { margin: 10px 0 0; color: #e7efff; text-align: center; font-size: 10px; line-height: 1.3; }
.game-player span { color: #a9bad8; }
.game-player b { color: var(--yellow); font-weight: 800; }
.game-intro + .game-layout { width: min(410px, 100%); margin: 0 auto; gap: 0; }
.selection-panel { width: 100%; padding: 16px 15px 15px; border-top: 0; border-radius: 0 0 10px 10px; background: linear-gradient(145deg, rgba(25, 52, 112, .98), rgba(14, 30, 74, .98)); box-shadow: 0 20px 38px rgba(4, 10, 33, .38); }
.selection-panel > .selection-steps,
.selection-panel > .panel-kicker,
.selection-panel > .panel-title-row,
.selection-panel > .panel-description { display: none; }
.selection-section + .selection-section { margin-top: 15px; }
.section-heading { margin-bottom: 7px; }
.section-heading h3 { color: #eaf2ff; font-size: 11px; }
.section-heading > span { color: var(--yellow); font-size: 9px; }
.lobby-ranking-button { width: 100%; margin-top: 8px; padding: 10px; color: #e4eaff; border: 1px solid rgba(161, 181, 239, .22); border-radius: 7px; background: rgba(73, 91, 145, .64); cursor: pointer; font-size: 10px; font-weight: 800; transition: .16s ease; }
.lobby-ranking-button:hover { color: #fff; border-color: rgba(115, 221, 255, .65); background: rgba(61, 113, 181, .75); box-shadow: 0 0 16px rgba(75, 197, 255, .16); }
.site-shell.is-playing .game-panel { width: min(520px, 100%); margin: 0 auto; border-radius: 10px; }
.site-shell.is-playing .game-layout { width: 100%; }

@media (max-width: 620px) {
  .game-intro { margin-top: 18px; }
  .intro-brand h1 { font-size: clamp(20px, 6vw, 27px); }
  .gamehub-badge { padding: 7px 9px; font-size: 9px; }
  .qr-badge { flex-basis: 60px; }
  .qr-badge img { width: 46px; height: 46px; }
  .game-intro + .game-layout { width: 100%; }
  .selection-panel { padding-inline: 12px; }
  .dino-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .dino-card { min-height: 94px; padding: 5px; border-radius: 8px; }
  .dino-preview { height: 49px; margin-bottom: 5px; border-radius: 7px; }
  .dino-meta b { font-size: 9px; }
  .dino-meta small { font-size: 6px; }
}

/* 시작 전 로비는 한 덩어리로 화면 중앙에 배치하고, 플레이 중에는 게임만 펼칩니다. */
.site-shell:not(.is-playing) {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-shell:not(.is-playing) main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(18px, 4dvh, 36px);
  padding-bottom: clamp(24px, 6dvh, 58px);
}

.site-shell:not(.is-playing) .game-intro { margin-top: 0; }

.site-shell.is-playing main {
  display: block;
  flex: initial;
  padding-bottom: 16px;
}

@media (max-height: 760px) {
  .site-shell:not(.is-playing) main {
    justify-content: flex-start;
    padding-top: 18px;
  }
}

/* 제목 오른쪽의 게임허브와 현재 주소 QR */
.intro-title-row { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.intro-title-row h1 { min-width: 0; flex: 1 1 auto; margin: 0; }
.intro-title-row .gamehub-badge { flex: 0 0 auto; align-self: flex-end; margin-bottom: 1px; white-space: nowrap; }
.gamehub-badge { cursor: pointer; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease; }
.gamehub-badge:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(36, 116, 217, .42); }
.gamehub-badge:focus-visible, .qr-badge:focus-visible, .qr-open-link:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.qr-badge { appearance: none; border: 1px solid rgba(255,255,255,.65); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.qr-badge:hover { transform: translateY(-2px); box-shadow: 0 7px 16px rgba(1, 8, 32, .32); }

/* 맵 카드는 미리보기와 텍스트를 별도 행으로 고정해 이름이 겹치지 않게 합니다. */
.map-card { position: relative; display: grid !important; grid-template-rows: 58px auto; gap: 6px; align-content: stretch; min-height: 101px; padding: 6px; }
.map-preview { width: 100%; height: 58px; margin: 0; border-radius: 7px; }
.map-preview::before { left: 38%; top: 19%; width: 25%; height: 86%; }
.map-preview::after { left: 50%; top: 9%; height: 7px; box-shadow: 0 12px 0 var(--yellow), 0 24px 0 var(--yellow), 0 36px 0 var(--yellow); }
.map-preview i { left: 14%; bottom: 11px; width: 8px; height: 17px; }
.map-preview b { top: 5px; left: 6px; right: auto; font-size: 8px; }
.map-meta { display: grid; min-width: 0; gap: 4px; padding: 0 2px 1px; }
.map-meta strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.2; }
.map-meta small { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.2; }
.map-meta small b { flex: 0 0 auto; padding: 2px 4px; color: var(--ink); border-radius: 3px; background: var(--cyan); font-size: 7px; font-weight: 900; }
.map-card[data-map="canyon"] .map-meta small b { background: #ff9a70; }
.map-card[data-map="ice"] .map-meta small b { background: #bff8ff; }
.map-meta small em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.map-selected-mark { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 15px; height: 15px; color: var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 0 0 12px rgba(255,216,61,.4); font-size: 9px; font-weight: 900; opacity: 0; transform: scale(.8); transition: opacity .16s ease, transform .16s ease; }
.map-card.is-selected .map-selected-mark { opacity: 1; transform: scale(1); }

/* QR을 누르면 현재 주소를 읽고 복사할 수 있는 작은 주소 창 */
.qr-modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 16px; }
.qr-modal.is-hidden { display: none; }
.qr-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 23, .74); backdrop-filter: blur(7px); }
.qr-sheet { position: relative; width: min(350px, 100%); padding: 25px 20px 18px; border: 1px solid rgba(255, 224, 109, .48); border-radius: 14px; background: radial-gradient(circle at 100% 0, rgba(97, 79, 188, .42), transparent 42%), linear-gradient(145deg, #242260, #0d1236 78%); box-shadow: 8px 8px 0 rgba(4, 5, 22, .7), 0 0 42px rgba(107, 106, 236, .32); }
.qr-close { position: absolute; top: 9px; right: 12px; width: 31px; height: 31px; color: #d8dcff; border: 1px solid rgba(194, 202, 255, .3); border-radius: 7px; background: rgba(8, 10, 35, .45); cursor: pointer; font-size: 22px; line-height: 1; }
.qr-close:hover { color: var(--ink); background: var(--yellow); }
.qr-sheet .panel-kicker { margin-bottom: 6px; }
.qr-sheet h2 { margin: 0; color: #fff; font-family: 'Black Han Sans', sans-serif; font-size: 29px; letter-spacing: -.07em; }
.qr-caption { margin: 5px 0 14px; color: var(--muted); font-size: 10px; }
.qr-large { width: 142px; height: 142px; margin: 0 auto 15px; padding: 8px; border-radius: 10px; background: #fff; box-shadow: 0 0 22px rgba(255,255,255,.12); }
.qr-large img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

@media (max-width: 380px) {
  .intro-title-row { gap: 5px; }
  .intro-brand h1 { font-size: clamp(18px, 5.7vw, 23px); }
  .intro-title-row .gamehub-badge { padding: 6px 7px; font-size: 8px; }
  .map-card { grid-template-rows: 52px auto; min-height: 94px; padding: 5px; }
  .map-preview { height: 52px; }
  .map-meta strong { font-size: 9px; }
  .map-meta small { font-size: 7px; }
  .map-meta small b { font-size: 6px; }
}

/* 범퍼볼·오목처럼 게임 전체에 항상 보이는 상단 메뉴 */
.site-header.game-topbar { min-height: 54px; padding: 7px 0; border-bottom: 1px solid rgba(155, 159, 255, .22); }
.game-topbar .header-left { display: flex; align-items: center; min-width: 0; gap: 10px; }
.game-topbar .brand { min-width: 0; gap: 8px; }
.game-topbar .brand-mark { width: auto; height: auto; border: 0; background: transparent; box-shadow: none; transform: none; font-size: 25px; line-height: 1; }
.game-topbar .brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -.08em; }
.game-topbar .brand-name span { color: var(--yellow); }
.game-topbar .header-button { padding: 7px 10px; font-size: 10px; white-space: nowrap; }

/* 참고 화면처럼 흰색 QR 카드를 크게 띄웁니다. */
.qr-sheet { width: min(390px, calc(100vw - 32px)); padding: 20px 20px 17px; border: 0; border-radius: 10px; background: #fff; color: #172753; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.qr-sheet .panel-kicker { color: #1e78d7; text-align: center; letter-spacing: .08em; }
.qr-sheet h2 { color: #172753; text-align: center; font-size: 24px; text-shadow: none; }
.qr-caption { color: #4f5e7a; text-align: center; font-size: 11px; }
.qr-large { width: min(280px, 76vw); height: min(280px, 76vw); margin: 0 auto 14px; padding: 0; border-radius: 2px; background: #fff; box-shadow: none; }
.qr-large img { image-rendering: pixelated; }
.qr-sheet h2 { margin: 0 0 7px; }
.qr-caption { margin: 0 0 14px; }
.qr-sheet .qr-close { border: 0; background: #172753; color: #fff; }
.qr-sheet .qr-close:hover { background: #2f5f9e; color: #fff; }

/* 선택창과 플레이 화면이 같은 맵 아트워크를 공유합니다. */
.map-preview { background-size: cover; background-position: center 74%; }
.map-preview::before { left: 0; top: 0; width: 100%; height: 100%; transform: none; background: linear-gradient(180deg, rgba(9, 15, 48, .04), rgba(7, 10, 35, .32)); box-shadow: none; }
.map-preview::after, .map-preview i { display: none; }
.map-preview.map-city { background-image: url('./assets/map-concepts/map-neon-city-concept-v1.png'); }
.map-preview.map-canyon { background-image: url('./assets/map-concepts/map-crimson-canyon-concept-v1.png'); }
.map-preview.map-ice { background-image: url('./assets/map-concepts/map-ice-crater-concept-v2.png'); }

.intro-title-row { justify-content: center; }
.intro-title-row h1 { flex: 0 1 auto; }

.ranking-modal, .ranking-modal * { font-family: var(--font-game) !important; }

@media (max-width: 620px) {
  .site-header.game-topbar { min-height: 50px; padding: 6px 0; }
  .game-topbar .brand-mark { font-size: 22px; }
  .game-topbar .brand-name { font-size: 17px; }
  .game-topbar .header-button { padding: 6px 8px; font-size: 9px; }
}

@media (max-width: 380px) {
  .game-topbar .header-left { gap: 6px; }
  .game-topbar .brand { gap: 5px; }
  .game-topbar .brand-mark { font-size: 19px; }
  .game-topbar .brand-name { font-size: 15px; }
  .game-topbar .header-button { padding-inline: 6px; font-size: 8px; }
}

/* 게임 화면 전체는 같은 폰트로 맞춰 제목·숫자·버튼의 인상이 달라지지 않게 합니다. */
.site-shell, .site-shell * { font-family: var(--font-game) !important; }

/* 선택 화면 가독성 보정: 기존 기준보다 약 20% 크게 표시합니다. */
.game-intro .intro-brand h1 { font-size: clamp(24px, 7.2vw, 32px); }
.game-intro .game-player { font-size: 12px; }
.game-intro .gamehub-badge { font-size: 11px; }
.game-intro .qr-badge span { font-size: 9px; }
.selection-panel .section-heading h3 { font-size: 13px; }
.selection-panel .section-heading > span { font-size: 11px; }
.selection-panel .dino-meta b { font-size: 11px; }
.selection-panel .dino-meta small { font-size: 7.2px; }
.selection-panel .card-index { font-size: 10px; }
.selection-panel .dino-detail-icon { font-size: 17px; }
.selection-panel .dino-detail-copy strong { font-size: 12px; }
.selection-panel .dino-detail-copy small { font-size: 10px; }
.selection-panel .map-preview b { font-size: 10px; }
.selection-panel .map-meta strong { font-size: 12px; }
.selection-panel .map-meta small { font-size: 10px; }
.selection-panel .map-meta small b { font-size: 8.4px; }
.selection-panel .map-selected-mark { font-size: 11px; }
.selection-panel .selection-summary { font-size: 12px; }
.selection-panel .selection-summary small { font-size: 10px; }
.selection-panel .menu-start-button,
.selection-panel .lobby-ranking-button { font-size: 12px; }

/* 모바일 브라우저의 주소창·하단 바 변화로 쉘 아래 배경이 드러나지 않게 합니다. */
@media (max-width: 620px) {
  html,
  body { min-height: 100dvh; background: #080d28; }
  .site-shell { min-height: 100dvh; }
}

/* 모바일에서는 캔버스 아래에 실제 터치 조작을 안내합니다. */
.mobile-controls { display: none; }
@media (max-width: 620px) {
  .game-hint {
    display: block;
    margin: 0;
    padding: 10px 3px 2px;
    color: #c2c8ed;
    font-size: 11px;
    line-height: 1.25;
  }
  .desktop-controls { display: none; }
  .mobile-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .mobile-control-item {
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 5px;
    border: 1px solid rgba(119, 211, 255, .25);
    border-radius: 7px;
    background: rgba(19, 35, 79, .68);
  }
  .mobile-control-item > b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    color: var(--ink);
    border-radius: 5px;
    background: var(--cyan);
    font-size: 15px;
    line-height: 1;
  }
  .mobile-control-item > span { min-width: 0; overflow: hidden; text-align: left; white-space: nowrap; }
  .mobile-control-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
}

/* 모바일 플레이 화면은 브라우저 viewport 안에 고정하고, 결과 카드는 내부 스크롤 없이 압축합니다. */
@media (max-width: 620px) {
  html:has(.site-shell.is-playing),
  body:has(.site-shell.is-playing) { overflow: hidden; }

  .site-shell.is-playing {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .site-shell.is-playing main {
    height: calc(100dvh - 50px);
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
  .site-shell.is-playing .game-layout {
    height: 100%;
    min-height: 0;
  }
  .site-shell.is-playing .game-panel {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 5px;
  }
  .site-shell.is-playing .game-toolbar {
    flex: 0 0 auto;
    min-height: 46px;
    padding-bottom: 6px;
  }
  .site-shell.is-playing .canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .site-shell.is-playing #gameCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .site-shell.is-playing .game-hint {
    flex: 0 0 auto;
    padding-top: 5px;
    font-size: 9px;
  }

  #gameoverOverlay {
    align-items: center;
    padding: 6px;
    overflow: hidden;
  }
  #gameoverOverlay .overlay-card {
    width: min(360px, 100%);
    max-height: 100%;
    margin: 0 auto;
    padding: 16px 14px 10px;
    overflow: hidden;
  }
  #gameoverOverlay .overlay-card h2 {
    margin: 5px 0;
    font-size: 32px;
  }
  #gameoverOverlay .overlay-card p {
    margin-bottom: 10px;
    font-size: 10px;
    line-height: 1.4;
  }
  #gameoverOverlay .result-row {
    margin: 10px 0 12px;
  }
  #gameoverOverlay .result-row > div {
    padding: 8px;
  }
  #gameoverOverlay .result-row strong {
    font-size: 20px;
  }
  #gameoverOverlay .start-button {
    min-height: 40px;
    padding: 10px 15px;
    font-size: 12px;
  }
  #gameoverOverlay .gameover-ranking-button {
    height: 40px;
    min-height: 40px;
    margin-top: 7px;
    padding: 10px 12px;
    font-size: 12px;
  }
  #gameoverOverlay .gameover-ad {
    height: 60px;
    min-height: 60px;
    margin-top: 7px;
  }
  #gameoverOverlay .gameover-ad .portal-ranking-ad {
    height: 60px;
    min-height: 60px;
    padding: 0;
  }
}

@media (max-width: 620px) and (max-height: 700px) {
  .site-shell.is-playing .game-toolbar {
    min-height: 42px;
    padding-bottom: 4px;
  }
  .site-shell.is-playing .tool-button {
    width: 27px;
    height: 27px;
  }
  #gameoverOverlay .overlay-card {
    padding: 11px 11px 7px;
  }
  #gameoverOverlay .overlay-card h2 {
    font-size: 28px;
  }
  #gameoverOverlay .overlay-card p {
    margin-bottom: 7px;
  }
  #gameoverOverlay .result-row {
    margin: 7px 0 9px;
  }
  #gameoverOverlay .result-row > div {
    padding: 6px;
  }
  #gameoverOverlay .result-row strong {
    font-size: 18px;
  }
  #gameoverOverlay .gameover-ad,
  #gameoverOverlay .gameover-ad .portal-ranking-ad {
    height: 48px;
    min-height: 48px;
  }
}

/* 네 번째 클래식 2D 맵을 항상 맵/랭킹 탭의 오른쪽에 배치합니다. */
.map-list, .ranking-map-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.site-shell.is-classic-2d .lane-control { display: none; }
.site-shell.is-classic-2d .canvas-wrap { aspect-ratio: 4 / 5; }
.site-shell.is-classic-2d .score-coin,
.site-shell.is-classic-2d .score-life { display: none; }
.site-shell.is-classic-2d .canvas-wrap { aspect-ratio: 4 / 5; border-color: #d7d9dd; background: #fff; box-shadow: 0 0 0 1px rgba(83, 89, 96, .14); }
.site-shell.is-classic-2d .scanlines { opacity: .035; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(83, 89, 96, .35) 4px); }

/* 데스크톱/모바일의 플레이 레이아웃보다 클래식 2D의 하늘-지면 비율을 우선합니다. */
.site-shell.is-classic-2d .canvas-wrap { aspect-ratio: 4 / 5; }
.site-shell.is-classic-2d #gameCanvas { transform: translateY(-16.6667%); }
.site-shell.is-classic-2d #gameoverOverlay { align-items: center; overflow: hidden; }
@media (max-width: 620px) {
  .site-shell.is-playing.is-classic-2d .canvas-wrap { aspect-ratio: 4 / 5; }
}

/* 클래식 2D 카드에는 첨부 참고 이미지 기반의 회색 도트 미니맵을 보여줍니다. */
.map-preview.map-classic2d {
  background: #fff url('./assets/map-concepts/map-classic-2d-preview.png') center / cover no-repeat;
}
.map-preview.map-classic2d::before,
.map-preview.map-classic2d::after { display: none; }
.map-preview.map-classic2d i {
  position: absolute;
  z-index: 2;
  left: 19%;
  bottom: 8px;
  display: block;
  width: 3px;
  height: 14px;
  background: #555a60;
  box-shadow: 25px 3px 0 #555a60;
}
.map-preview.map-classic2d i::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 5px;
  width: 5px;
  height: 3px;
  background: #555a60;
  box-shadow: 2px -5px 0 #555a60, 27px 6px 0 #555a60, 29px 1px 0 #555a60;
}
.map-preview.map-classic2d i { display: none; }
