/* =====================================================================
 *  signage.css — 승강장 승객용 안내 디스플레이 (대형 화면 / 키오스크)
 *  "Obsidian Console" 프리미엄 테마 · 대형화·고대비 재구성
 * ===================================================================== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --bg: #162134;
  --bg-2: #223048;
  --panel-grad-a: rgba(255, 255, 255, 0.07);
  --panel-grad-b: rgba(255, 255, 255, 0.025);
  --line: rgba(170, 196, 224, 0.18);
  --line-strong: rgba(170, 196, 224, 0.3);
  --text: #eef3fa;
  --muted: #9aabc0;
  --accent: #5aa0f0;
  --elev: #5aa0f0;
  --stair: #2fd6a0;
  --warn: #e6b45c;
  --gold: #e9cd94;
  --danger: #f08a8a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--text);
  overflow: hidden;
  letter-spacing: -0.01em;
  background:
    radial-gradient(1500px 760px at 76% -16%, rgba(53, 236, 173, 0.16) 0%, transparent 54%),
    radial-gradient(1300px 820px at 10% 6%, rgba(107, 179, 255, 0.18) 0%, transparent 56%),
    radial-gradient(1000px 1000px at 50% 118%, rgba(233, 205, 148, 0.09) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 62%);
  -webkit-font-smoothing: antialiased;
}

.signage {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 1.4vh, 20px);
  padding: clamp(14px, 2.2vh, 30px) clamp(18px, 2.4vw, 42px);
}

/* 공통 글래스 패널 믹스인 효과 */
.sg-verdict, .sg-cmp, .sg-shaftbox, .sg-bottom {
  background: linear-gradient(165deg, var(--panel-grad-a), var(--panel-grad-b));
  border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---------------- 상단 바 ---------------- */
.sg-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.sg-brand { display: flex; align-items: center; gap: clamp(10px, 1vw, 18px); }
.sg-logo {
  font-size: clamp(26px, 2.6vw, 44px);
  width: clamp(48px, 4vw, 74px); height: clamp(48px, 4vw, 74px);
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--elev), var(--stair));
  border-radius: 18px; color: #06101d; font-weight: 900;
  box-shadow: 0 10px 34px -8px rgba(53, 236, 173, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.sg-title h1 {
  font-size: clamp(20px, 2vw, 34px); letter-spacing: -0.6px; font-weight: 800; color: #f2f6fc;
}
.sg-title p { font-size: clamp(12px, 1vw, 16px); color: var(--muted); margin-top: 4px; }

.sg-clockbox { text-align: right; }
.sg-place {
  font-size: clamp(13px, 1.1vw, 18px); color: var(--muted);
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
.sg-place b { color: var(--text); font-weight: 700; }
.sg-live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--stair); box-shadow: 0 0 12px var(--stair);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.82); } }
.sg-clock {
  font-size: clamp(28px, 3vw, 52px); font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: 1px; margin-top: 2px; color: #f2f6fc;
}

/* ---------------- 메인 그리드 ---------------- */
.sg-main {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: clamp(12px, 1.6vw, 26px);
  min-height: 0;
}
.sg-left { display: grid; grid-template-rows: auto 1fr; gap: clamp(12px, 1.6vh, 22px); min-height: 0; }

/* 넛지 메인 카드 */
.sg-verdict {
  border-radius: 26px; padding: clamp(18px, 2.6vh, 38px) clamp(20px, 2.4vw, 46px);
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: clamp(16px, 2vw, 34px);
  transition: border-color .5s, box-shadow .5s;
}
.sg-verdict::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(680px 340px at 8% -10%, var(--vcol, transparent) 0%, transparent 62%);
  opacity: 0.2; transition: background .5s; pointer-events: none;
}
.sg-vicon {
  font-size: clamp(48px, 6vw, 104px); line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.5));
}

/* =====================================================================
 *  커스텀 승강기: 산업용 유리 캐빈 + 권상기(트랙션) 유닛
 *  오리지널 디자인 · 실시간 상태 연동 · CSS 변수로 커스터마이즈/재사용 가능
 * ===================================================================== */
.sg-elevator {
  --elv-w: clamp(124px, 13.5vw, 188px);
  --glass: rgba(170, 212, 255, 0.10);
  --glass-2: rgba(170, 212, 255, 0.05);
  --glass-edge: rgba(205, 231, 255, 0.55);
  --steel-l: #aebdce;
  --steel-d: #5c6b7d;
  --cable: rgba(188, 203, 222, 0.85);
  --led: #d8f1ff;
  --elv-door-ms: .95s;
  position: relative; flex-shrink: 0; width: var(--elv-w);
  display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .45));
}

