:root {
  --bg: #0c0c0d;
  --fg: #f2f2f4;
  --muted: #8a8a90;
  --accent: #e63c3c;
  --pill: #1c1c1f;
  --pill-border: #2c2c30;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  overscroll-behavior: none;
}

/* ── 최상단 검은 사각형 바 ─────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(22px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: #000;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 상단 바 안의 표시 점은 사용하지 않음(깨끗한 검은 바 유지) */
#recDot { display: none; }
@keyframes blink { 50% { opacity: .35; } }

/* ── 메인 ─────────────────────────────────────────── */
#main {
  height: 100%;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 24px 40px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
}
#timer {
  font-size: 44px; font-variant-numeric: tabular-nums;
  letter-spacing: 2px; font-weight: 300;
}
#hint { color: var(--muted); font-size: 13px; text-align: center; max-width: 260px; }

#recBtn {
  position: relative;
  width: 160px; height: 160px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
#recBtn .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid #333;
}
#recBtn .core {
  width: 118px; height: 118px; border-radius: 50%;
  background: var(--accent);
  transition: border-radius .18s, width .18s, height .18s;
}
body.recording #recBtn .core {
  width: 62px; height: 62px; border-radius: 16px;   /* 녹음 중: 정지(사각) 모양 */
}

.row { display: flex; gap: 12px; }
.pill {
  background: var(--pill); color: var(--fg);
  border: 1px solid var(--pill-border);
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; cursor: pointer;
}
.pill:active { background: #262629; }

#status { color: var(--muted); font-size: 12px; min-height: 16px; text-align: center; }

/* ── 녹음 목록 패널 ───────────────────────────────── */
.panel {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #1c1c1f; font-size: 17px;
}
.x { background: none; border: none; color: var(--fg); font-size: 18px; cursor: pointer; }
#recordings { overflow-y: auto; padding: 8px 14px 32px; }

.item {
  background: #151517; border: 1px solid #222;
  border-radius: 12px; padding: 12px 14px; margin: 10px 0;
}
.item .name { font-size: 14px; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.item audio { width: 100%; margin-top: 10px; }
.item .actions { display: flex; gap: 10px; margin-top: 8px; }
.item .actions a, .item .actions button {
  font-size: 13px; color: var(--fg); background: #222; border: none;
  padding: 7px 12px; border-radius: 8px; text-decoration: none; cursor: pointer;
}
.item .actions .del { background: #3a1d1d; color: #ff9b9b; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }

/* ── 위장 검은 화면 ───────────────────────────────── */
#stealth {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: flex; align-items: flex-start; justify-content: center;
}
#stealthRecDot {
  position: absolute; top: calc(8px + env(safe-area-inset-top, 0px));
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); opacity: .5;
  animation: blink 1.6s infinite;
}
#stealthHelp {
  position: absolute; bottom: 36px; color: #cfcfcf; font-size: 13px;
  opacity: 0; transition: opacity .8s ease;
  pointer-events: none;
}

.hidden { display: none !important; }
