:root{
  --bg:#0f1220; --card:#171a2b; --muted:#9aa3c7; --text:#e8ecff; --accent:#8ad1ff; --accent2:#ffd98a; --danger:#ff7a7a;
  --grid:#1d2238; --radius:18px; --good:#6be48a;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0; background:radial-gradient(1200px 700px at 50% -10%, #1b1f35, var(--bg));
  color:var(--text); font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans KR",Arial,sans-serif;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}

/* ✅ 데스크탑에서도 최대 폭을 '태블릿'로 제한 */
.app{width:min(768px,100%); height:100%; padding:16px;}

.top{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px}
.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:36px; height:36px; border-radius:9px;
  background: #232742 url('/df.png') center/cover no-repeat;
  position:relative; overflow:hidden;
  box-shadow:0 6px 14px rgba(0,0,0,.25);
  border:1px solid #2a2f4f;
}
/* 기존 스트라이프를 가리던 오버레이 제거 */
.logo::after{ content:none; }

.h1{font-weight:800; letter-spacing:.2px}

.season{background:linear-gradient(180deg,#202644,var(--card)); border:1px solid #232a4a; padding:8px 12px; border-radius:12px; color:var(--muted); font-size:14px}
.season b{color:var(--accent2)}

/* 기본(태블릿) 레이아웃: 두 컬럼 */
.layout{display:grid; grid-template-columns:1.2fr .9fr; gap:14px; height:calc(100% - 60px)}

.panel{background:linear-gradient(180deg,#171a2b 0,#14182a 100%); border:1px solid #212541; border-radius:var(--radius); box-shadow:0 10px 24px rgba(0,0,0,.25); overflow:hidden}

/* Game stage */
.stage{position:relative; height:100%;}
.header{display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid #22284b; background:linear-gradient(180deg,#1b2038,#161a2b); position:relative; z-index:2}
.timer{font:700 18px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace}
.status{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:14px}
.status .dot{width:10px; height:10px; border-radius:99px; background:var(--danger)}
.status.good .dot{background:var(--good)}

.grid{position:absolute; inset:0; background:
  linear-gradient(transparent 23px, var(--grid) 24px) 0 0/ 100% 24px,
  linear-gradient(90deg, transparent 23px, var(--grid) 24px) 0 0/ 24px 100%;
  opacity:.25; z-index:0}

.stairs-wrap{position:absolute; inset:0; padding:5px; display:flex; z-index:1}
.stairs
{position:relative; margin:auto; width:min(520px, 92%); height:min(520px, 92%); 
    /* background:linear-gradient(180deg,#111525,#0c1020); 
    border:1px solid #1b2144; 
    border-radius:16px; */
     overflow:hidden}
.stairs .path{position:absolute; inset:0;}
.step{position:absolute; width:46px; height:28px; background:linear-gradient(180deg,#2a2f55,#20264a); border:1px solid #30386b; border-bottom-color:#171c3a; border-radius:6px; box-shadow:0 6px 0 #131732; transform:translateZ(0)}
.step.good{outline:2px solid rgba(139,209,255,.6)}
.you{position:absolute; width:40px; height:40px; border-radius:8px; background:linear-gradient(180deg,#ff9f6e,#ff7c6e); border:2px solid #5c2330; box-shadow:0 8px 18px rgba(255,124,110,.25)}
.you::after{content:"🏃"; position:absolute; inset:0; display:grid; place-items:center; font-size:26px}

.finish{position:absolute; top:8px; right:8px; background:#20314d; border:1px solid #35507b; color:#cbe2ff; border-radius:10px; padding:4px 8px; font-size:13px}

/* Controls */
.controls{display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px; border-top:1px solid #22284b; background:linear-gradient(180deg,#14182a,#12162a); position:relative; z-index:3}
.btn{cursor:pointer; border:none; border-radius:14px; padding:20px 12px; font-weight:700; color:#0d1224; background:linear-gradient(180deg,#8ad1ff,#6ebdff); box-shadow:0 8px 18px rgba(106,177,255,.35);}
.btn:active{transform:translateY(1px)}
.btn.alt{background:linear-gradient(180deg,#ffd98a,#ffbd6e)}
.btn.ghost{background:transparent; color:var(--text); border:1px dashed #2a325b; box-shadow:none}
.btn.block{grid-column:1/3}

/* Right column: player + board */
.right{display:flex; flex-direction:column}
.card{border-bottom:1px solid #22284b; padding:12px 14px}
.card:last-child{border-bottom:none}
.card h3{margin:0 0 8px 0; font-size:16px}
.muted{color:var(--muted); font-size:13px}
.row{display:flex; gap:8px; align-items:center}
input,select{background:#10142a; color:var(--text); border:1px solid #2a325b; border-radius:12px; padding:10px 12px; outline:none; width:100%}

.lead{max-height:240px; overflow:auto; border-radius:12px; border:1px solid #242b4d}
.lead table{width:100%; border-collapse:collapse; font-size:14px}
.lead th,.lead td{padding:8px 10px; border-bottom:1px solid #20264a}
.lead tr:nth-child(1) td{background:rgba(255,217,138,.08)}
.lead tr:nth-child(2) td{background:rgba(138,209,255,.07)}
.lead tr:nth-child(3) td{background:rgba(107,228,138,.07)}

/* Modals */
.modal{position:fixed; inset:0; background:rgba(5,7,16,.75); display:none; align-items:center; justify-content:center; z-index:999}
.dialog{width:min(520px,92%); background:linear-gradient(180deg,#171b30,#14182a); border:1px solid #222a4d; border-radius:16px; box-shadow:0 20px 40px rgba(0,0,0,.4)}
.dialog .hd{display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid #22284b}
.dialog .bd{padding:16px 14px}

.toast{position:fixed; bottom:16px; left:50%; transform:translateX(-50%); background:rgba(20,24,42,.9); border:1px solid #2e365f; color:#cfe1ff; padding:10px 14px; border-radius:12px; display:none; z-index:1000}

#btnStep{
    width:48%;
    margin-right:12px;
}
#btnTurn{
     width:48%;
}
.bar-start{
    width:100%;

}
#btnStart{
    width:100%;
}
.bar-actions{
    width:100%;
}
#pfSave, #rankClose, #modalClose{
    border-radius: 5px;
    padding: 9px 12px;
    background: linear-gradient(180deg,#8ad1ff,#6ebdff);
    box-shadow: 0 8px 18px rgba(106,177,255,.35);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-weight: 700;
    color: #0d1224;
}
/* ✅ 모바일(≤768px): 오른쪽 패널 숨김, 한 컬럼 */
@media (max-width: 768px){
  .layout{grid-template-columns:1fr; height:calc(100% - 60px)}
  .right{display:none !important;}
  .app{padding:5px}
  .stairs{width:100%; height:100%;}
  .controls{grid-template-columns:1fr 1fr;}
  .season{display:none !important;}
  
}
