/* JOB QUEST 독립 게임 브랜드 — Modern Indie × Subtle Pixel Arcade
   Toolturi 공통 CSS는 건드리지 않는다. 게임 페이지에만 로드. */
@import url("./tokens.css");

:root{
  --jq-pixel: 4px;
  --jq-radius: 14px;
  --jq-radius-sm: 10px;
  --jq-ink: #1f2430;
  --jq-paper: #f4f1ea;
  --jq-panel: #fffdf8;
  --jq-line: #d9d2c4;
  --jq-muted: #5f6570;
  --jq-good: #2f9e6a;
  --jq-bad: #c45c5c;
  --jq-glow: rgba(31,36,48,.08);
  --jq-cta: #2f6fed;
  --jq-cta-ink: #fff;
  --jq-accent: #e8b86d;
  --jq-scan: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(31,36,48,.03) 3px,
    rgba(31,36,48,.03) 4px
  );
}

html[data-jq-game="star"]{
  --jq-cta: #b8860b;
  --jq-accent: #d4a017;
  --jq-paper: #f7f1e4;
  --jq-panel: #fffaf0;
  --jq-line: #e2d2ad;
}
html[data-jq-game="econ"]{
  --jq-cta: #1f7a8c;
  --jq-accent: #3db8a0;
  --jq-paper: #eef7f8;
  --jq-panel: #f7fcfd;
  --jq-line: #c5dde2;
}
html[data-jq-game="career"]{
  --jq-cta: #2f7d4a;
  --jq-accent: #6cbc7a;
  --jq-paper: #eef6ef;
  --jq-panel: #f7fcf7;
  --jq-line: #c9decd;
}
html[data-jq-game="issue"]{
  --jq-cta: #7a3e6b;
  --jq-accent: #c06a9a;
  --jq-paper: #f7eef4;
  --jq-panel: #fcf7fb;
  --jq-line: #e2c9d8;
}

body{
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--jq-accent) 28%, transparent), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, color-mix(in srgb, var(--jq-cta) 18%, transparent), transparent 55%),
    var(--jq-paper) !important;
  color: var(--jq-ink);
}

/* 픽셀 포인트 — 장식만, 본문 폰트는 건드리지 않음 */
.jq-pixel-badge{
  display:inline-grid;
  grid-template-columns:repeat(3, var(--jq-pixel));
  grid-auto-rows:var(--jq-pixel);
  gap:1px;
  width:calc(var(--jq-pixel) * 3 + 2px);
  vertical-align:middle;
}
.jq-pixel-badge i{
  display:block;
  width:var(--jq-pixel);
  height:var(--jq-pixel);
  background:var(--jq-cta);
}
.jq-pixel-badge i:nth-child(2),
.jq-pixel-badge i:nth-child(4),
.jq-pixel-badge i:nth-child(6),
.jq-pixel-badge i:nth-child(8){ background:var(--jq-accent); opacity:.85; }

.jq-back{
  position:sticky;
  top:0;
  z-index:40;
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:10px 12px 0;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--jq-line);
  background:color-mix(in srgb, var(--jq-panel) 92%, white);
  color:var(--jq-ink);
  text-decoration:none;
  font:600 13px/1.2 "Noto Sans KR", sans-serif;
  box-shadow:0 4px 14px var(--jq-glow);
}
.jq-back:hover{ border-color:color-mix(in srgb, var(--jq-cta) 40%, var(--jq-line)); }
.jq-back:focus-visible{ outline:2px solid var(--jq-cta); outline-offset:2px; }

