/* [Web Beep] Google Emoji Pager - Authentic LCD Edition */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=VT323&display=swap');

:root {
  /* 📟 Google Emoji Colors */
  --body-color: #37474F;      /* 본체: 짙은 차콜 */
  --screen-bg: #64FFDA;       /* 액정: 형광 민트 */
  --screen-text: #004D40;     /* 글자: 짙은 틸 */
  --screen-dim: rgba(0,77,64,0.3); /* 꺼진 픽셀 색 (가독성을 위해 조금 더 진하게) */
  
  --btn-red: #D50000;         /* 빨강 버튼 */
  --btn-red-shadow: #9b0000;
  --btn-grey: #CFD8DC;        /* 회색 버튼 */
  --btn-grey-shadow: #90A4AE;
  --btn-yellow: #FBC02D;      /* 노란 버튼 */
  --btn-yellow-shadow: #F57F17;
  
  --radius-body: 28px;
  --radius-screen: 12px;
  --radius-btn: 25px;
}

* { box-sizing: border-box; }

body {
  background-color: #121212;
  font-family: 'Nunito', sans-serif;
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; margin: 0;
}

/* === 본체 === */
.device-body {
  width: 360px;
  background-color: var(--body-color);
  border-radius: var(--radius-body);
  padding: 20px 25px;
  box-shadow: 
    inset 2px 2px 5px rgba(255,255,255,0.1),
    inset -4px -4px 10px rgba(0,0,0,0.5),
    20px 20px 50px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  gap: 15px; 
  border: 2px solid rgba(0,0,0,0.2);
}

/* === 액정 화면 (LCD) === */
.device-screen {
  background-color: var(--screen-bg);
  color: var(--screen-text);
  border-radius: var(--radius-screen);
  height: 160px; 
  padding: 12px 15px;
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  box-shadow: inset 4px 4px 10px rgba(0,0,0,0.2);
  position: relative; 
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* 스캔라인 */
.device-screen::after {
  content: " ";
  display: block; position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,77,64,0.1) 50%);
  background-size: 100% 4px;
  pointer-events: none; z-index: 2;
}

/* [NEW] 암호 사전 오버레이 스타일 */
.help-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--screen-bg);
  color: var(--screen-text);
  z-index: 10;
  padding: 10px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 0;
  font-size: 1.3rem;
}

.help-overlay::-webkit-scrollbar { width: 4px; }
.help-overlay::-webkit-scrollbar-thumb { background: var(--screen-text); border-radius: 2px; }

.help-row {
  display: flex; 
  justify-content: space-between; 
  border-bottom: 1px dashed var(--screen-dim);
  padding: 2px 0;
}
.help-key { font-weight: bold; }
.help-val { opacity: 0.8; font-size: 1.1rem; }

/* === 메인 화면 (Hub) === */
.logo-area {
  flex-grow: 1; display: flex; flex-direction: column; 
  justify-content: center; align-items: center;
  text-align: center; z-index: 3;
  gap: 5px; 
}
.logo-text { font-size: 2.2rem; letter-spacing: 4px; margin: 0; line-height: 1; }
.logo-sub { font-size: 0.9rem; opacity: 0.6; margin-top: 2px; }

.big-input {
  background: transparent; border: 2px solid var(--screen-text);
  color: var(--screen-text); font-family: 'VT323', monospace;
  font-size: 1.6rem; 
  text-align: center; width: 100%; padding: 5px;
  border-radius: 8px; outline: none; margin-top: 5px; z-index: 3;
}
/* [복구됨] 입력창 플레이스홀더 색상 */
.big-input::placeholder { color: var(--screen-dim); }

/* === 삐삐 화면 (Pager) === */
.screen-header {
  display: flex; justify-content: space-between;
  font-size: 1rem; border-bottom: 2px solid var(--screen-text);
  padding-bottom: 2px; margin-bottom: 5px; z-index: 3;
  min-height: 20px;
}

