/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Body */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #8d0505;
  color: #157d04;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #cc0000;
  color: white;
  padding: 15px 20px;
  font-size: 1.2em;
}

header h1 {
  font-size: 2em;
}

#turnIndicator {
  font-weight: bold;
}

/* Main layout */
main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Board */
#boardContainer {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

#board {
  display: grid;
  grid-template-columns: repeat(15, 40px);
  grid-template-rows: repeat(15, 40px);
  gap: 2px;
  background: #000000;
  border: 3px solid #000000;
}

.cell {
  width: 40px;
  height: 40px;
  background: #c40000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.1em;
  border-radius: 4px;
  transition: background 0.2s;
}

.cell.dw { background: #10870e; } /* Double Word */
.cell.dl { background: #005508; } /* Double Letter */

.cell:hover {
  background: #207b0e;
  cursor: pointer;
}

/* Sidebar */
aside {
  flex: 1;
  background: #109041;
  padding: 15px;
  overflow-y: auto;
  border-left: 2px solid #ff0000;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h2 {
  margin-bottom: 8px;
  color: #cc0000;
  border-bottom: 1px solid #ffffff;
  padding-bottom: 4px;
}

/* Inputs & Buttons */
input[type="text"], input[type="file"], select {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px solid #000000;
  border-radius: 4px;
}

button {
  background: #07a81f;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 4px;
  width: 100%;
}

button:hover {
  background: #16953a;
}

/* Rack */
#rack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 0;
}

.tile {
  width: 35px;
  height: 35px;
  background: #fffae5;
  border: 2px solid #d70000;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.1em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Player list */
#playerListUl {
  list-style: none;
  padding-left: 0;
}

#playerListUl li {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

#playerListUl li .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid #3e9f3a;
  object-fit: cover;
}

/* Dictionary checker */
#dictResult {
  margin-top: 4px;
  font-weight: bold;
}

/* Profile preview */
#profilePreview img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #de0000;
  margin-bottom: 5px;
  object-fit: cover;
}

/* Word input */
#turnSection input, #turnSection select, #turnSection button {
  margin-bottom: 6px;
}