/* 권상기(트랙션 머신) + 도르래 */
.elv-machine {
  position: relative; width: 86%; height: clamp(20px, 2.2vw, 30px);
  display: flex; align-items: center; justify-content: center; z-index: 3;
}
.elv-machine::before {
  content: ""; position: absolute; left: 0; right: 0; top: 42%; height: 42%; border-radius: 4px;
  background: linear-gradient(180deg, var(--steel-l), var(--steel-d));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 7px rgba(0, 0, 0, .45);
}
.elv-sheave {
  position: relative; z-index: 2;
  width: clamp(15px, 1.6vw, 22px); height: clamp(15px, 1.6vw, 22px); border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d4dde8, #71808f 68%, #46525f);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .22), 0 2px 5px rgba(0, 0, 0, .5);
}
.elv-sheave::after {
  content: ""; position: absolute; inset: 40%; border-radius: 50%; background: #28313d;
}

/* 승강로(철골 프레임) */
.elv-hoistway {
  position: relative; width: 100%; aspect-ratio: 3 / 4.15; margin-top: -2px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(34, 48, 68, .45), rgba(18, 27, 40, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.elv-rail {
  position: absolute; top: 2%; bottom: 2%; width: 4px; z-index: 1; border-radius: 2px;
  background: linear-gradient(90deg, var(--steel-d), var(--steel-l), var(--steel-d));
}
.elv-rail.left { left: 6%; }
.elv-rail.right { right: 6%; }

/* 와이어 로프 */
.elv-cable {
  position: absolute; top: 0; width: 2px; z-index: 1;
  background: linear-gradient(180deg, var(--cable), rgba(188, 203, 222, .25));
}
.elv-cable.c1 { left: 34%; height: 21%; }
.elv-cable.c2 { left: 44%; height: 21%; }
.elv-cable.cwt { right: 20.5%; height: 40%; }

/* 균형추 */
.elv-counterweight {
  position: absolute; right: 16%; top: 40%; width: 11px; height: 19%; z-index: 1; border-radius: 2px;
  background: repeating-linear-gradient(0deg, #52627a 0 3px, #3a4756 3px 6px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .08);
}

/* 유리 캐빈 */
.elv-cabin {
  position: absolute; left: 13%; right: 30%; top: 21%; bottom: 5%;
  border-radius: 7px; overflow: hidden; z-index: 2;
  background: linear-gradient(135deg, var(--glass), var(--glass-2));
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  box-shadow: inset 0 0 18px rgba(120, 180, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .3),
    0 4px 14px rgba(0, 0, 0, .4);
}
.elv-cabin::before {
  content: ""; position: absolute; top: 0; left: 0; width: 45%; height: 100%; z-index: 4;
  background: linear-gradient(105deg, rgba(255, 255, 255, .22), transparent 70%); pointer-events: none;
}

/* LED 인디케이터 (캐빈 상단) */
.elv-indicator {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%); z-index: 5;
  min-width: 58%; height: clamp(15px, 1.5vw, 20px); padding: 0 5px;
  background: rgba(6, 12, 20, .82); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: "Consolas", ui-monospace, monospace;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}
.elv-arrow, .elv-floor { color: var(--led); text-shadow: 0 0 6px var(--led); font-weight: 800; line-height: 1; }
.elv-arrow { font-size: clamp(9px, .95vw, 13px); }
.elv-floor { font-size: clamp(11px, 1.2vw, 16px); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.elv-arrow.up { color: #67e6a6; text-shadow: 0 0 6px #67e6a6; }
.elv-arrow.down { color: #6bb3ff; text-shadow: 0 0 6px #6bb3ff; }

/* 내부 + 탑승자 (유리 너머로 비침) */
.elv-interior {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(40, 52, 68, .4) 0%, rgba(16, 22, 32, .5) 100%);
}
.elv-rider {
  font-size: clamp(22px, 2.5vw, 38px); margin-bottom: 7%; opacity: .55; transition: opacity .4s;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4));
}

/* 유리 도어 2짝 (반투명) */
.elv-door {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 3;
  background: linear-gradient(100deg, rgba(190, 224, 255, .26), rgba(150, 195, 240, .14) 50%, rgba(190, 224, 255, .26));
  border-bottom: 2px solid rgba(120, 160, 200, .3);
  transition: transform var(--elv-door-ms) cubic-bezier(.65, .02, .3, 1);
}
.elv-door.left { left: 0; box-shadow: inset -2px 0 4px rgba(0, 0, 0, .14), inset 2px 0 2px rgba(255, 255, 255, .3); }
.elv-door.right { right: 0; box-shadow: inset 2px 0 4px rgba(0, 0, 0, .14), inset -2px 0 2px rgba(255, 255, 255, .3); }
.elv-seam {
  position: absolute; top: 6%; bottom: 6%; left: 50%; width: 1.5px; z-index: 4; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .4), transparent); transition: opacity .3s;
}

