/* ============ Color Palette ============ */
:root {
  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1f2937;
  --light: #f8fafc;
  --gray: #6b7280;
  --gradient-main: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

/* ============ Reset & Base ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  min-height: 100vh;
  color: var(--dark);
  overflow-x: hidden;
  position: relative;
}

/* ============ Background Shapes ============ */
.bg-shapes {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  opacity: 0.1;
  animation: float-shapes 20s infinite ease-in-out;
}

.circle {
  border-radius: 50%;
  background: white;
}

.square {
  background: rgba(255,255,255,0.8);
  transform: rotate(45deg);
}

.triangle {
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 100px solid rgba(255,255,255,0.6);
}

.shape:nth-child(1) {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 30%;
  right: 25%;
  animation-delay: 3s;
}

.shape:nth-child(3) {
  top: 60%;
  right: 15%;
  animation-delay: 6s;
}

.shape:nth-child(4) {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 70%;
  animation-delay: 9s;
}

.shape:nth-child(5) {
  width: 80px;
  height: 80px;
  bottom: 40%;
  left: 20%;
  animation-delay: 12s;
}

@keyframes float-shapes {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
}

/* ============ Screen Management ============ */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============ Card ============ */
.card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s ease;
  width: 100%;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ Game Header ============ */
.game-header {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.logo-icon {
  width: 100px;
  height: 100px;
  background: var(--gradient-main);
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: white;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md);
  animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.game-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}

.game-subtitle {
  font-size: 1.1rem;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.screen-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 30px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.screen-title i {
  color: var(--primary);
}

/* ============ Game Info ============ */
.game-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-radius: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
}

.info-item i {
  color: var(--primary);
  font-size: 1.3rem;
  width: 30px;
  text-align: center;
}

/* ============ Game Rules ============ */
.game-rules {
  background: #fef3c7;
  padding: 25px;
  border-radius: 20px;
  margin-bottom: 25px;
  border: 2px solid #fbbf24;
}

.game-rules h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-rules h3 i {
  color: var(--warning);
}

.game-rules ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-rules li {
  padding-right: 25px;
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.6;
}

.game-rules li:before {
  content: "•";
  position: absolute;
  right: 0;
  color: var(--warning);
  font-size: 1.5rem;
  line-height: 1.2;
}

/* ============ Buttons ============ */
.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 18px 30px;
  border: none;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--dark);
  border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: var(--primary);
}

.btn-secondary:last-child {
  margin-bottom: 0;
}

.btn-danger {
  width: 100%;
  padding: 18px 30px;
  border: none;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-danger:active {
  transform: translateY(0);
}

/* ============ Room Option Buttons ============ */
.room-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.room-option-btn {
  position: relative;
  padding: 35px 30px;
  border: 3px solid transparent;
  border-radius: 20px;
  background: linear-gradient(white, white) padding-box,
              var(--gradient-main) border-box;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  font-family: 'Cairo', sans-serif;
}

.room-option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 0;
}

.room-option-btn:hover::before {
  opacity: 1;
}

.room-option-btn i {
  position: relative;
  z-index: 1;
  font-size: 3.5rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 15px;
  transition: all 0.4s;
}

.room-option-btn:hover i {
  -webkit-text-fill-color: white;
  transform: scale(1.15) rotate(5deg);
}

.room-option-btn span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  transition: color 0.4s;
}

.room-option-btn:hover span {
  color: white;
}

.room-option-btn:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.35);
  border-color: transparent;
}

.room-option-btn:active {
  transform: translateY(-4px);
}