.msg-indicator {
  position: absolute;
  top: 38px; left: 15px; 
  font-family: 'VT323', monospace;
  font-size: 2.2rem; line-height: 1;
  font-weight: bold; color: var(--screen-text);
  z-index: 5;
}

.display-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column; 
  justify-content: center; 
  align-items: center;     
  z-index: 3;
  width: 100%;
}

.last-msg {
  font-size: 2rem; line-height: 1.2; letter-spacing: 2px;
  word-break: break-all; padding: 0 10px;
  text-align: center; width: 100%;
  max-height: 60px; 
  overflow: hidden; 
  text-shadow: 1px 1px 0px var(--screen-dim);
}

.code-meaning {
  font-size: 1.2rem;
  margin-top: 5px;
  opacity: 0.7;
  min-height: 1.2rem; 
}

/* 하단 입력창 스타일 */
.cmd-input {
  background: none; border: none; border-top: 2px dashed var(--screen-text);
  color: var(--screen-text); font-family: 'VT323', monospace;
  font-size: 1.4rem; width: 100%; padding: 8px 0;
  outline: none; z-index: 3; margin-top: 2px;
}
/* [복구됨] 입력창 플레이스홀더 색상 (Number Only 문구) */
.cmd-input::placeholder { color: var(--screen-dim); opacity: 1; }

.antenna-icon { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.bar { width: 3px; background-color: var(--screen-dim); }
.bar1 { height: 25%; } .bar2 { height: 50%; } 
.bar3 { height: 75%; } .bar4 { height: 100%; }

.linked .bar { background-color: var(--screen-text); }
.no-signal { font-weight: bold; color: var(--screen-dim); line-height: 1; }
.linked .no-signal { display: none; }

/* 버튼 컨트롤 */
.device-controls { display: flex; justify-content: space-between; gap: 10px; padding: 0 5px; }
.btn {
  flex: 1; height: 45px; border: none; border-radius: var(--radius-btn);
  font-weight: 800; font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
  position: relative; top: 0; display: flex; align-items: center; justify-content: center;
}
.btn:active { top: 5px; box-shadow: none; }

.btn-grey { background: var(--btn-grey); color: #455A64; box-shadow: 0 5px 0 var(--btn-grey-shadow); }
.btn-red { background: var(--btn-red); color: white; box-shadow: 0 5px 0 var(--btn-red-shadow); }
.btn-yellow { background: var(--btn-yellow); color: #37474F; box-shadow: 0 5px 0 var(--btn-yellow-shadow); }

/* 애니메이션 */
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg-blink { animation: msg-flash 0.5s steps(2, start) 4; }
@keyframes msg-flash { 50% { opacity: 0; } }

/* 검색 입력창 */
.search-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  background-color: rgba(0, 77, 64, 0.1); /* 약간 어두운 민트 */
  border: 2px solid var(--screen-text);
  color: var(--screen-text);
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  border-radius: 4px;
  outline: none;
}
.search-input::placeholder {
  color: var(--screen-dim);
}

/* 클릭 가능한 카테고리 헤더 */
.cat-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2px;
  border-bottom: 1px dotted var(--screen-dim);
  user-select: none; /* 드래그 방지 */
}
.cat-header:hover {
  background-color: rgba(0, 77, 64, 0.05);
}

/* 화살표 아이콘 */
.toggle-icon {
  font-size: 0.8rem;
  transition: transform 0.2s;
}
.cat-header.active .toggle-icon {
  transform: rotate(180deg); /* 열리면 회전 */
}

/* 카테고리 내용 (기본 숨김) */
.cat-content {
  display: none; /* 기본적으로 닫혀있음 */
  padding-left: 5px;
  margin-bottom: 10px;
  border-left: 2px solid var(--screen-dim);
}
.cat-header.active + .cat-content {
  display: block; /* 활성화되면 보임 */
}