/* 문 열림 상태 */
.sg-elevator.open .elv-door.left { transform: translateX(-100%); }
.sg-elevator.open .elv-door.right { transform: translateX(100%); }
.sg-elevator.open .elv-seam { opacity: 0; }
.sg-elevator.open .elv-rider { opacity: .95; }
.sg-vtext { position: relative; z-index: 1; }
.sg-vhead {
  font-size: clamp(24px, 3.2vw, 56px); font-weight: 900; letter-spacing: -1.4px;
  line-height: 1.08; color: var(--vcol, var(--text));
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.sg-vmsg {
  font-size: clamp(14px, 1.5vw, 26px); color: var(--text); opacity: .86;
  margin-top: clamp(6px, 1vh, 14px); line-height: 1.42; max-width: 30ch; font-weight: 500;
}
/* 판정별 색상 */
.sg-verdict.v-stair-strong { --vcol: var(--stair); border-color: rgba(53,236,173,.55);
  box-shadow: 0 0 80px rgba(53,236,173,.18) inset, 0 24px 60px -24px rgba(0,0,0,.8); }
.sg-verdict.v-stair { --vcol: var(--stair); border-color: rgba(53,236,173,.38); }
.sg-verdict.v-elevator { --vcol: var(--elev); border-color: rgba(107,179,255,.42); }
.sg-verdict.v-neutral { --vcol: var(--warn); border-color: rgba(255,196,87,.34); }

/* 비교 카드 2개 + 델타 */
.sg-compare {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: clamp(10px, 1.4vw, 22px); align-items: stretch; min-height: 0;
}
.sg-cmp {
  border-radius: 22px;
  padding: clamp(14px, 2vh, 28px); display: flex; flex-direction: column;
  justify-content: center; gap: 6px; transition: border-color .4s, transform .4s, box-shadow .4s;
}
.sg-cmp .cmp-ico { font-size: clamp(24px, 2.4vw, 40px); filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.sg-cmp .cmp-label { font-size: clamp(13px, 1.2vw, 20px); color: var(--muted); font-weight: 600; }
.sg-cmp .cmp-time {
  font-size: clamp(40px, 6vw, 108px); font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -3px;
}
.sg-cmp .cmp-time small { font-size: 0.4em; font-weight: 700; margin-left: 5px; color: var(--muted); letter-spacing: 0; }
.sg-cmp .cmp-sub { font-size: clamp(12px, 1vw, 16px); color: var(--muted); margin-top: 4px; }
.sg-cmp.elev .cmp-ico, .sg-cmp.elev .cmp-time { color: var(--elev); }
.sg-cmp.stair .cmp-ico, .sg-cmp.stair .cmp-time { color: var(--stair); }
.sg-cmp.win { transform: translateY(-5px); }
.sg-cmp.elev.win { border-color: var(--elev);
  box-shadow: 0 0 0 1px var(--elev) inset, 0 26px 60px -26px rgba(107,179,255,.7); }
.sg-cmp.stair.win { border-color: var(--stair);
  box-shadow: 0 0 0 1px var(--stair) inset, 0 26px 60px -26px rgba(53,236,173,.7); }

.sg-delta {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-width: clamp(70px, 8vw, 130px);
}
.sg-delta .d-vs { font-size: clamp(13px, 1.1vw, 18px); color: var(--muted); font-weight: 800; letter-spacing: 1px; }
.sg-delta .d-val {
  font-size: clamp(20px, 2vw, 34px); font-weight: 900; font-variant-numeric: tabular-nums;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
}
.sg-delta .d-val.stair { color: var(--stair); background: rgba(53,236,173,.14); box-shadow: 0 0 0 1px rgba(53,236,173,.3) inset; }
.sg-delta .d-val.elev { color: var(--elev); background: rgba(107,179,255,.14); box-shadow: 0 0 0 1px rgba(107,179,255,.3) inset; }
.sg-delta .d-cap { font-size: clamp(11px, 0.9vw, 15px); color: var(--muted); }

/* ---------------- 우측: 라이브 승강기 + 목적층 ---------------- */
.sg-right { display: grid; grid-template-rows: 1fr auto; gap: clamp(12px, 1.6vh, 22px); min-height: 0; }
.sg-shaftbox {
  border-radius: 22px;
  padding: clamp(12px, 1.6vh, 22px); display: flex; flex-direction: column; min-height: 0;
}
.sg-shaftbox h2 {
  font-size: clamp(13px, 1.1vw, 18px); font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.sg-shaftbox h2 .tag {
  font-size: clamp(10px, .8vw, 13px); color: var(--muted); font-weight: 500;
  background: rgba(255,255,255,.05); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
#sgShaft {
  flex: 1; width: 100%; min-height: 0; border-radius: 14px;
  background: radial-gradient(500px 360px at 50% 0%, rgba(107,179,255,.08), transparent 70%), #101b2c;
  border: 1px solid var(--line);
}

/* 목적층 키패드 */
.sg-keypad .kp-head {
  font-size: clamp(13px, 1.1vw, 18px); color: var(--muted); font-weight: 700;
  margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center;
}
.sg-keypad .kp-head b { color: var(--text); }
.kp-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: clamp(5px, .5vw, 9px);
}
.kp-key {
  aspect-ratio: 1 / 0.82; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); color: var(--text); font-weight: 800;
  font-size: clamp(13px, 1.1vw, 20px); cursor: pointer; transition: all .16s;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.kp-key:hover { background: rgba(107, 179, 255, 0.12); border-color: var(--accent); transform: translateY(-2px); }
.kp-key.sel {
  background: linear-gradient(145deg, var(--elev), var(--stair));
  color: #06101d; border-color: transparent; transform: scale(1.05);
  box-shadow: 0 10px 26px -8px rgba(53,236,173,.5), inset 0 1px 0 rgba(255,255,255,.4);
}
.kp-key.board { outline: 2px dashed var(--line-strong); outline-offset: -4px; }

/* ---------------- 하단 티커 ---------------- */
.sg-bottom {
  display: flex; align-items: center; gap: clamp(12px, 1.6vw, 28px);
  border-radius: 20px;
  padding: clamp(10px, 1.4vh, 18px) clamp(16px, 2vw, 32px); flex-wrap: wrap;
}
.sg-metric { display: flex; align-items: baseline; gap: 8px; }
.sg-metric b {
  font-size: clamp(20px, 2vw, 34px); font-weight: 900; font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.sg-metric span { font-size: clamp(11px, 1vw, 16px); color: var(--muted); }
.sg-metric.kwh b, .sg-metric.co2 b { color: var(--stair); }
.sg-metric.kcal b { color: var(--warn); }
.sg-metric.cnt b { color: var(--accent); }
.sg-sep { width: 1px; height: 32px; background: var(--line-strong); }
.sg-foot-note {
  margin-left: auto; font-size: clamp(10px, .9vw, 14px); color: var(--muted);
  text-align: right; line-height: 1.5;
}
.sg-foot-note a { color: var(--accent); text-decoration: none; font-weight: 600; }
.sg-foot-note a:hover { text-decoration: underline; }

/* 데모/모드 토글 */
.sg-modebtn {
  font-size: clamp(11px, .9vw, 14px); color: var(--muted); font-family: inherit;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .16s; font-weight: 600;
}
.sg-modebtn:hover { color: var(--text); border-color: var(--accent); }
.sg-modebtn.on {
  color: #06101d; background: linear-gradient(145deg, #5cf0c2, var(--stair));
  border-color: transparent; font-weight: 800;
  box-shadow: 0 8px 20px -8px rgba(53,236,173,.5);
}

/* 세로 화면(포트레이트) 대응 */
@media (max-aspect-ratio: 1/1) {
  .sg-main { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .sg-right { grid-template-rows: 240px auto; }
}
@media (max-width: 640px) {
  .sg-compare { grid-template-columns: 1fr; }
  .sg-delta { flex-direction: row; min-width: 0; }
  .kp-grid { grid-template-columns: repeat(5, 1fr); }
}
