/* ============ Variables ============ */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --light: #f8fafc;
  --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-card: linear-gradient(135deg, #f093fb 0%, #f5576c 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 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--gradient-main);
  min-height: 100vh;
  color: var(--dark);
  overflow-x: hidden;
}

/* ============ 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.15;
  animation: float-around 25s infinite ease-in-out;
}

.shape.circle {
  border-radius: 50%;
  background: white;
}

.shape.square {
  background: rgba(255,255,255,0.9);
  transform: rotate(45deg);
}

.shape.triangle {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 100px solid white;
}

.shape:nth-child(1) {
  width: 180px;
  height: 180px;
  top: 5%;
  left: 5%;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 15%;
  right: 10%;
  animation-delay: 5s;
}

.shape:nth-child(3) {
  top: 55%;
  left: 75%;
  animation-delay: 10s;
}

.shape:nth-child(4) {
  width: 140px;
  height: 140px;
  bottom: 15%;
  left: 15%;
  animation-delay: 3s;
}

.shape:nth-child(5) {
  width: 90px;
  height: 90px;
  bottom: 25%;
  right: 20%;
  animation-delay: 7s;
}

@keyframes float-around {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, -20px) rotate(90deg);
  }
  50% {
    transform: translate(-15px, 15px) rotate(180deg);
  }
  75% {
    transform: translate(15px, 10px) rotate(270deg);
  }
}

/* ============ Screen Management ============ */
.screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

.container {
  max-width: 600px;
  width: 100%;
}

/* ============ Card Styles ============ */
.card {
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(15px);
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ Game Header ============ */
.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  width: 100px;
  height: 100px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: white;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md);
  animation: pulse-logo 3s infinite;
}

@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.game-title {
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.game-subtitle {
  font-size: 1.2rem;
  color: var(--dark);
  opacity: 0.8;
  font-weight: 600;
}

/* ============ Game Info ============ */
.game-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 16px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
}

.info-item i {
  font-size: 1.3rem;
  color: var(--primary);
}

/* ============ Game Rules ============ */
.game-rules {
  background: rgba(99,102,241,0.05);
  border: 2px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}

.game-rules h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-rules ul {
  list-style: none;
  padding: 0;
}

.game-rules li {
  padding: 10px 0;
  padding-right: 25px;
  position: relative;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.6;
}

.game-rules li::before {
  content: '✓';
  position: absolute;
  right: 0;
  color: var(--success);
  font-weight: 900;
  font-size: 1.2rem;
}

