:root {
  color-scheme: light;
  --bg: #f4efe6;
  --card: rgba(255, 251, 245, 0.86);
  --stroke: rgba(108, 84, 58, 0.18);
  --ink: #1c160f;
  --muted: #6f6255;
  --accent: #d6613c;
  --accent-strong: #a94526;
  --success: #2f7d57;
  --shadow: 0 24px 70px rgba(76, 45, 22, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 180, 108, 0.35), transparent 32%),
    radial-gradient(circle at bottom right, rgba(214, 97, 60, 0.25), transparent 28%),
    linear-gradient(140deg, #f8f2e8 0%, #efe4d1 45%, #e8ddd0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 22, 15, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 22, 15, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 90%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.intro {
  margin: 18px 0 0;
  max-width: 680px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.share-card,
.panel {
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel.full-width {
  grid-column: 1 / -1;
}

.share-label {
  margin: 0 0 10px;
  color: var(--muted);
}

.room-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

#room-code {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0.08em;
}

.share-actions {
  margin: 14px 0 0;
}

.switch-room-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.usage-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(108, 84, 58, 0.14);
  background: rgba(255, 255, 255, 0.62);
}

.usage-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.usage-total {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
  color: var(--ink);
}

.usage-breakdown {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.status-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pill,
.ghost-btn,
.text-btn {
  transition: 180ms ease;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(214, 97, 60, 0.22);
  background: rgba(255, 248, 241, 0.9);
  color: var(--accent-strong);
  font-weight: 700;
}

.pill.online {
  color: var(--success);
  border-color: rgba(47, 125, 87, 0.24);
}

.timestamp {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  padding: 18px;
  border: 1px solid rgba(108, 84, 58, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  outline: none;
}

textarea:focus,
.dropzone.dragging {
  border-color: rgba(214, 97, 60, 0.5);
  box-shadow: 0 0 0 4px rgba(214, 97, 60, 0.08);
}

.dropzone {
  display: flex;
  min-height: 180px;
  padding: 24px;
  border: 1.5px dashed rgba(214, 97, 60, 0.35);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 248, 241, 0.92), rgba(255, 240, 230, 0.75));
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 8px;
}

.dropzone.locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.drop-title {
  font-size: 1rem;
  font-weight: 700;
}

.drop-subtitle {
  color: var(--muted);
}

.preview-wrap {
  margin-top: 16px;
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(108, 84, 58, 0.12);
  display: grid;
  place-items: center;
}

.preview-wrap.empty {
  padding: 18px;
}

#image-preview {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

#image-empty {
  color: var(--muted);
}

.tip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.ghost-btn,
.text-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(214, 97, 60, 0.1);
}

.ghost-btn:disabled,
.text-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-btn:hover,
.text-btn:hover {
  opacity: 0.74;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .share-card {
    padding: 18px;
  }

  textarea {
    min-height: 220px;
  }
}
