﻿@import url('https://cdn.jsdelivr.net/npm/pretendard@latest/dist/web/static/pretendard.css');

:root {
  --bg: #f4efe8;
  --ink: #102a43;
  --ink-soft: #486581;
  --surface: #fffdf9;
  --line: #d9cfc1;
  --primary: #0f766e;
  --primary-ink: #ecfeff;
  --danger: #b42318;
  --shadow: 0 10px 24px rgba(16, 42, 67, 0.14);
  font-family: 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #f8dcbf 0%, transparent 42%),
    radial-gradient(circle at 85% 20%, #c5e9e4 0%, transparent 35%),
    var(--bg);
  padding: 22px;
}

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

.panel.hidden,
.hidden {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.hero {
  background: linear-gradient(135deg, #fffdf9 0%, #d8ece9 100%);
  padding: 24px 22px;
  position: relative;
}

.hub-link {
  position: absolute;
  top: 16px;
  right: 18px;
  color: rgba(16, 42, 67, 0.34);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-link:hover {
  color: rgba(16, 42, 67, 0.7);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

h1 {
  margin: 8px 0 4px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
}

.hero-title {
  letter-spacing: 0.06em;
  font-weight: 900;
  color: #093f3a;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.hero-actions {
  margin-top: 14px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-header h2 {
  min-width: 0;
  white-space: nowrap;
}

.refresh-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-inline: 10px;
}

.create-btn {
  width: auto;
  white-space: nowrap;
}

.room-list {
  list-style: none;
  padding: 0 6px;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
  min-height: 280px;
  padding-bottom: 8px;
  align-content: start;
}

.room-item {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
  border-bottom: 1px solid var(--line);
}

.room-item:hover {
  transform: translateY(-2px);
  border-color: #80b9b2;
}

.room-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.room-sub {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.top-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.big-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f4b46;
  background: #e0f6f2;
  border: 1px solid #9fd8cf;
  border-radius: 12px;
  padding: 8px 12px;
}

.room-layout {
  display: grid;
  grid-template-columns: 200px minmax(360px, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.room-side-left,
.room-side-right {
  position: sticky;
  top: 12px;
}

.room-center {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
  align-items: flex-start;
}

.stage-card {
  width: min(100%, 680px);
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.my-turn-badge {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  background: #d92d20;
  border: 1px solid #b42318;
  border-radius: 999px;
  padding: 2px 10px;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.16);
}

.current-turn-player {
  color: #0f4b46;
  font-weight: 700;
}

.kickable-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kickable-player:hover {
  color: #b42318;
  font-weight: 700;
}

.kick-btn {
  width: auto;
  border: 1px solid #e9b3ad;
  background: #fff5f4;
  color: #b42318;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.8rem;
}

.side-card-box {
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

.side-card-box.highlight {
  border-color: #70bdb2;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
}

.side-card-text {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #0f4b46;
  transition: filter 160ms ease, opacity 160ms ease;
}

.side-card-box.hide-card .side-card-text {
  filter: blur(6px);
  opacity: 0.78;
}

.side-card-box.hide-card:hover .side-card-text {
  filter: blur(0);
  opacity: 1;
}

.chat-panel {
  height: 70vh;
  display: flex;
  flex-direction: column;
}

#chatList {
  background: #f4f7fb;
  border: 1px solid #d8e2ec;
  border-radius: 12px;
  padding: 10px;
  flex: 1;
  overflow: auto;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chatList li {
  border-bottom: none;
  padding: 0;
}

.chat-item {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.chat-item.self {
  margin-left: auto;
  align-items: flex-end;
}

.chat-name {
  font-size: 0.78rem;
  color: #5f7d95;
  margin: 0 2px 2px;
}

.chat-bubble {
  padding: 8px 11px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d6e3ef;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.07);
  word-break: break-word;
}

.chat-item.self .chat-bubble {
  background: #d9f4ef;
  border-color: #8ccdc0;
}

.turn-log-panel {
  width: min(100%, 680px);
}

.guess-option-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.guess-option-list button {
  width: 100%;
  background: #fff;
  border: 1px solid #cdd8e5;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.9rem;
}

.card-reveal-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
}

.card-reveal-body {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) scale(1.1);
  background: #ffffff;
  border: 2px solid #77bfb4;
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: 0 16px 28px rgba(16, 42, 67, 0.22);
}

.card-reveal-label {
  margin: 0;
  color: #5f7d95;
}

.card-reveal-text {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 900;
  color: #0d5952;
}

.card-reveal-overlay.run .card-reveal-body {
  animation: revealFadeOut 2.6s ease forwards;
}

@keyframes revealFadeOut {
  0% {
    opacity: 1;
  }
  76% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#roomTitle {
  margin: 0;
}

#stateBadge {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: #335c67;
  background: #e5f3f1;
  border: 1px solid #b9dfd9;
  border-radius: 999px;
  padding: 2px 10px;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

input,
select,
textarea {
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #b6c4d2;
  font: inherit;
  font-size: 0.96rem;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

button {
  cursor: pointer;
}

.button-primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card ul li {
  border-bottom: 1px solid #e7edf3;
  padding: 7px 0;
}

.vote-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.vote-buttons button.voted-choice {
  border: 2px solid #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.modal {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 40, 0.42);
  z-index: 0;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  margin: 11vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  margin: 0;
  padding: 0;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .card {
    border-radius: 12px;
    padding: 13px;
  }

  .modal-panel {
    margin-top: 8vh;
  }

  .list-header {
    flex-wrap: wrap;
  }

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

  .room-side-left,
  .room-side-right {
    position: static;
  }

  .room-center {
    min-height: auto;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
  }

  .top-controls {
    align-items: flex-start;
  }
}
