:root {
  --accent: #6c3cff;
  --bg-dark: #0b0b0f;
  --panel: rgba(18, 18, 24, 0.92);
  --text: #f5f5f7;
  --muted: #a0a0b0;
}

* { box-sizing: border-box; }

html, body, #app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
}

#showcase-player {
  width: 100%;
  height: 100%;
  border: 0;
}

.cctv-open-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.cctv-pop {
  position: absolute;
  top: 72px;
  right: 16px;
  width: min(420px, calc(100vw - 32px));
  height: min(320px, 45vh);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.cctv-pop.fullscreen-mode {
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.cctv-pop__header,
.chat-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #16161f;
}

.cctv-pop__header button,
.chat-panel__header button,
.chat-panel__form button {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.cctv-pop__tabs {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: #101018;
}

.cctv-pop__tabs button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #333;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.cctv-pop__tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#cctvIframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #000;
}

.chat-toggle-btn {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.chat-panel {
  position: absolute;
  right: 20px;
  bottom: 88px;
  width: min(360px, calc(100vw - 32px));
  height: min(480px, 60vh);
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  margin: 0;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 0.92rem;
}

.chat-bubble--bot {
  align-self: flex-start;
  background: #2a2a38;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--accent);
}

.chat-bubble--event {
  align-self: stretch;
  background: #3a2a10;
  border: 1px solid #c98a2c;
  font-size: 0.85rem;
}

.chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #2a2a38;
}

.chat-panel__form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0f0f16;
  color: var(--text);
}

.chat-panel__footer {
  margin: 0;
  padding: 6px 10px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .cctv-pop {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 45vh;
    border-radius: 12px 12px 0 0;
  }
}
