/* Puzzle Browser Styles */

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* Top Bar */
.puzzles-top-bar {
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.puzzles-top-bar .top-bar-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.puzzles-top-bar .top-bar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-bar-center {
  flex: 1;
  text-align: center;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Pieces/Stars display */
.pieces-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: 8px;
}

.pieces-display .piece-icon {
  flex-shrink: 0;
}

.pieces-display #star-count {
  font-weight: 500;
  color: #fff;
  font-size: 14px;
}

/* User section */
.user-section {
  position: relative;
}

.sign-in-link {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sign-in-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.user-menu-btn:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.dropdown-arrow {
  font-size: 10px;
  opacity: 0.7;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.user-dropdown .dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #fff;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.user-dropdown .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Main Container */
.puzzles-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 84px 24px 24px 24px;
}

/* Filters */
.puzzles-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.filter-group select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.filter-group select:hover {
  background: rgba(255, 255, 255, 0.15);
}

.filter-group select option {
  background: #1a1a2e;
  color: #fff;
}

/* Search Box */
.search-group {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-group input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search-group input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-group input:focus {
  border-color: rgba(102, 126, 234, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

/* Popular Tags */
.popular-tags {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tags-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.tags-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-btn {
  padding: 6px 14px;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-btn:hover {
  background: rgba(102, 126, 234, 0.35);
  border-color: rgba(102, 126, 234, 0.6);
  transform: translateY(-1px);
}

.tag-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}

.tags-empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.6);
}

/* Puzzle Grid */
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Puzzle Card */
.puzzle-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.puzzle-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(102, 126, 234, 0.5);
}

.puzzle-card.locked {
  opacity: 0.8;
}

.puzzle-thumbnail {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.puzzle-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.puzzle-card:hover .puzzle-thumbnail img {
  transform: scale(1.05);
}

.lock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.claimed-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  background: rgba(76, 175, 80, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.free-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.puzzle-card-info {
  padding: 16px;
}

.puzzle-name {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.puzzle-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.difficulty-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.difficulty-1 { background: #4caf50; color: #fff; }
.difficulty-2 { background: #2196f3; color: #fff; }
.difficulty-3 { background: #ff9800; color: #000; }
.difficulty-6 { background: #e65100; color: #fff; }
.difficulty-4 { background: #f44336; color: #fff; }
.difficulty-5 { background: linear-gradient(135deg, #9c27b0, #673ab7); color: #fff; }

.piece-count {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.puzzle-reward {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #ffd700;
}

/* Modal Base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: linear-gradient(135deg, #1e1e32 0%, #16213e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Auth modal should be narrower */
.auth-modal-content {
  width: 360px;
  max-width: 90%;
}

.verify-modal-content {
  width: 400px;
  max-width: 90%;
}

/* Quickplay modal should match homepage size */
.quickplay-modal-content {
  max-width: 700px;
}

/* Puzzle Modal */
.puzzle-modal-content {
  padding: 24px;
}

.puzzle-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.puzzle-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.puzzle-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .puzzle-modal-body {
    grid-template-columns: 1fr;
  }
}

.puzzle-modal-image {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: rgba(0, 0, 0, 0.2);
}

.puzzle-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
}

.lock-icon {
  font-size: 48px;
}

.puzzle-modal-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.puzzle-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Modal Tags */
.modal-puzzle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.modal-puzzle-tags.hidden {
  display: none;
}

.modal-tag-btn {
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #a8b4ff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-tag-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.5);
  color: #fff;
}

/* Difficulty Selector */
.difficulty-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.difficulty-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.difficulty-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
}

.difficulty-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(102, 126, 234, 0.5);
}

.difficulty-option.selected {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

.difficulty-option.locked {
  opacity: 0.6;
}

.difficulty-option .diff-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.difficulty-option .diff-pieces {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.difficulty-option .diff-reward {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #ffd700;
  margin-top: 4px;
}

.difficulty-option .diff-reward img {
  width: 12px;
  height: 12px;
}

/* Difficulty badges in card - allow wrapping */
.difficulty-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.difficulty-badges .difficulty-badge {
  font-size: 10px;
  padding: 2px 6px;
}

.puzzle-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.star-reward, .star-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffd700;
}

/* Rating */
.puzzle-rating {
  display: flex;
  gap: 12px;
}

.rate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}

.rate-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.rate-btn.active.rate-up {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4caf50;
}

.rate-btn.active.rate-down {
  background: rgba(244, 67, 54, 0.3);
  border-color: #f44336;
}

/* Actions */
.puzzle-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.unlock-btn, .play-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.unlock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
  color: #000;
}

.unlock-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.unlock-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.play-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-error {
  color: #f44336;
  font-size: 14px;
  margin: 0;
  padding: 10px;
  background: rgba(244, 67, 54, 0.1);
  border-radius: 8px;
}

.modal-claimed {
  color: #4caf50;
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Leaderboard */
.puzzle-leaderboard {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.puzzle-leaderboard h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.leaderboard-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.leaderboard-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.leaderboard-tab.active {
  background: #667eea;
  color: #fff;
}

.leaderboard-content {
  min-height: 100px;
}

.leaderboard-content.hidden {
  display: none;
}

.leaderboard-loading {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.6);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 12px;
  text-align: left;
}

.leaderboard-table th {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-empty {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* Room Modal */
.room-modal-content {
  padding: 32px;
  max-width: 400px;
}

.room-modal-content h2 {
  margin: 0 0 12px 0;
}

.room-modal-content p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 20px 0;
  font-size: 14px;
}

.room-modal-content input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.room-modal-content input::placeholder {
  text-transform: none;
  color: rgba(255, 255, 255, 0.4);
}

.room-modal-content input:focus {
  outline: none;
  border-color: #667eea;
}

.room-modal-actions {
  display: flex;
  gap: 12px;
}

.room-modal-actions .cancel-btn {
  flex: 1;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.room-modal-actions .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.room-modal-actions .play-btn {
  flex: 1;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Star Progress */
.star-progress {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 12px;
}

.star-progress h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.progress-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.progress-value .claimed {
  color: #4caf50;
  font-weight: 500;
}

.progress-value .not-claimed {
  color: rgba(255, 255, 255, 0.4);
}

/* Play Mode Modal */
.play-modal-content {
  padding: 32px;
  max-width: 450px;
  text-align: center;
}

.play-modal-content h2 {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
}

.play-puzzle-name {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0 0 24px 0;
}

.play-mode-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.play-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.play-mode-btn:hover {
  transform: translateY(-2px);
}

.solo-btn {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(67, 160, 71, 0.2) 100%);
  border-color: rgba(76, 175, 80, 0.5);
  color: #fff;
}

.solo-btn:hover {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(67, 160, 71, 0.3) 100%);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.multiplayer-btn {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border-color: rgba(102, 126, 234, 0.5);
  color: #fff;
}

.multiplayer-btn:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-icon {
  font-size: 32px;
}

.mode-title {
  font-size: 18px;
  font-weight: 600;
}

.mode-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* Guest name section in play modal */
.play-guest-name-section {
  margin-bottom: 16px;
}

.play-guest-name-section input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  text-align: center;
}

.play-guest-name-section input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.play-guest-name-section input:focus {
  outline: none;
  border-color: #667eea;
}

/* Room code section in play modal */
.room-code-section {
  text-align: left;
}

.room-code-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.room-code-section input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.room-code-section input::placeholder {
  text-transform: none;
  color: rgba(255, 255, 255, 0.4);
}

.room-code-section input:focus {
  outline: none;
  border-color: #667eea;
}

.room-code-actions {
  display: flex;
  gap: 12px;
}

.room-code-actions .cancel-btn {
  flex: 1;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.room-code-actions .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.room-code-actions .play-btn {
  flex: 1;
}

.room-code-error {
  color: #f44336;
  font-size: 13px;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
  text-align: center;
}

.cancel-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 8px;
  margin-top: 8px;
}

.cancel-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 640px) {
  .puzzles-top-bar .top-bar-content {
    flex-wrap: wrap;
    gap: 12px;
  }

  .top-bar-center {
    order: 3;
    flex-basis: 100%;
  }

  .page-title {
    font-size: 1rem;
  }

  .puzzles-container {
    padding: 80px 16px 16px 16px;
  }

  .puzzles-filters {
    flex-direction: column;
  }

  .puzzle-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .puzzle-modal-content {
    padding: 16px;
  }

  .puzzle-actions {
    flex-direction: column;
  }

  .play-modal-content {
    padding: 24px;
  }
}
