:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #10b981;
  --secondary-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --bg: #f3f4f6;
  --text: #1f2937;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
  overflow-y: auto;
}

body.embed-mode {
  background-color: transparent;
  padding: 0;
  min-height: auto;
}

#app {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none !important;
}

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

h1, h2, h3 {
  text-align: center;
  color: var(--text);
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  color: white;
  background-color: #6b7280;
}

button:hover {
  background-color: #4b5563;
}

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

.btn-primary {
  background-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary);
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-danger {
  background-color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-hover);
}

.divider {
  text-align: center;
  margin: 10px 0;
  color: #6b7280;
  font-size: 14px;
  position: relative;
}
.divider::before, .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: #d1d5db;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-list li {
  padding: 10px;
  background: #f9fafb;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary);
}

.player-list li .host-badge {
  background: #fbbf24;
  color: #92400e;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.error-msg {
  color: var(--danger);
  text-align: center;
  font-weight: bold;
  min-height: 24px;
}

.info-msg {
  color: #4b5563;
  text-align: center;
  font-style: italic;
}

.connection-status {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}

.connection-status.info {
  background: #eff6ff;
  color: #1d4ed8;
}

.connection-status.success {
  background: #ecfdf5;
  color: #047857;
}

.connection-status.warning {
  background: #fff7ed;
  color: #c2410c;
}

.connection-status.error {
  background: #fef2f2;
  color: #b91c1c;
}

.player-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: bold;
}

.status-badge.disconnected {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-kick-player {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  background-color: var(--danger);
}

.btn-kick-player:hover {
  background-color: var(--danger-hover);
}

.word-card {
  text-align: center;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  color: white;
}

.word-card h3 {
  color: rgba(255,255,255,0.8);
  margin-bottom: 5px;
}

.the-word {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 2px;
}

.vote-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vote-btn {
  background-color: white;
  color: var(--text);
  border: 2px solid #e5e7eb;
}

.vote-btn:hover {
  border-color: var(--primary);
  background-color: #f3f4f6;
}

.vote-btn.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.vote-btn.skip-btn {
  grid-column: span 2;
  margin-top: 10px;
  background-color: #f9fafb;
  color: #6b7280;
  border-style: dashed;
}

.vote-btn.skip-btn.selected {
  background-color: #6b7280;
  color: white;
  border-style: solid;
}

.result-card {
  text-align: center;
}

.highlight {
  font-weight: bold;
  color: var(--danger);
}

/* Question Bank Styles */
.bank-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bank-actions button {
  flex: 1;
  font-size: 14px;
  padding: 8px;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background-color: rgba(79, 70, 229, 0.1);
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-card {
  background: var(--card-bg);
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  padding: 20px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.bank-list-container {
  overflow-y: auto;
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #f9fafb;
}

.bank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

.bank-item-words {
  font-size: 14px;
  color: var(--text);
}

.btn-delete-bank {
  background-color: var(--danger);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
  border-radius: 4px;
}

.btn-delete-bank:hover {
  background-color: var(--danger-hover);
}
