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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.screen {
  display: none;
  width: 100%;
  max-width: 700px;
  padding: 20px;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  text-align: center;
  width: 100%;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 5px;
}

.logo-icon {
  flex-shrink: 0;
  line-height: 0;
}

.logo-icon svg {
  display: block;
}

.logo h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.subtitle {
  color: #888;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 30px;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.tab-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.tab-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.tab-btn.active {
  background: rgba(247, 151, 30, 0.2);
  color: #f7971e;
  border-color: #f7971e;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.tab-content.active {
  display: flex;
}

input {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

input:focus {
  border-color: #f7971e;
}

input::placeholder {
  color: #666;
}

.btn-primary {
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #1a1a2e;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(247, 151, 30, 0.4);
}

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

.btn-secondary {
  padding: 14px 32px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
}

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

.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.error {
  color: #ff4444;
  margin-top: 12px;
  min-height: 24px;
  font-weight: 600;
}

/* Lobby Room */
.lobby-header h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.room-code-display {
  font-size: 1.5rem;
  color: #ffd200;
  font-weight: 800;
  letter-spacing: 4px;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 2px dashed rgba(255, 210, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.room-code-display span {
  font-size: 2.5rem;
  letter-spacing: 8px;
}

.share-btn {
  background: #f7971e;
  border: none;
  color: #1a1a2e;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  line-height: 1;
  white-space: nowrap;
}

.share-btn:hover {
  background: #ffa826;
  transform: scale(1.05);
}

.share-btn:active {
  transform: scale(0.95);
}

.share-btn.copied {
  background: #4caf50;
  color: #fff;
}

/* Share sheet (custom fallback for non-HTTPS/mobile) */
.share-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.share-sheet-overlay.hidden {
  display: none;
}

.share-sheet {
  background: #22223a;
  border: 1px solid #33334f;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.share-sheet-code {
  text-align: center;
  color: #f7971e;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.share-option:active {
  transform: scale(0.98);
}

.share-option:hover {
  filter: brightness(1.15);
}

.share-option-icon {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
}

.share-whatsapp { background: #25d366; }
.share-telegram { background: #229ed9; }
.share-twitter { background: #1d9bf0; }
.share-copy { background: #44446a; color: #fff; }

.share-sheet-close {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #999;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.share-sheet-close:hover { color: #fff; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-config {
  color: #888;
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Avatar Picker */
/* Settings */
.settings-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.setting-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  color: #888;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
}

.setting-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  outline: none;
  margin: 8px 0 4px;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
}

.setting-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
}

.segmented-control {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.seg-btn {
  flex: 1;
  padding: 8px 6px;
  background: rgba(255,255,255,0.04);
  border: none;
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn.active {
  background: rgba(247, 151, 30, 0.2);
  color: #f7971e;
}

.seg-btn:hover:not(.active) {
  background: rgba(255,255,255,0.08);
}

.avatar-picker-label {
  color: #888;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 6px;
}

.invite-notice {
  background: rgba(247, 151, 30, 0.15);
  border: 1px solid rgba(247, 151, 30, 0.4);
  color: #ffd200;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.invite-notice.invite-error {
  background: rgba(255, 23, 68, 0.12);
  border-color: rgba(255, 23, 68, 0.45);
  color: #ff6161;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}

.avatar-option {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.avatar-option:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.avatar-option.selected {
  border-color: #f7971e;
  background: rgba(247, 151, 30, 0.15);
  box-shadow: 0 0 12px rgba(247, 151, 30, 0.3);
}

.player-list {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 100px;
}

.player-card svg {
  display: block;
}

.player-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.you-tag {
  color: #ffd200;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.hint {
  color: #666;
  font-size: 0.9rem;
  margin: 10px 0 20px;
}

/* Scorecard */
.scorecard {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  border: 1px solid rgba(247, 151, 30, 0.15);
}

.scorecard-player {
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sc-avatar {
  line-height: 0;
}

.sc-avatar svg {
  display: block;
}

.scorecard-player.leading {
  background: rgba(247, 151, 30, 0.1);
}

.scorecard-player.trailing {
  opacity: 0.65;
}

.sc-label {
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.scorecard-player.leading .sc-label {
  color: #ffd200;
}

.sc-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-score {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  transition: transform 0.3s ease;
}

.scorecard-player.score-pop .sc-score {
  animation: scorePop 0.5s ease;
}

@keyframes scorePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.scorecard-vs {
  color: #444;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-align: center;
  grid-row: 1 / 2;
  grid-column: 2 / 3;
}

.scorecard-bar-container {
  grid-column: 1 / 4;
  grid-row: 2 / 3;
  margin-top: 6px;
}

.scorecard-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.scorecard-bar-bg::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 50%;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}

.scorecard-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  border-radius: 3px;
  transition: width 0.5s ease;
  position: relative;
  z-index: 1;
}

/* Game Screen */
.game-header {
  width: 100%;
  margin-bottom: 20px;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.game-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #ffd200;
}

.question-counter {
  font-size: 0.85rem;
  color: #888;
}

.timer-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  border-radius: 3px;
  width: 100%;
  transition: width 0.1s linear;
}

.game-content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question-text {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.3;
  min-height: 80px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.option-btn {
  padding: 18px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option-btn:hover:not(.disabled) {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.option-btn.selected {
  border-color: #f7971e;
  background: rgba(247, 151, 30, 0.15);
}

.option-btn.correct {
  border-color: #00c853;
  background: rgba(0, 200, 83, 0.2);
}

.option-btn.wrong {
  border-color: #ff1744;
  background: rgba(255, 23, 68, 0.2);
}

.option-btn.disabled {
  cursor: default;
  opacity: 0.7;
}

/* Result Area */
#result-area {
  text-align: center;
  padding: 20px;
}

#result-area.hidden {
  display: none;
}

#result-message {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* Boggle Board */
#boggle-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#boggle-area.hidden {
  display: none;
}

.boggle-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 14px;
  border: 2px solid rgba(247, 151, 30, 0.2);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.boggle-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(247, 151, 30, 0.2), rgba(255, 210, 0, 0.1));
  border: 2px solid rgba(247, 151, 30, 0.3);
  border-radius: 10px;
  aspect-ratio: 1;
  color: #ffd200;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.boggle-cell-qu {
  font-size: 1.3rem;
}

.boggle-cell.selected {
  background: linear-gradient(135deg, #ffd200, #f7971e);
  color: #1a1a2e;
  border-color: #ffd200;
  transform: scale(0.92);
  box-shadow: 0 0 16px rgba(255, 210, 0, 0.5);
  text-shadow: none;
}

.boggle-word-display {
  width: 100%;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(247, 151, 30, 0.3);
  background: rgba(0,0,0,0.3);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  color: #ffd200;
  text-transform: uppercase;
  min-height: 48px;
  line-height: 1.2;
  word-break: break-all;
}

.boggle-status {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  min-height: 24px;
  transition: opacity 0.3s;
}

.boggle-status-ok {
  color: #00c853;
}

.boggle-status-err {
  color: #ff1744;
}

.boggle-status-hide {
  opacity: 0;
}

.boggle-words-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

.boggle-words-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boggle-words-title {
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
}

.boggle-words-title span {
  color: #ffd200;
  font-weight: 800;
}

.boggle-words-list {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 8px;
  height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(255,255,255,0.06);
}

.boggle-word-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 0.85rem;
}

.boggle-word-item .bw-word {
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.boggle-word-item .bw-score {
  color: #ffd200;
  font-weight: 800;
  font-size: 0.8rem;
}

.boggle-word-both {
  opacity: 0.6;
  font-style: italic;
}

.boggle-word-both .bw-word::after {
  content: ' (shared)';
  font-size: 0.65rem;
  color: #888;
  font-style: italic;
}

/* City Guess */
#cityguess-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#cityguess-area.hidden {
  display: none;
}

.cg-card {
  width: 100%;
  max-width: 480px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(247, 151, 30, 0.2);
}

.cg-images-row {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.4);
}

.cg-image-container {
  flex: 1;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.cg-image-container:only-child {
  aspect-ratio: 16 / 9;
}

.cg-image-container.hidden {
  display: none;
}

.cg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cg-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cg-placeholder.hidden {
  display: none;
}

.cg-ph-svg {
  width: 100%;
  height: 100%;
  line-height: 0;
}

.cg-ph-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cg-monument-name {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  padding: 12px 16px;
  color: #ffd200;
  letter-spacing: 1px;
}

.cg-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.cg-option-btn {
  padding: 16px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 1.2;
}

.cg-option-btn:hover:not(.disabled) {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.cg-option-btn.selected {
  border-color: #f7971e;
  background: rgba(247, 151, 30, 0.15);
}

.cg-option-btn.correct {
  border-color: #00c853;
  background: rgba(0, 200, 83, 0.2);
}

.cg-option-btn.disabled {
  cursor: default;
  opacity: 0.7;
}

.cg-status {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  min-height: 28px;
  transition: opacity 0.3s;
}

.cg-status-ok {
  color: #00c853;
}

.cg-status-err {
  color: #ff1744;
}

.cg-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
  max-width: 480px;
}

.cg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  min-width: 72px;
}

.cg-stat-label {
  font-size: 0.6rem;
  color: #888;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cg-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffd200;
}

/* Leaderboard */
.leaderboard-item {
  padding: 10px;
  margin: 5px 0;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 1.1rem;
}

.leaderboard-item.highlight {
  background: rgba(247, 151, 30, 0.15);
  border: 1px solid rgba(247, 151, 30, 0.3);
}

/* Game Over */
#game-over-screen h1 {
  font-size: 3.5rem;
  letter-spacing: 8px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.winner-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
}

.winner-display svg {
  display: block;
}

.winner-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffd200;
  text-align: center;
}

.final-scores {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 30px;
}

.final-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 5px 0;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 1.2rem;
}

.final-score-item svg {
  display: block;
  flex-shrink: 0;
}

.final-score-item .fs-name {
  flex: 1;
  text-align: left;
}

.final-score-item.winner-style {
  background: linear-gradient(135deg, rgba(247, 151, 30, 0.2), rgba(255, 210, 0, 0.1));
  border: 1px solid rgba(247, 151, 30, 0.4);
  font-weight: 700;
  font-size: 1.4rem;
}

.final-score-item .fs-name {
  flex: 1;
  text-align: left;
}

.final-score-item .fs-score {
  color: #ffd200;
  font-weight: 700;
}

/* Banter Toasts */
.banter-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 20px 32px;
  border-radius: 16px;
  font-size: 1.3rem;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 640px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  line-height: 1.45;
}

.banter-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-height: 500px) {
  .banter-toast {
    bottom: 10px;
  }
}

