* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #0f0f10;
  color: #e0e0e0;
  font-family: -apple-system, 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.5;
}

header {
  padding: 16px 24px;
  border-bottom: 1px solid #2a2a2c;
  background: #18181a;
}

header h1 { margin: 0 0 4px; font-size: 18px; color: #fff; }

.status {
  font-size: 12px;
  color: #888;
}
.status.ready { color: #4caf50; }
.status.error { color: #f44336; }

main {
  max-width: 880px;
  margin: 24px auto;
  padding: 0 24px;
}

.card {
  background: #18181a;
  border: 1px solid #2a2a2c;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.card.hidden { display: none; }

.card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #fff;
}
.card h3 {
  margin: 20px 0 8px;
  font-size: 14px;
  color: #aaa;
  font-weight: normal;
}

.hint {
  font-size: 12px;
  color: #888;
  margin: 6px 0 10px;
}
.hint.inline { display: inline-block; margin-left: 8px; }

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-row input {
  flex: 1;
}

input[type="text"],
input[type="file"],
textarea {
  background: #0f0f10;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

input[type="text"]:focus,
textarea:focus {
  outline: 1px solid #1a73e8;
  border-color: #1a73e8;
}

button {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}
button:hover:not(:disabled) { background: #1565d0; }
button:disabled { background: #333; color: #777; cursor: not-allowed; }

.emote-form .form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.emote-form label {
  width: 110px;
  font-size: 13px;
  color: #aaa;
  flex-shrink: 0;
}
.emote-form input[type="text"],
.emote-form input[type="file"] {
  flex: 1;
  max-width: 300px;
}

/* 이모지 픽커 */
.emoji-picker-wrap {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  max-width: 300px;
}
.emoji-picker-wrap input[type="text"] {
  flex: 1;
  cursor: pointer;
  background: #0f0f10;
}
.picker-btn {
  padding: 8px 12px;
  font-size: 13px;
  background: #2a2a2c;
  white-space: nowrap;
}
.picker-btn:hover { background: #3a3a3c; }
.picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100;
  background: #18181a;
  border: 1px solid #2a2a2c;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
}
.picker-popover.hidden { display: none; }
emoji-picker {
  --background: #18181a;
  --border-color: #2a2a2c;
  --input-border-color: #333;
  --input-font-color: #fff;
  --input-placeholder-color: #888;
  --button-active-background: #1a73e8;
  --button-hover-background: #2a2a2c;
  --category-emoji-padding: 4px;
  --category-font-color: #aaa;
  --indicator-color: #1a73e8;
  --emoji-padding: 4px;
  height: 360px;
  width: 320px;
}
.emote-form input[type="range"] {
  flex: 1;
  max-width: 300px;
}
#emote-scale-display {
  width: 60px;
  text-align: right;
  font-family: monospace;
  color: #aaa;
}

.emote-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.emote-card {
  background: #0f0f10;
  border: 1px solid #2a2a2c;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.emote-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #222;
  border-radius: 4px;
}
.emote-card .meta {
  flex: 1;
  font-size: 12px;
  min-width: 0;
}
.emote-card .meta .kw { font-weight: bold; color: #fff; }
.emote-card .meta .map { color: #888; }
.emote-card .remove {
  background: transparent;
  color: #888;
  padding: 4px 8px;
  font-size: 18px;
}
.emote-card .remove:hover { color: #f44336; background: transparent; }

.empty {
  color: #555;
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.log {
  background: #0a0a0b;
  border: 1px solid #2a2a2c;
  border-radius: 6px;
  padding: 12px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12px;
  color: #ccc;
  margin-top: 12px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}
.log .ok { color: #4caf50; }
.log .err { color: #f44336; }
.log .info { color: #5dade2; }

textarea {
  width: 100%;
  min-height: 120px;
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  resize: vertical;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.preview-box {
  background: #0a0a0b;
  border-radius: 8px;
  padding: 16px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Pretendard', sans-serif;
}
.preview-box .chat_box {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.preview-box .inner_box {
  display: flex;
  align-items: flex-end !important;
  gap: 8px;
}
.preview-box .name {
  color: #5dade2;
  font-weight: bold;
  font-size: 14px;
  margin: 0;
}
.preview-box .text {
  margin: 0;
  font-size: 32px;
  line-height: normal;
}