/* Add subtle animation */
@keyframes float-btn {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.room-option-btn:nth-child(1) {
  animation: float-btn 3s ease-in-out infinite;
}

.room-option-btn:nth-child(2) {
  animation: float-btn 3s ease-in-out infinite 1.5s;
}

/* Desktop: Show buttons side by side */
@media (min-width: 768px) {
  .room-options {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
}

/* ============ Input Fields ============ */
.input-field {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  font-size: 1.1rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  transition: all 0.3s;
  margin-bottom: 20px;
  background: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 8px;
  font-size: 1.5rem;
}

/* ============ Setting Item ============ */
.setting-item {
  margin-bottom: 25px;
}

.setting-item label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

/* ============ Room Code Display ============ */
.room-code-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  padding: 20px;
  border-radius: 20px;
  margin-bottom: 25px;
}

.code-label {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.1rem;
  text-align: center;
}

.code-box {
  background: white;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  letter-spacing: 5px;
  border: 2px solid var(--primary);
}

.copy-code-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.copy-code-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.copy-code-btn:active {
  transform: translateY(0);
}

.copy-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* ============ Players Section ============ */
.players-count {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
  max-height: 300px;
  overflow-y: auto;
}

.player-item {
  background: white;
  padding: 15px 20px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #e5e7eb;
  transition: all 0.3s;
}

.player-item.is-admin {
  border-color: var(--warning);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.player-avatar {
  width: 45px;
  height: 45px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
}

.player-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

.admin-badge {
  background: var(--warning);
  color: white;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 10px;
}

.kick-btn {
  padding: 8px 15px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.kick-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* ============ Waiting Message ============ */
.waiting-message {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 20px;
  margin-bottom: 20px;
}

.waiting-message i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 15px;
  display: block;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.waiting-message p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

/* ============ Game Layout ============ */
.game-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  padding: 20px;
  min-height: 100vh;
}

.chat-side {
  order: 1;
  position: sticky;
  top: 20px;
  align-self: start;
}

.game-side {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-width: 0;
}

/* ============ Chat System ============ */
.chat-container {
  height: 600px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--gradient-main);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 1.5rem;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9fafb;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-sender {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray);
}

.message-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 15px;
  font-weight: 600;
  color: var(--dark);
  max-width: 80%;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
  border: 2px solid #e5e7eb;
}

.chat-message.own .message-bubble {
  background: var(--gradient-main);
  color: white;
  border-color: var(--primary);
  align-self: flex-end;
}

.chat-message.own .message-sender {
  align-self: flex-end;
}

.chat-input-box {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: white;
  border-top: 2px solid #e5e7eb;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  transition: all 0.3s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-send-btn {
  padding: 12px 20px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.2rem;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

/* ============ Game Container ============ */
.game-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 800px;
}

/* ============ Question Header ============ */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 20px;
}

.category-badge {
  background: var(--gradient-main);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.timer-circle {
  position: relative;
  width: 80px;
  height: 80px;
}

.timer-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 6;
}

.timer-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s linear;
  stroke-dasharray: 220;
  stroke-dashoffset: 0;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.question-number {
  font-weight: 700;
  color: var(--gray);
  font-size: 1rem;
}

/* ============ Question Box ============ */
.question-box {
  margin-bottom: 30px;
}

.question-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 30px;
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.choice-btn {
  background: white;
  border: 3px solid #e5e7eb;
  border-radius: 20px;
  padding: 30px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: 'Cairo', sans-serif;
  width: 100%;
}

.choice-btn:hover {
  border-color: var(--primary);
  transform: translateX(-5px);
  box-shadow: var(--shadow-md);
}

.choice-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.choice-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.choice-text {
  flex: 1;
  text-align: right;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
}

.vs-divider {
  text-align: center;
  position: relative;
  margin: 10px 0;
}

.vs-divider span {
  background: var(--gradient-main);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.1rem;
  display: inline-block;
}

/* ============ Results Box ============ */
.results-box {
  animation: fadeIn 0.5s ease;
}

.results-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 25px;
}

.result-item {
  background: #f9fafb;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  border: 2px solid #e5e7eb;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.result-choice-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.result-percentage {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.result-bar {
  width: 100%;
  height: 30px;
  background: #e5e7eb;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 12px;
}

.result-fill {
  height: 100%;
  transition: width 1s ease;
  border-radius: 15px;
}

.choice-1-color {
  background: var(--gradient-main);
}

.choice-2-color {
  background: var(--gradient-success);
}

.result-players {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray);
  padding: 10px;
  background: white;
  border-radius: 10px;
}

.no-choice-section {
  background: #fee2e2;
  padding: 15px 20px;
  border-radius: 15px;
  border: 2px solid var(--danger);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--danger);
}

.no-choice-section i {
  font-size: 1.3rem;
}

/* ============ Game Over ============ */
.game-over-box {
  text-align: center;
  padding: 40px;
  animation: fadeIn 0.5s ease;
}

