/* Blackgold Adventure — 공통 스타일 (모바일 우선, 빌드리스) */
:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #6b7690;
  --primary: #4f7cff;
  --primary-d: #3a63e0;
  --danger: #e5484d;
  --ok: #1a7f37;
  --line: #dde4f0;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(40, 60, 120, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100dvh; }

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  min-height: 100dvh;
}
.screen.center {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.muted { color: var(--muted); }
.text-center { text-align: center; }

.brand { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.brand .emoji { margin-right: 6px; }
.subtitle { color: var(--muted); margin-top: 6px; }

.logo-spin { font-size: 3rem; animation: float 2.2s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .95rem; }
input[type=text], input[type=password], input[type=tel] {
  width: 100%; font-size: 1.05rem; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fbfcfe;
}
input:focus { outline: none; border-color: var(--primary); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; font-size: 1.05rem; font-weight: 700;
  padding: 14px 18px; border-radius: 12px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .05s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-text { background: none; border: none; color: var(--muted); width: auto; padding: 8px; font-weight: 600; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; }

.app-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.app-head .brand { font-size: 1.2rem; }

/* 프로필 그리드 */
.profiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.profile {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .08s ease, border-color .15s ease; position: relative;
}
.profile:hover { border-color: var(--primary); transform: translateY(-2px); }
.profile .face { font-size: 2.6rem; line-height: 1; }
.profile .name { margin-top: 8px; font-weight: 700; }
.profile .lock { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.profile.add { display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-style: dashed; color: var(--muted); }
.profile.add .face { color: var(--primary); }
.profile .del { position: absolute; top: 6px; right: 8px; font-size: .85rem; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 4px; }

/* 이모지 선택 */
.emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.emoji-grid button { font-size: 1.5rem; padding: 8px 0; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; }
.emoji-grid button.sel { border-color: var(--primary); background: #eef3ff; }

/* PIN 패드 */
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); }
.pin-dots .dot.on { background: var(--primary); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 280px; margin: 0 auto; }
.keypad button { font-size: 1.5rem; font-weight: 700; padding: 16px 0; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.keypad button:active { background: #eef3ff; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }

/* 과목 카드 (허브) */
.subjects { display: grid; gap: 14px; margin-top: 18px; }
.subject { display: flex; align-items: center; gap: 14px; padding: 18px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.subject .ic { font-size: 2rem; }
.subject .meta { flex: 1; }
.subject .meta .t { font-weight: 800; }
.subject .meta .lv { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.subject .soon { font-size: .8rem; color: var(--muted); background: #f1f4fb; padding: 4px 10px; border-radius: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #2a3656; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 50; max-width: 88vw; text-align: center;
}
.err { color: var(--danger); font-size: .9rem; margin-top: 8px; min-height: 1.1em; }