/* ============ Buttons ============ */
.btn-primary,
.btn-secondary,
.btn-danger {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  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;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============ Input Fields ============ */
.input-field {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 1.1rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  transition: all 0.3s;
  background: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

/* ============ Screen Title ============ */
.screen-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.screen-title i {
  font-size: 2.2rem;
}

/* ============ Room Options ============ */
.room-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.option-btn {
  width: 100%;
  padding: 25px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 3px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Cairo', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.option-btn:hover {
  border-color: var(--primary);
  background: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.option-btn i {
  font-size: 3rem;
  color: var(--primary);
}

.option-btn span {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.divider {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  opacity: 0.5;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 2px;
  background: rgba(30,41,59,0.2);
}

.divider::before {
  right: 0;
}

.divider::after {
  left: 0;
}

.join-room-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* ============ Room Code Display ============ */
.room-code-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 16px;
  margin-bottom: 25px;
}

.room-code-display span {
  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-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-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.copy-btn:active {
  transform: translateY(0);
}

/* ============ Players Section ============ */
.players-section {
  margin-bottom: 25px;
}

.players-section h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: white;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 1.05rem;
}

.player-item i {
  font-size: 1.3rem;
  color: var(--primary);
}

.player-badge {
  margin-right: auto;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: white;
}

.ayn-badge {
  background: linear-gradient(135deg, #10b981, #059669);
}

.fi-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ============ Spectators Section ============ */
.spectators-section {
  margin-bottom: 25px;
}

.spectators-section h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spectator-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(139,92,246,0.1);
  border-radius: 10px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.spectator-item i {
  color: var(--accent);
}

/* ============ Status Box ============ */
.status-box {
  text-align: center;
  padding: 25px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 16px;
  margin-bottom: 20px;
}

.status-box p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 15px;
}

.status-ready {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.status-ready i {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 10px;
}

.ready-text {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-top: 8px;
}

/* ============ Loader ============ */
.loader {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(99,102,241,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

.loader-small {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ Game Layout ============ */
.game-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  min-height: 100vh;
  position: relative;
  padding: 20px;
}

/* ============ Chat Side ============ */
.chat-side {
  display: flex;
  flex-direction: column;
  order: 1;
  position: sticky;
  top: 20px;
  align-self: start;
}

.chat-container {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  height: 600px;
  border: 1px solid #e2e8f0;
}

.chat-header {
  background: var(--gradient-main);
  color: white;
  padding: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  position: relative;
}

.minimize-chat {
  display: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.own {
  align-self: flex-end;
}

.chat-message.other {
  align-self: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
}

.chat-message.own .message-bubble {
  background: var(--gradient-main);
  color: white;
  border-bottom-left-radius: 4px;
}

.chat-message.other .message-bubble {
  background: #e2e8f0;
  color: var(--dark);
  border-bottom-right-radius: 4px;
}

.message-sender {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.8;
}

.message-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
  text-align: left;
}

.chat-input-box {
  padding: 15px;
  background: white;
  border-top: 2px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.send-btn {
  padding: 12px 20px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.send-btn:hover {
  transform: scale(1.05);
}

/* ============ Game Side ============ */
.game-side {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-width: 0;
}

.game-header-bar {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.game-title-small {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.exit-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.exit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============ Timer Display ============ */
.timer-display {
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(15px);
  padding: 20px 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

.timer-display.warning {
  color: var(--warning);
  animation: pulse 1s infinite;
}

.timer-display.danger {
  color: var(--danger);
  animation: pulse 0.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ============ Input Phase ============ */
.input-phase {
  width: 100%;
  max-width: 700px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(15px);
  padding: 40px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.phase-header {
  text-align: center;
  margin-bottom: 30px;
}

.phase-header h3 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 10px;
}

.phase-header p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  opacity: 0.7;
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.answer-item label {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
  min-width: 30px;
}

.answer-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  transition: all 0.3s;
}

.answer-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.waiting-message {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 16px;
  margin-top: 20px;
}

.waiting-message p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 15px;
}

/* ============ Results Phase ============ */
.results-phase {
  width: 100%;
  max-width: 700px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(15px);
  padding: 40px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.results-header {
  text-align: center;
  margin-bottom: 30px;
}

.results-header h3 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 10px;
}

.results-header p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  opacity: 0.7;
}

.result-card {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  padding: 30px;
  border-radius: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-sm);
}

.result-question,
.result-answer {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: white;
  border-radius: 14px;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 700;
}

.result-question {
  border-right: 5px solid var(--success);
}

.result-question i {
  font-size: 1.5rem;
  color: var(--success);
}

.result-answer {
  border-right: 5px solid var(--warning);
}

.result-answer i {
  font-size: 1.5rem;
  color: var(--warning);
}

.result-answer:last-child {
  margin-bottom: 0;
}

.result-counter {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 25px;
}

/* ============ Result Controls ============ */
.result-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn-nav {
  flex: 1;
  max-width: 200px;
  padding: 15px 25px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  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;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-nav:active {
  transform: translateY(0);
}

.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-nav:disabled:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-share {
  width: 100%;
  padding: 15px 30px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  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;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-share:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-share:active {
  transform: translateY(0);
}

/* ============ Floating Chat Button (Mobile) ============ */
.show-chat-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: all 0.3s;
  display: none;
}

.show-chat-btn:hover {
  transform: scale(1.1);
}

.show-chat-btn.hidden {
  display: none;
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  border: 2px solid white;
}

.chat-badge.hidden {
  display: none;
}

/* ============ Responsive ============ */
@media (min-width: 969px) {
  .show-chat-btn {
    display: none !important;
  }
}

@media (max-width: 968px) {
  .game-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .chat-side {
    order: 2;
    width: 100%;
    height: 70vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    border-left: none;
    border-top: 3px solid rgba(99,102,241,0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    top: auto;
  }

  .chat-side.show {
    transform: translateY(0);
  }

  .chat-side.hidden {
    transform: translateY(100%);
  }

  .chat-container {
    height: 100%;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  }

  .game-side {
    order: 1;
    padding: 20px;
  }

  .show-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-header-bar {
    flex-direction: column;
    gap: 15px;
  }

  .timer-display {
    font-size: 1.5rem;
    padding: 15px 30px;
  }

  .input-phase,
  .results-phase {
    padding: 25px;
  }

  .phase-header h3,
  .results-header h3 {
    font-size: 1.6rem;
  }

  .answer-input {
    font-size: 1rem;
  }

  .result-question,
  .result-answer {
    font-size: 1.05rem;
    padding: 15px;
  }

  .btn-nav {
    padding: 12px 20px;
    font-size: 1rem;
  }

  .btn-share {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .card {
    padding: 25px;
  }

  .game-title {
    font-size: 2.2rem;
  }

  .logo-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.8rem;
  }

  .room-code-display {
    flex-direction: column;
    gap: 10px;
  }

  .code-box {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }

  .answer-item {
    flex-direction: column;
    align-items: stretch;
  }

  .answer-item label {
    text-align: center;
  }

  .result-controls {
    flex-direction: column;
  }

  .btn-nav {
    max-width: 100%;
  }
}