.game-over-icon {
  width: 120px;
  height: 120px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: white;
  margin: 0 auto 30px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.game-over-box h2 {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 15px;
}

.game-over-box p {
  font-size: 1.2rem;
  color: var(--gray);
  margin-bottom: 30px;
  font-weight: 600;
}

/* ============ Responsive ============ */
@media (max-width: 968px) {
  .game-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .game-side {
    order: 1;
    padding: 20px;
  }

  .question-header {
    flex-direction: column;
    gap: 15px;
  }

  .game-container {
    padding: 25px;
  }

  .question-title {
    font-size: 1.5rem;
  }

  .choice-text {
    font-size: 1.1rem;
  }

  .card {
    padding: 25px;
  }

  .game-title {
    font-size: 2.2rem;
  }

  .logo-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }
}

@media (max-width: 480px) {
  .game-header {
    margin-bottom: 20px;
  }

  .logo-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
    margin-bottom: 15px;
  }

  .game-title {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  .room-code-display {
    flex-direction: column;
    gap: 10px;
  }

  .code-box {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }

  .choice-btn {
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }

  .choice-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .question-header {
    flex-wrap: wrap;
  }

  .category-badge {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}

/* ============ All Results Screen ============ */
#all-results-container::-webkit-scrollbar {
  width: 8px;
}

#all-results-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#all-results-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

#all-results-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ============ Story Display Styles ============ */
.story-display {
  background: #f8fafc;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 25px;
  border: 2px solid #e5e7eb;
}

.story-display h3 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.story-content {
  background: white;
  border-radius: 15px;
  padding: 20px;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.8;
}

.story-placeholder {
  color: var(--gray);
  font-style: italic;
  text-align: center;
}

.story-part {
  margin-bottom: 15px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 10px;
  border-right: 4px solid var(--primary);
}

.story-part-author {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.story-part-text {
  color: var(--dark);
  line-height: 1.6;
}

.write-section {
  background: white;
  border-radius: 20px;
  padding: 25px;
  border: 2px solid var(--primary);
}

.write-section h3 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.story-input {
  width: 100%;
  min-height: 100px;
  padding: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s;
}

.story-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.char-count {
  text-align: left;
  color: var(--gray);
  font-size: 0.9rem;
  margin-top: 8px;
  margin-bottom: 15px;
}

.waiting-turn {
  text-align: center;
  padding: 40px;
  background: #f8fafc;
  border-radius: 20px;
  border: 2px dashed var(--primary);
}

.waiting-turn i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 15px;
  animation: spin 2s linear infinite;
}

.waiting-turn p {
  color: var(--gray);
  font-size: 1.1rem;
  font-weight: 600;
}

.waiting-turn span {
  color: var(--primary);
  font-weight: 700;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.turn-info {
  background: var(--gradient-main);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 25px;
  color: white;
}

.turn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.round-indicator, .player-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
}

.round-indicator i, .player-indicator i {
  font-size: 1.3rem;
}

/* Timer Container */
.timer-container {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.timer-icon {
  font-size: 2rem;
  animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.timer-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#timer-seconds {
  font-size: 3rem;
  font-weight: 900;
  font-family: 'Arial', sans-serif;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.timer-label {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Timer warning states */
.timer-container.warning #timer-seconds {
  color: #fbbf24;
  animation: shake 0.5s;
}

.timer-container.danger #timer-seconds {
  color: #ef4444;
  animation: shake 0.3s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Players Order Display */
.players-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
  border-radius: 12px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #1f2937;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.players-order i {
  color: var(--primary);
  font-size: 1.1rem;
}

#players-order-text {
  font-weight: 500;
}

/* Final Story Display */
#final-story-container {
  background: #f8fafc;
  border-radius: 20px;
  padding: 25px;
}

#final-story-container .story-part {
  background: white;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  border-right: 5px solid var(--primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

#final-story-container .story-part:hover {
  transform: translateX(-5px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

#final-story-container .story-part:last-child {
  margin-bottom: 0;
}

#final-story-container::-webkit-scrollbar {
  width: 10px;
}

#final-story-container::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 10px;
}

#final-story-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
  transition: background 0.3s;
}

#final-story-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
