* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(59, 130, 246, 0.15) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

h1 {
  color: white;
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5em;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active {
  display: block;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 35px;
  margin-bottom: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35),
    0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.card h2 {
  margin-bottom: 24px;
  color: #1e293b;
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.input {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: rgba(248, 250, 252, 0.8);
  color: #1e293b;
}

.input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: white;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

.input::placeholder {
  color: #94a3b8;
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.room-info {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-info.hidden {
  display: none;
}

.room-info h3 {
  margin-bottom: 24px;
  color: #1e293b;
  font-weight: 700;
  font-size: 1.4em;
  letter-spacing: -0.5px;
}

.info-box {
  margin-bottom: 24px;
}

.info-box label {
  display: block;
  margin-bottom: 10px;
  color: #64748b;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px;
  border-radius: 12px;
  border: 2px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
}

.copy-box:hover {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.copy-box span {
  flex: 1;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Courier New",
    monospace;
  color: #1e293b;
  word-break: break-all;
  font-size: 15px;
  font-weight: 500;
}

.btn-copy {
  padding: 8px 16px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 16px;
  margin: 24px 0;
  color: #78350f;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

/* 채팅 화면 */
.chat-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
}

.room-id-label {
  font-weight: 600;
  color: #1e293b;
  margin-right: 16px;
  font-size: 15px;
}

.room-id-label span {
  color: #8b5cf6;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Courier New", monospace;
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.status.connected {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status.disconnected {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.chat-header .btn {
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
}

.messages {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  height: 500px;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  word-wrap: break-word;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.own {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-left: 3px solid #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.message.other {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 3px solid #64748b;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.1);
}

.message.error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left: 3px solid #ef4444;
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.message.system {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 3px solid #f59e0b;
  color: #78350f;
  font-style: italic;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.message-time {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.message-content {
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1e293b;
}

.message-content code {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #a5f3fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-input {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 0 0 20px 20px;
  display: flex;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
}

.message-input textarea {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  resize: none;
  transition: all 0.3s ease;
  background: rgba(248, 250, 252, 0.8);
  color: #1e293b;
  line-height: 1.5;
}

.message-input textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  background: white;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.message-input textarea::placeholder {
  color: #94a3b8;
}

.message-input .btn {
  width: auto;
  padding: 14px 32px;
}

/* 스크롤바 스타일 */
.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.5);
  border-radius: 10px;
}

.messages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}
