:root {
  --bg: #0e0e10;
  --fg: #f5f5f7;
  --muted: #888;
  --accent: #4D96FF;
  --field: #1a1a1d;
  --border: #2a2a2e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR",
               -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

main {
  min-height: 100%;
  display: flex;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top, 16px), 24px)
           24px
           max(env(safe-area-inset-bottom, 16px), 24px);
  gap: 12px;
}

.screen.hidden, .toast.hidden { display: none; }

/* nickname screen */
#nickname-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
}
#nickname-screen h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
}
#nickname-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

/* message screen */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
#current-nickname {
  font-weight: 700;
  font-size: 16px;
}
#message-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
#message-input {
  flex: 1;
  min-height: 120px;
  font-size: 18px;
  resize: none;
}

/* shared inputs */
input, textarea {
  font: inherit;
  background: var(--field);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus { border-color: var(--accent); }

button {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { opacity: 0.5; }

button.link {
  background: none;
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  padding: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  pointer-events: none;
}
