/* ===================================================================
   MASIN · 캐릭터 각성 (사용자)
   char-enhance.css 의 골드-브라운 토큰을 그대로 따른다.
   =================================================================== */
.awk {
  --awk-bg:        #f4f1e8;
  --awk-panel:     #ffffff;
  --awk-soft:      #faf6ec;
  --awk-primary:   #7a5c1f;
  --awk-primary-dk:#4a3712;
  --awk-accent:    #c08a2c;
  --awk-border:    #d8cdb2;
  --awk-border-st: #b4a481;
  --awk-line:      #ece4d0;
  --awk-text:      #2b261d;
  --awk-text-s:    #574e3f;
  --awk-text-m:    #6a6050;
  --awk-danger:    #b13a2a;
  --awk-danger-dk: #8a2a1d;
  --awk-danger-bg: #fdf4f2;
  --awk-danger-bd: #e3c4bd;
  --awk-ok:        #2f7a3d;
  --awk-ok-dk:     #1f5c2b;
  --awk-ok-bg:     #f1f8f2;
  --awk-ok-bd:     #9ec7a8;

  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 20px 48px;
  color: var(--awk-text);
  word-break: keep-all;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── 헤더 ── */
.awk-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 22px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 2px solid var(--awk-border);
}
.awk-head .eyebrow { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; color: var(--awk-text-m); }
.awk-head h1 { margin: 4px 0 6px; font-size: 1.85rem; font-weight: 900; letter-spacing: -0.02em; }
.awk-head .sub { margin: 0; font-size: 0.86rem; color: var(--awk-text-s); max-width: 64ch; line-height: 1.6; }
.awk-wallet {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 17px; border: 1px solid var(--awk-border); border-radius: 12px;
  background: var(--awk-panel); box-shadow: 0 1px 3px rgba(74, 56, 18, 0.06);
}
.awk-wallet i { color: var(--awk-accent); font-size: 1.05rem; }
.awk-wallet .k { display: block; font-size: 0.7rem; font-weight: 800; color: var(--awk-text-m); }
.awk-wallet .v { display: block; font-size: 1.18rem; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── 섹션 ── */
.awk-sec { display: flex; flex-direction: column; gap: 12px; }
.awk-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.awk-sec-head h2 { margin: 0; font-size: 1.05rem; font-weight: 900; display: flex; align-items: center; gap: 9px; }
.awk-sec-head .cnt {
  padding: 2px 9px; border-radius: 999px; background: var(--awk-primary-dk);
  color: #fff; font-size: 0.74rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.awk-sec-head .note { margin: 0; font-size: 0.78rem; color: var(--awk-text-s); }

/* ── 재료 카드 ── */
.awk-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.awk-mat {
  border: 1px solid var(--awk-border); border-radius: 14px; background: var(--awk-panel);
  padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.awk-mat.sel { border: 2px solid var(--awk-accent); background: #fff8e8; }
.awk-mat.broken { border: 1.5px solid var(--awk-danger-bd); background: var(--awk-danger-bg); }
.awk-mat.used, .awk-mat.revoked { border-color: #d6d1c8; background: #f7f5f1; }
.awk-mat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.awk-mat-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.awk-mat-name b { font-size: 0.92rem; font-weight: 800; line-height: 1.35; }
.awk-mat-name span { font-size: 0.72rem; font-weight: 600; color: var(--awk-text-m); font-variant-numeric: tabular-nums; }
.awk-badge {
  flex-shrink: 0; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--awk-border-st);
  background: #fff; color: var(--awk-primary); font-size: 0.72rem; font-weight: 900; white-space: nowrap;
}
.awk-badge.held { border-color: var(--awk-accent); color: var(--awk-primary); }
.awk-badge.broken { border-color: var(--awk-danger); color: var(--awk-danger-dk); }
.awk-badge.used, .awk-badge.revoked { border-color: #b6ada1; color: #5c554c; }
.awk-mat-meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; }
.awk-mat-meta div { display: flex; gap: 8px; }
.awk-mat-meta dt { flex-shrink: 0; width: 44px; color: var(--awk-text-m); font-weight: 700; }
.awk-mat-meta dd { margin: 0; color: var(--awk-text-s); font-weight: 600; min-width: 0; }
.awk-mat-btn {
  margin-top: auto; width: 100%; padding: 9px 12px; border: 1px solid var(--awk-border-st);
  border-radius: 10px; background: #fff; color: var(--awk-primary-dk);
  font-size: 0.82rem; font-weight: 800; cursor: pointer;
}
.awk-mat-btn.on { border-color: var(--awk-primary-dk); background: var(--awk-primary-dk); color: #fff; }
.awk-mat-btn.danger { border-color: var(--awk-danger); color: var(--awk-danger-dk); }

/* hover 는 변형마다 따로 — 공용 hover 가 .on(어두운 배경 + 흰 글자)을 덮으면 글자가 사라진다. */
.awk-mat-btn:not(.on):not(.danger):hover:not(:disabled) { background: var(--awk-soft); }
.awk-mat-btn.on:hover:not(:disabled) { background: #3a2b0e; }
.awk-mat-btn.danger:hover:not(:disabled) { background: var(--awk-danger-bg); }
.awk-mat-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.awk-mat-done {
  margin: auto 0 0; padding: 8px 12px; border-radius: 10px; background: #f0ede7;
  color: var(--awk-text-s); font-size: 0.76rem; font-weight: 700; text-align: center;
}
.awk-empty {
  padding: 26px 20px; border: 1px dashed var(--awk-border-st); border-radius: 14px;
  background: var(--awk-soft); color: var(--awk-text-s); font-size: 0.86rem;
  font-weight: 600; text-align: center;
}

/* ── 각성 패널 ── */
.awk-panel {
  border: 1.5px solid var(--awk-border-st); border-radius: 16px; background: var(--awk-panel);
  overflow: hidden; box-shadow: 0 6px 16px rgba(74, 56, 18, 0.08);
}
.awk-panel-head {
  padding: 14px 20px; background: linear-gradient(135deg, var(--awk-primary), var(--awk-primary-dk));
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.awk-panel-head h2 { margin: 0; font-size: 1.02rem; font-weight: 900; display: flex; align-items: center; gap: 9px; }
.awk-panel-head h2 i { color: #e8c878; }
.awk-panel-head .serial { font-weight: 700; color: #e6cf98; font-variant-numeric: tabular-nums; }
.awk-panel-head .hint { font-size: 0.76rem; font-weight: 700; color: #e6cf98; }
.awk-cols { display: flex; flex-wrap: wrap; align-items: stretch; }
.awk-col-l {
  flex: 1 1 500px; min-width: 0; padding: 20px;
  display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--awk-border);
}
.awk-col-r {
  flex: 1 1 430px; min-width: 0; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; background: var(--awk-soft);
}
.awk-col-t { margin: 0; font-size: 0.74rem; font-weight: 900; letter-spacing: 0.07em; color: var(--awk-text-m); }

/* 캐릭터 전이 */
.awk-flow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.awk-flow > i { flex-shrink: 0; color: var(--awk-accent); font-size: 1.1rem; }
.awk-flow-box {
  flex: 1 1 170px; min-width: 0; border: 1px solid var(--awk-border); border-radius: 12px;
  background: var(--awk-soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.awk-flow-box.res { border: 1.5px solid var(--awk-accent); background: #fff8e8; }
.awk-flow-box .k { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.05em; color: var(--awk-text-m); }
.awk-flow-box.res .k { color: var(--awk-primary); }
.awk-flow-box b { font-size: 1rem; font-weight: 900; }
.awk-flow-box.res b { color: var(--awk-primary-dk); }
.awk-flow-box .d { font-size: 0.72rem; color: var(--awk-text-s); font-weight: 600; }

/* 필수 장비 */
.awk-req { display: flex; flex-direction: column; gap: 8px; }
.awk-req h4 { margin: 0; font-size: 0.82rem; font-weight: 900; }
.awk-req ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.awk-req li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--awk-border); border-radius: 10px; background: #fff; font-size: 0.84rem;
}
.awk-req li i { flex-shrink: 0; color: var(--awk-primary); }
.awk-req li .n { flex-grow: 1; font-weight: 700; min-width: 0; }
.awk-req li .id { flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: var(--awk-text-m); font-variant-numeric: tabular-nums; }

/* 확률 바 */
.awk-rate { display: flex; height: 32px; border-radius: 10px; overflow: hidden; border: 1px solid var(--awk-border-st); }
.awk-rate .ok, .awk-rate .ng {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.82rem; font-weight: 900; white-space: nowrap; overflow: hidden;
}
.awk-rate .ok { background: var(--awk-ok); color: #fff; }
.awk-rate .ng { background: #f3d9d4; color: var(--awk-danger-dk); }

/* 비용 */
.awk-costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 11px; }
.awk-cost {
  border: 1px solid var(--awk-border); border-radius: 12px; background: var(--awk-soft);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.awk-cost.warn { border-color: var(--awk-danger-bd); background: var(--awk-danger-bg); }
.awk-cost .k { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.05em; color: var(--awk-text-m); }
.awk-cost.warn .k { color: var(--awk-danger-dk); }
.awk-cost b { font-size: 1.1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.awk-cost.warn b { color: var(--awk-danger-dk); }
.awk-cost .d { font-size: 0.72rem; color: var(--awk-text-s); font-weight: 600; }

/* ── 코드 입력 ── */
.awk-field { display: flex; flex-direction: column; gap: 7px; }
.awk-field label { font-size: 0.8rem; font-weight: 800; }
.awk-load { display: flex; gap: 8px; flex-wrap: wrap; }
.awk-load input {
  flex: 1 1 220px; min-width: 0; padding: 11px 13px; border: 1.5px solid var(--awk-border-st);
  border-radius: 11px; background: #fff; color: var(--awk-text);
  font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.awk-load input:focus { outline: 2px solid var(--awk-accent); outline-offset: 1px; }
.awk-load button {
  flex-shrink: 0; padding: 11px 18px; border: none; border-radius: 11px;
  background: var(--awk-primary-dk); color: #fff; font-size: 0.86rem; font-weight: 900;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.awk-load button:hover:not(:disabled) { background: #3a2b0e; }
.awk-load button:disabled { opacity: 0.6; cursor: not-allowed; }
.awk-field .d { margin: 0; font-size: 0.73rem; color: var(--awk-text-s); font-weight: 600; line-height: 1.6; }

/* ── 불러온 코드 내용 ── */
.awk-code { border: 1.5px solid var(--awk-border-st); border-radius: 13px; background: #fff; overflow: hidden; }
.awk-code-head {
  padding: 10px 14px; border-bottom: 1px solid var(--awk-line); background: #f7f3e8;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.awk-code-head b { font-size: 0.82rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.awk-code-head b i { color: var(--awk-primary); }
.awk-code-head .v { font-size: 0.7rem; font-weight: 700; color: var(--awk-text-m); font-variant-numeric: tabular-nums; }
.awk-code-info {
  margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px 14px; border-bottom: 1px solid var(--awk-line);
}
.awk-code-info > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.awk-code-info dt { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.05em; color: var(--awk-text-m); }
.awk-code-info dd { margin: 0; font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.awk-code-info dd.ok { color: var(--awk-ok-dk); }
.awk-code-info dd.ng { color: var(--awk-danger-dk); }
.awk-code-grp { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; border-bottom: 1px solid var(--awk-line); }
.awk-code-grp:last-child { border-bottom: none; }
.awk-code-grp > span.t { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.05em; color: var(--awk-text-m); }
.awk-slots { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.awk-slots li {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  border: 1px solid #e2d8bf; border-radius: 9px; background: #fff; font-size: 0.8rem;
}
.awk-slots li.req { border-color: var(--awk-ok-bd); background: var(--awk-ok-bg); }
.awk-slots li.none { border-color: var(--awk-line); background: #faf8f3; }
.awk-slots li .no {
  flex-shrink: 0; width: 17px; text-align: center; font-size: 0.7rem;
  font-weight: 900; color: var(--awk-text-m); font-variant-numeric: tabular-nums;
}
.awk-slots li .n { flex-grow: 1; font-weight: 700; min-width: 0; }
.awk-slots li.req .n { font-weight: 900; color: var(--awk-ok-dk); }
.awk-slots li.none .n { font-weight: 600; color: #7a7060; }
.awk-tag-req {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; background: var(--awk-ok); color: #fff;
  font-size: 0.66rem; font-weight: 900; white-space: nowrap;
}
.awk-bag { display: flex; gap: 6px; flex-wrap: wrap; }
.awk-bag .chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  border: 1px solid var(--awk-border); border-radius: 999px; background: var(--awk-soft);
  font-size: 0.79rem; font-weight: 800; color: var(--awk-text-s);
}
.awk-bag .chip.req { border-color: var(--awk-ok-bd); background: var(--awk-ok-bg); color: var(--awk-ok-dk); }
.awk-bag .none { font-size: 0.78rem; font-weight: 600; color: var(--awk-text-m); }

/* ── 조건 검사 ── */
.awk-check { border: 1.5px solid var(--awk-ok-bd); border-radius: 13px; background: var(--awk-ok-bg); overflow: hidden; }
.awk-check.bad { border-color: var(--awk-danger-bd); background: var(--awk-danger-bg); }
.awk-check-head {
  padding: 10px 14px; border-bottom: 1px solid #cfe3d4;
  display: flex; align-items: center; gap: 9px;
}
.awk-check.bad .awk-check-head { border-bottom-color: var(--awk-danger-bd); }
.awk-check-head i { color: var(--awk-ok); font-size: 1rem; }
.awk-check.bad .awk-check-head i { color: var(--awk-danger); }
.awk-check-head b { font-size: 0.86rem; font-weight: 900; color: var(--awk-ok-dk); }
.awk-check.bad .awk-check-head b { color: var(--awk-danger-dk); }
.awk-check ul { margin: 0; padding: 9px 14px 12px; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.awk-check li { display: flex; align-items: flex-start; gap: 9px; }
.awk-check li > i { flex-shrink: 0; margin-top: 2px; font-size: 0.8rem; color: var(--awk-ok); }
.awk-check li.ng > i { color: var(--awk-danger-dk); }
.awk-check li .tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.awk-check li .tx b { font-size: 0.8rem; font-weight: 800; color: var(--awk-ok-dk); }
.awk-check li.ng .tx b { color: var(--awk-danger-dk); }
.awk-check li .tx span { font-size: 0.73rem; font-weight: 600; color: #3c5a42; }
.awk-check.bad li .tx span, .awk-check li.ng .tx span { color: var(--awk-text-s); }

/* ── 실행 ── */
.awk-go { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.awk-go-btn {
  width: 100%; padding: 15px 20px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #8d6a24, var(--awk-primary-dk)); color: #fff;
  font-size: 1rem; font-weight: 900; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: 0 4px 12px rgba(74, 56, 18, 0.26);
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.awk-go-btn i { color: #e8c878; }
.awk-go-btn:hover:not(:disabled) { filter: brightness(1.08); }
.awk-go-btn:disabled {
  background: #ece7db; color: #7a7060; box-shadow: none; cursor: not-allowed;
}
.awk-go-btn:disabled i { color: #b6ada1; }
.awk-warn {
  margin: 0; padding: 11px 13px; border: 1px solid var(--awk-danger-bd); border-radius: 11px;
  background: var(--awk-danger-bg); font-size: 0.76rem; font-weight: 600;
  color: var(--awk-text-s); line-height: 1.6;
}
.awk-warn b { color: var(--awk-danger-dk); }

/* ── 결과 ── */
.awk-res { border-radius: 14px; overflow: hidden; border: 1.5px solid var(--awk-ok-bd); background: #fff; }
.awk-res.bad { border-color: var(--awk-danger-bd); }
.awk-res-head {
  padding: 14px 18px; background: linear-gradient(135deg, var(--awk-ok), var(--awk-ok-dk));
  color: #fff; display: flex; align-items: center; gap: 11px;
}
.awk-res.bad .awk-res-head { background: linear-gradient(135deg, var(--awk-danger), var(--awk-danger-dk)); }
.awk-res-head i { font-size: 1.35rem; }
.awk-res-head .t { display: flex; flex-direction: column; gap: 1px; }
.awk-res-head .t span { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; color: #c9e6d0; }
.awk-res.bad .awk-res-head .t span { color: #f0cdc6; }
.awk-res-head .t b { font-size: 1.15rem; font-weight: 900; }
.awk-res-body { padding: 17px 18px; display: flex; flex-direction: column; gap: 14px; }
.awk-res-code {
  padding: 12px 13px; border: 1.5px solid var(--awk-ok-bd); border-radius: 11px; background: var(--awk-ok-bg);
  font-size: 0.8rem; font-weight: 700; color: #1f3d26; line-height: 1.65;
  word-break: break-all; font-variant-numeric: tabular-nums;
}
.awk-res-roll {
  display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--awk-border); border-radius: 11px; background: var(--awk-soft);
}
.awk-res-roll > span { display: flex; flex-direction: column; gap: 1px; }
.awk-res-roll .k { font-size: 0.67rem; font-weight: 900; color: var(--awk-text-m); }
.awk-res-roll b { font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.awk-res-btns { display: flex; gap: 9px; flex-wrap: wrap; }
.awk-res-btns button {
  flex: 1 1 140px; padding: 11px 14px; border-radius: 10px; font-size: 0.84rem;
  font-weight: 800; cursor: pointer;
}
.awk-res-btns .pri { border: none; background: var(--awk-ok); color: #fff; }
.awk-res-btns .sec { border: 1px solid var(--awk-border-st); background: #fff; color: var(--awk-primary-dk); }

/* ── 이력 ── */
.awk-log { border: 1px solid var(--awk-border); border-radius: 14px; background: #fff; overflow-x: auto; }
.awk-log table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.82rem; }
.awk-log th {
  padding: 11px 15px; text-align: left; font-size: 0.7rem; font-weight: 900;
  letter-spacing: 0.05em; color: var(--awk-text-s);
  background: var(--awk-soft); border-bottom: 1px solid var(--awk-border);
}
.awk-log td { padding: 11px 15px; border-bottom: 1px solid var(--awk-line); }
.awk-log tr:last-child td { border-bottom: none; }
.awk-log td.t { font-weight: 600; color: var(--awk-text-s); font-variant-numeric: tabular-nums; white-space: nowrap; }
.awk-log td.p { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.awk-kind {
  display: inline-block; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--awk-border-st);
  background: var(--awk-soft); color: var(--awk-text-s); font-size: 0.72rem; font-weight: 900; white-space: nowrap;
}
.awk-kind.success { border-color: var(--awk-ok-bd); background: var(--awk-ok-bg); color: var(--awk-ok-dk); }
.awk-kind.break { border-color: var(--awk-danger); background: var(--awk-danger-bg); color: var(--awk-danger-dk); }
.awk-kind.grant { border-color: var(--awk-accent); background: #fff8e8; color: var(--awk-primary); }
.awk-kind.restore { border-color: #8fb3d9; background: #eff5fb; color: #1f4f85; }

/* ── 토스트 ── */
.awk-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 13px 22px; border-radius: 12px; background: var(--awk-primary-dk); color: #fff;
  font-size: 0.88rem; font-weight: 800; z-index: 2000;
  box-shadow: 0 10px 28px rgba(30, 22, 8, 0.35);
}
.awk-toast.err { background: var(--awk-danger-dk); }

@media (max-width: 760px) {
  .awk { padding: 18px 14px 40px; }
  .awk-head h1 { font-size: 1.5rem; }
  .awk-col-l { border-right: none; border-bottom: 1px solid var(--awk-border); }
}