.banter-self {
  background: linear-gradient(135deg, #ff1744, #d50000);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.banter-self-correct {
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #1a1a2e;
  border: 1px solid rgba(0, 200, 83, 0.4);
  font-weight: 700;
}

.banter-opponent {
  background: linear-gradient(135deg, #7c4dff, #651fff);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.banter-opponent strong {
  color: #ffd200;
}

.banter-opponent-correct {
  background: linear-gradient(135deg, #0091ea, #00b0ff);
  color: #fff;
  border: 1px solid rgba(0, 145, 234, 0.4);
}

.banter-opponent-correct strong {
  color: #69f0ae;
}

.hidden {
  display: none !important;
}

/* Responsive - Mobile */
@media (max-width: 600px) {
  .screen {
    padding: 12px;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: flex-start;
  }

  .screen.active {
    justify-content: flex-start;
    padding-top: max(12px, env(safe-area-inset-top, 12px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }

  .logo-row {
    gap: 6px;
  }

  .logo-icon svg {
    width: 36px;
    height: 36px;
  }

  .logo h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 0.75rem;
    margin-bottom: 20px;
  }

  .tab-btn {
    padding: 10px;
    font-size: 0.85rem;
  }

  input {
    padding: 12px 14px;
    font-size: 1rem;
    min-height: 44px;
  }

  .btn-primary {
    padding: 12px 20px;
    font-size: 1rem;
    min-height: 44px;
  }

  .lobby-header h2 {
    font-size: 1.3rem;
  }

  .room-code-display {
    font-size: 1.1rem;
    padding: 12px;
    margin: 10px 0;
  }

  .room-code-display span {
    font-size: 1.8rem;
    letter-spacing: 5px;
  }

  .settings-row {
    flex-direction: column;
    gap: 6px;
  }

  .seg-btn {
    padding: 6px 4px;
    font-size: 0.7rem;
  }

  .avatar-picker {
    gap: 4px;
  }

  .avatar-option {
    padding: 3px;
    border-radius: 10px;
  }

  .avatar-option svg {
    width: 38px;
    height: 38px;
  }

  .player-list {
    gap: 12px;
    margin: 12px 0;
  }

  .player-card {
    padding: 10px 12px;
    min-width: 80px;
  }

  .player-card svg {
    width: 40px;
    height: 40px;
  }

  .player-card-name {
    font-size: 0.75rem;
  }

  .scorecard {
    padding: 10px 12px;
    gap: 2px 8px;
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .sc-label {
    font-size: 0.5rem;
    letter-spacing: 1px;
  }

  .sc-name {
    font-size: 0.8rem;
  }

  .sc-avatar svg {
    width: 28px;
    height: 28px;
  }

  .sc-score {
    font-size: 1.4rem;
  }

  .scorecard-vs {
    font-size: 0.65rem;
  }

  .scorecard-bar-bg {
    height: 4px;
  }

  .game-info {
    margin-bottom: 4px;
  }

  .game-title {
    font-size: 0.7rem;
  }

  .question-counter {
    font-size: 0.7rem;
  }

  .timer-bar-container {
    height: 4px;
  }

  .game-content {
    flex: 1;
    min-height: 0;
  }

  .question-text {
    font-size: 1.15rem;
    margin-bottom: 16px;
    min-height: auto;
    line-height: 1.35;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .option-btn {
    padding: 14px;
    font-size: 0.95rem;
    border-radius: 10px;
    min-height: 48px;
  }

  #result-message {
    font-size: 1.5rem;
  }

  #game-over-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }

  .winner-display {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }

  .final-score-item {
    padding: 10px 14px;
    font-size: 1rem;
  }

  .final-score-item.winner-style {
    font-size: 1.1rem;
  }

  .banter-toast {
    bottom: 10px;
    padding: 14px 22px;
    font-size: 1.05rem;
    max-width: 92vw;
    width: auto;
    border-radius: 12px;
  }

  .boggle-board {
    max-width: 260px;
    gap: 6px;
    padding: 8px;
  }

  .boggle-cell {
    font-size: 1.4rem;
    border-radius: 8px;
  }

  .boggle-cell-qu {
    font-size: 1rem;
  }

  .boggle-word-display {
    max-width: 260px;
    font-size: 1.1rem;
    padding: 10px 12px;
  }

  .boggle-words-layout {
    max-width: 100%;
    gap: 8px;
  }

  .boggle-words-list {
    height: 140px;
  }

  .cg-card {
    max-width: 100%;
    border-radius: 10px;
  }

  .cg-images-row {
    gap: 2px;
  }

  .cg-image-container {
    aspect-ratio: 4 / 3;
  }

  .cg-image-container:only-child {
    aspect-ratio: 16 / 9;
  }

  .cg-monument-name {
    font-size: 1rem;
    padding: 10px 12px;
  }

  .cg-options {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 100%;
  }

  .cg-option-btn {
    padding: 14px;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: 44px;
  }

  .cg-stats {
    gap: 10px;
  }

  .cg-stat {
    min-width: 60px;
    padding: 6px 12px;
  }

  .cg-stat-value {
    font-size: 1.1rem;
  }
}

@media (max-width: 400px) {
  .logo-row { gap: 4px; }
  .logo-icon svg { width: 28px; height: 28px; }
  .logo h1 { font-size: 1.4rem; letter-spacing: 1px; }
  .question-text { font-size: 1rem; }
  .sc-score { font-size: 1.2rem; }
  .scorecard { padding: 8px 10px; }
  .sc-name { font-size: 0.7rem; }
  .option-btn { padding: 12px; font-size: 0.85rem; min-height: 44px; }
  #game-over-screen h1 { font-size: 2rem; }
  .banter-toast { font-size: 0.95rem; padding: 12px 18px; }
  .boggle-board { max-width: 220px; gap: 4px; padding: 6px; }
  .boggle-cell { font-size: 1.1rem; border-radius: 6px; }
  .boggle-cell-qu { font-size: 0.85rem; }
  .boggle-word-display { max-width: 220px; font-size: 1rem; padding: 8px 10px; min-height: 40px; }
  .boggle-words-list { height: 120px; }
  .boggle-word-item { font-size: 0.75rem; padding: 3px 6px; }
  .cg-monument-name { font-size: 0.85rem; padding: 8px 10px; }
  .cg-option-btn { padding: 12px; font-size: 0.85rem; min-height: 40px; }
  .cg-stat { min-width: 52px; padding: 4px 8px; }
  .cg-stat-value { font-size: 1rem; }
  .cg-status { font-size: 0.95rem; }
}

/* CARDS */
.cards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cards-prompt {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  color: #ffd200;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,210,0,0.2);
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cards-phase-label {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  min-height: 18px;
}

.cards-hand {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  padding: 4px 0;
}

.cards-card {
  background: #fff;
  color: #222;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  word-break: break-word;
}

.cards-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.cards-card.selected {
  border: 3px solid #ffd200;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 6px 20px rgba(255,210,0,0.4);
}

.cards-card:active {
  transform: scale(0.97);
}

.cards-round-result {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd200;
  padding: 12px;
  min-height: 0;
}

/* Played cards in scorecard */
.sc-played-card {
  font-size: 0.75rem;
  color: #222;
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
  width: 100%;
  max-width: 160px;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-played-card-clickable {
  cursor: pointer;
  transition: all 0.15s;
  animation: cards-pop-in 0.3s ease;
}

.sc-played-card-clickable:hover {
  transform: scale(1.08);
}

.sc-played-card-mine {
  border: 2px solid #ffd200;
}

.sc-played-card-mine:hover {
  box-shadow: 0 4px 16px rgba(255,210,0,0.5);
}

.sc-played-card-opponent {
  border: 2px solid #7c4dff;
}

.sc-played-card-opponent:hover {
  box-shadow: 0 4px 16px rgba(124,77,255,0.5);
}

.sc-played-card-selected {
  border-color: #00c853 !important;
  background: #e8f5e9;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,200,83,0.4);
}

.sc-played-card-winner {
  border-color: #ffd200 !important;
  background: #fff8e1;
  box-shadow: 0 2px 12px rgba(255,210,0,0.5);
}

@keyframes cards-pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 400px) {
  .cards-card {
    min-height: 60px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .cards-prompt {
    font-size: 1rem;
    padding: 10px 14px;
    min-height: 40px;
  }
  .sc-played-card {
    font-size: 0.65rem;
    padding: 4px 6px;
    max-width: 120px;
  }
}

@media (min-width: 601px) {
  .screen {
    min-height: auto;
    padding: 30px;
  }
  body {
    align-items: center;
  }
}
