* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --wood-light: #DEB887; --wood-medium: #D2691E; --wood-dark: #8B4513; --wood-border: #5D3A1A; --cream: #FFF8DC; }
body { font-family: Georgia, serif; background: linear-gradient(135deg, #2c1810 0%, #4a2c17 100%); min-height: 100vh; color: var(--cream); }
.container { max-width: 100%; margin: 0; padding: 10px 20px; }
header { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; background: linear-gradient(180deg, rgba(139,69,19,0.8) 0%, rgba(93,58,26,0.9) 100%); border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--wood-border); }
h1 { font-size: 1.2rem; color: var(--wood-light); text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
nav a { color: var(--cream); text-decoration: none; margin-left: 10px; padding: 4px 8px; border-radius: 5px; transition: background 0.3s; }
nav a:hover { background: rgba(222,184,135,0.2); }
.auth-section, .dashboard-section, .game-section, .admin-section, .invite-section { background: rgba(139,69,19,0.6); padding: 20px; border-radius: 8px; border: 1px solid var(--wood-border); margin-bottom: 15px; }
.hidden { display: none !important; }
input, select, textarea { width: 100%; padding: 12px; margin: 10px 0; border: 2px solid var(--wood-border); border-radius: 5px; background: var(--cream); color: #2F2F2F; font-family: inherit; }
button { padding: 12px 24px; background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%); border: 2px solid var(--wood-border); border-radius: 5px; color: #2F2F2F; font-weight: bold; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
button:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
button.secondary { background: linear-gradient(180deg, #888 0%, #666 100%); color: white; }
button.danger { background: linear-gradient(180deg, #c44 0%, #922 100%); color: white; }
.chess-container { display: flex; gap: 20px; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; }
.board-wrapper { position: relative; display: flex; justify-content: center; flex-shrink: 0; }
#chessboard { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 84vmin; height: 84vmin; border: 4px solid var(--wood-dark); border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); box-sizing: border-box; }
.square { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.square.light { background: linear-gradient(135deg, var(--cream) 0%, #f5e6c8 100%); }
.square.dark { background: linear-gradient(135deg, var(--wood-medium) 0%, var(--wood-dark) 100%); }
.square.selected { box-shadow: inset 0 0 0 4px #ffd700; }
.square.valid-move::after { content: ''; position: absolute; width: 30%; height: 30%; background: rgba(0,128,0,0.5); border-radius: 50%; }
.square.valid-capture { box-shadow: inset 0 0 0 4px rgba(255,0,0,0.5); }
.piece { width: 100%; height: 100%; user-select: none; display: flex; align-items: center; justify-content: center; }
.piece svg { width: 85%; height: 85%; }
.piece.white svg { }
.piece.black svg { }
.promotion-piece { cursor: pointer; padding: 8px 12px; border-radius: 5px; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.promotion-piece svg { width: 50px; height: 50px; }
.promotion-piece.white { }
.promotion-piece.black { }

/* Mobile responsive styles */
@media (max-width: 768px) {
  .container { padding: 10px; }
  header { display: none; }
  h1 { font-size: 1.5rem; }
  nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
  nav a { margin-left: 0; margin: 5px; padding: 6px 12px; font-size: 0.9rem; }
  .auth-section, .dashboard-section, .game-section, .admin-section, .invite-section { padding: 15px; margin-bottom: 15px; }
  .chess-container { flex-direction: column; align-items: center; gap: 15px; }
  .board-wrapper { width: 100%; display: flex; justify-content: center; min-width: auto; flex: none; }
  #chessboard { width: 90vmin; height: 90vmin; max-width: calc(100vw - 20px); max-height: calc(100vw - 20px); }
  .piece svg { width: 80%; height: 80%; }
  .game-info { min-width: auto; width: 100%; padding: 15px; }
  .move-history { max-height: 150px; }
  .controls { flex-direction: row; }
  .controls button { flex: 1; min-width: 0; padding: 10px 8px; font-size: 0.9rem; }
  .promotion-options { padding: 15px; gap: 10px; }
  .promotion-piece svg { width: 40px; height: 40px; }
  input, select, textarea { padding: 10px; }
  button { padding: 10px 16px; }
  .game-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  table { font-size: 0.85rem; }
  th, td { padding: 8px; }
}

@media (max-width: 480px) {
  header { display: none; }
  h1 { font-size: 1.2rem; }
  nav a { padding: 5px 10px; font-size: 0.8rem; }
  .auth-section, .dashboard-section, .game-section, .admin-section, .invite-section { padding: 10px; }
  .controls button { padding: 8px 6px; font-size: 0.8rem; }
}
.game-info { flex: 1; min-width: 250px; max-width: 500px; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; border: 1px solid var(--wood-border); }
.move-history { max-height: 250px; overflow-y: auto; margin: 15px 0; padding: 8px; background: rgba(255,248,220,0.1); border-radius: 5px; }
.move-item { padding: 6px 10px; margin: 3px 0; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; transition: background 0.2s; }
.move-item:hover { background: rgba(222,184,135,0.2); }
.move-item.active { background: rgba(222,184,135,0.4); border-left: 3px solid var(--wood-light); }
.move-number { color: var(--wood-light); font-weight: bold; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0; }
.comment-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--wood-border); }
.comments-list { max-height: 120px; overflow-y: auto; margin: 8px 0; }
.comment { padding: 6px; margin: 4px 0; background: rgba(255,255,255,0.1); border-radius: 4px; font-size: 0.85rem; }
.game-status { font-size: 1rem; margin: 10px 0; padding: 8px; background: rgba(0,0,0,0.3); border-radius: 5px; text-align: center; }
.game-list { list-style: none; }
.pending-label { background: #f0ad4e; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; margin-left: 10px; }
.game-item { padding: 15px; margin: 10px 0; background: rgba(255,255,255,0.1); border-radius: 5px; display: flex; justify-content: space-between; align-items: center; }
.game-item a { color: var(--wood-light); text-decoration: none; font-weight: bold; }
.game-item a:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--wood-border); }
th { background: rgba(0,0,0,0.3); color: var(--wood-light); }
.error { color: #ff6b6b; padding: 10px; background: rgba(255,0,0,0.2); border-radius: 5px; margin: 10px 0; }
.success { color: #6bff6b; padding: 10px; background: rgba(0,255,0,0.2); border-radius: 5px; margin: 10px 0; }
.notification { position: fixed; top: 20px; right: 20px; padding: 15px 25px; background: var(--wood-dark); border: 2px solid var(--wood-light); border-radius: 5px; z-index: 1000; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(400px); } to { transform: translateX(0); } }
.promotion-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 100; }
.promotion-options { display: flex; gap: 20px; background: var(--wood-dark); padding: 30px; border-radius: 10px; border: 3px solid var(--wood-light); }
.promotion-piece { font-size: 50px; cursor: pointer; padding: 10px; border-radius: 5px; transition: background 0.2s; }
.promotion-piece:hover { background: rgba(222,184,135,0.3); }
.turn-indicator { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 15px; }
.turn-dot { width: 12px; height: 12px; border-radius: 50%; }
.turn-dot.white { background: white; border: 2px solid black; }
.turn-dot.black { background: black; }
.your-color { font-size: 0.9rem; margin-bottom: 10px; color: var(--wood-light); }
.requests-section { margin-top: 20px; }
.request-item { padding: 10px; margin: 10px 0; background: rgba(255,255,255,0.1); border-radius: 5px; display: flex; justify-content: space-between; align-items: center; }
.request-actions { display: flex; gap: 10px; }