.jq-home-stage{
  position:relative;
  isolation:isolate;
  padding:28px 18px 36px !important;
  border-radius:24px;
  background:
    var(--jq-scan),
    linear-gradient(180deg, color-mix(in srgb, var(--jq-panel) 88%, white), var(--jq-panel));
  border:1px solid var(--jq-line);
  box-shadow:0 18px 40px var(--jq-glow);
  overflow:hidden;
}
.jq-home-stage::before{
  content:"";
  position:absolute;
  inset:auto -20% -40% auto;
  width:220px;
  height:220px;
  border-radius:40px;
  background:color-mix(in srgb, var(--jq-accent) 22%, transparent);
  transform:rotate(18deg);
  z-index:-1;
}
.jq-home-stage .logo,
.jq-home-stage .title{
  letter-spacing:.02em;
}
.jq-home-stage .lead,
.jq-home-stage .subtitle{
  max-width:34ch;
  margin-left:auto;
  margin-right:auto;
  color:var(--jq-muted);
  font-size:calc(15px * var(--jq-type-scale, 1));
  line-height:1.55;
}
.jq-home-cta .start,
.jq-home-cta .btn.big,
button.start,
#simpleStart.btn{
  min-height:52px !important;
  min-width:min(100%, 280px);
  padding:14px 22px !important;
  border-radius:16px !important;
  border:2px solid color-mix(in srgb, var(--jq-cta) 70%, #000) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--jq-cta) 88%, #fff), var(--jq-cta)) !important;
  color:var(--jq-cta-ink) !important;
  font-weight:800 !important;
  font-size:calc(16px * var(--jq-type-scale, 1)) !important;
  box-shadow:0 8px 0 color-mix(in srgb, var(--jq-cta) 55%, #000), 0 16px 28px var(--jq-glow) !important;
  transform:translateY(0);
}
.jq-home-cta .start:hover,
.jq-home-cta .btn.big:hover,
button.start:hover,
#simpleStart.btn:hover{
  filter:brightness(1.04);
}
.jq-home-cta .start:active,
.jq-home-cta .btn.big:active,
button.start:active,
#simpleStart.btn:active{
  transform:translateY(3px);
  box-shadow:0 4px 0 color-mix(in srgb, var(--jq-cta) 55%, #000), 0 10px 18px var(--jq-glow) !important;
}

/* 설정 UI 비노출 (코드·기록은 유지) */
.jq-simple-only #fieldToggle,
.jq-simple-only #fieldPanel,
.jq-simple-only #fields,
.jq-simple-only #diffs,
.jq-simple-only #summary,
.jq-simple-only #mix,
.jq-simple-only #best,
.jq-simple-only #homeMsg,
.jq-simple-only .jq-meta,
.jq-simple-only #moreWays,
.jq-simple-only #moreWaysPanel,
.jq-simple-only #classicResume{
  display:none !important;
}

/* HUD */
.hud,
.sub-hud{
  border-radius:14px;
  border:1px solid var(--jq-line);
  background:color-mix(in srgb, var(--jq-panel) 94%, white);
  box-shadow:0 6px 18px var(--jq-glow);
}
.hud .time.warn,
.hud .val.time.warn{ color:var(--jq-bad); }

.jq-hud-free #time,
.jq-hud-free [data-jq-time],
.jq-hud-free .hud > div:first-child{
  opacity:.55;
}

/* 정답·오답 피드백 */
@keyframes jq-pop{
  0%{ transform:scale(.96); opacity:.4; }
  60%{ transform:scale(1.04); }
  100%{ transform:scale(1); opacity:1; }
}
@keyframes jq-shake-x{
  0%,100%{ transform:translateX(0); }
  25%{ transform:translateX(-4px); }
  75%{ transform:translateX(4px); }
}
.jq-flash-good{
  animation:jq-pop .28s ease;
  box-shadow:0 0 0 2px color-mix(in srgb, var(--jq-good) 55%, transparent);
}
.jq-flash-bad{
  animation:jq-shake-x .28s ease;
}
.combo-box.show,
#comboBox.show,
#qComboBox.show{
  background:color-mix(in srgb, var(--jq-accent) 35%, var(--jq-panel));
  border:1px solid color-mix(in srgb, var(--jq-accent) 55%, var(--jq-line));
}

/* 결과 */
#result .ticket,
.result-wrap{
  border-radius:20px;
  border:1px solid var(--jq-line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--jq-accent) 12%, var(--jq-panel)), var(--jq-panel));
  box-shadow:0 16px 36px var(--jq-glow);
}
.jq-result-actions,
.result-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin-top:18px;
}
.jq-result-actions .again,
.result-actions .btn-primary,
#again.again{
  min-height:48px;
  border-radius:14px;
  border:2px solid color-mix(in srgb, var(--jq-cta) 70%, #000);
  background:linear-gradient(180deg, color-mix(in srgb, var(--jq-cta) 88%, #fff), var(--jq-cta));
  color:#fff;
  font-weight:800;
  box-shadow:0 6px 0 color-mix(in srgb, var(--jq-cta) 55%, #000);
}
.jq-clear-banner{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0 auto 10px;
  padding:6px 12px;
  border-radius:999px;
  background:color-mix(in srgb, var(--jq-accent) 28%, var(--jq-panel));
  border:1px solid color-mix(in srgb, var(--jq-accent) 45%, var(--jq-line));
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
}

@media (max-width:767px){
  .jq-back{ margin:8px 8px 0; }
  .jq-home-stage{ border-radius:18px; }
  .jq-result-actions .link,
  .result-actions .btn-text{
    width:100%;
  }
}
@media (prefers-reduced-motion: reduce){
  .jq-flash-good,
  .jq-flash-bad,
  .jq-home-cta .start:active,
  button.start:active{ animation:none; transform:none; }
}
