/* 나잘친 - 2D 교실 / 모바일 반응형 */
:root {
  --bg: #2d2640;
  --panel: #3d3558;
  --accent: #7ec8e3;
  --accent2: #f4a6c1;
  --text: #f5f0ff;
  --muted: #a89bc4;
  --firm: #e07a8a;
  --warm: #8fd9a8;
  --pixel-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.logo {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
}

.logo span {
  color: var(--accent);
}

.user-pill {
  font-size: 0.85rem;
  color: var(--muted);
}

.classroom-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--pixel-shadow);
  border: 3px solid #1a1526;
  aspect-ratio: 16 / 10;
  min-height: 220px;
  background: linear-gradient(180deg, #6b8cae 0%, #8fb8d8 40%, #d4a574 40%, #b8895e 100%);
}

.classroom-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
  z-index: 0;
  display: block;
}

button.hotspot {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: center;
}

.hotspot {
  position: absolute;
  z-index: 1;
  cursor: pointer;
  border: 3px dashed rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(45, 38, 64, 0.2);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.hotspot:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.hotspot:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.hotspot .label {
  position: absolute;
  bottom: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a1526;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

/* 위치: 창가, 책상, 친구, 책장 */
.hs-window {
  left: 5%;
  top: 10%;
  width: 27%;
  height: 38%;
}

.hs-desk {
  left: 32%;
  bottom: 6%;
  width: 34%;
  height: 32%;
}

.hs-friend {
  right: 6%;
  bottom: 12%;
  width: 26%;
  height: 46%;
  background: rgba(255, 255, 255, 0.08);
}

.hs-shelf {
  left: 40%;
  top: 11%;
  width: 21%;
  height: 26%;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

button.btn {
  appearance: none;
  border: 3px solid #1a1526;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent);
  color: #1a1526;
  box-shadow: var(--pixel-shadow);
}

button.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border-color: #2a2038;
}

button.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.panel {
  margin-top: 1rem;
  background: var(--panel);
  border: 3px solid #1a1526;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--pixel-shadow);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.chat-log {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #2a2340;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.msg {
  margin-bottom: 0.5rem;
}

.msg.child {
  color: var(--accent);
}

.msg.bestie {
  color: var(--text);
}

.msg .tag {
  font-size: 0.7rem;
  opacity: 0.85;
}

.msg.firm .tag {
  color: var(--firm);
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
}

.chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 2px solid #1a1526;
  background: #f5f0ff;
  color: #1a1526;
  font-size: 1rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.overlay[hidden] {
  display: none !important;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 3px solid #1a1526;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.4);
}

.modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.form-row {
  margin-bottom: 0.65rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 2px solid #1a1526;
  background: #f5f0ff;
  color: #1a1526;
  font-size: 1rem;
}

.form-row textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.panel .chat-lead {
  margin-top: 0.25rem;
  margin-bottom: 0.65rem;
}

.trait-list {
  font-size: 0.85rem;
  color: var(--muted);
  max-height: 100px;
  overflow-y: auto;
}

@media (max-width: 520px) {
  .classroom-wrap {
    aspect-ratio: 4 / 5;
  }

  .hotspot .label {
    font-size: 0.65rem;
  }
}
