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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #24201D;
  padding: 10px;
}

.container {
  display: flex;
  gap: 15px;
  max-width: 1600px;
  margin: 0 auto;
}

.left-panel {
  flex: 0.9;
  background: #311C35;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.right-panel {
  flex: 1;
  background: #311C35;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

h2 {
  margin: 0;
  color: #E5C6FF;
  font-size: 15px;
}

.grid-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.grid-header-bar h2 {
  margin: 0;
  flex: 1;
  text-align: center;
}

.grid-header-left,
.grid-header-right {
  display: flex;
  gap: 5px;
}

.grid-content {
  margin-top: 30px;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-btn {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(227, 157, 227, 0.6);
  border-radius: 50%;
  background: rgba(26, 16, 22, 0.8);
  color: #F4CF8B;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.info-btn:hover {
  background: rgba(227, 157, 227, 0.2);
  border-color: #AA5EEA;
}

.help-modal.show {
  display: block;
}

.controls-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls {
  margin-bottom: 20px;
}


.lock-coordinates {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(244, 207, 139, 0.9);
}

.lock-coordinates input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.reset-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(244, 207, 139, 0.9);
}

.reset-confirm input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.btn {
  padding: 7px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #E0984B;
  color: #24201D;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background-color: #F4CF8B;
}

.btn-primary:disabled {
  background-color: #443521;
  color: rgba(244, 207, 139, 0.4);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background-color: #6B4B7A;
  color: #F4CF8B;
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #AA5EEA;
  color: #F4CF8B;
}

.btn-secondary:disabled {
  background-color: #443521;
  color: rgba(244, 207, 139, 0.4);
  cursor: not-allowed;
  opacity: 0.6;
}

.table-container {
  overflow-y: visible;
  border: 1px solid rgba(227, 157, 227, 0.3);
  border-radius: 4px;
}

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

thead {
  position: sticky;
  top: 0;
  background-color: #443521;
  z-index: 10;
}

th {
  padding: 6px 5px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #F4CF8B;
  border-bottom: 2px solid rgba(227, 157, 227, 0.3);
}

th:nth-child(1) {
  width: 70px;
}

th:nth-child(2) {
  width: 40px;
  text-align: center;
}

th:nth-child(3) {
  width: 35px;
  text-align: center;
}

th:nth-child(4) {
  width: 60px;
}

th:nth-child(n+5) {
  width: 20px;
  text-align: center;
}

tbody tr {
  border-bottom: 1px solid rgba(68, 53, 33, 0.3);
}

tbody tr:nth-child(even) {
  background-color: rgba(68, 53, 33, 0.2);
}

tbody tr:hover {
  background-color: rgba(227, 157, 227, 0.1);
}

td {
  padding: 5px;
  font-size: 11px;
  color: #F4CF8B;
}

td:nth-child(1) {
  font-weight: 500;
  color: #F4CF8B;
}

td.house-name {
  cursor: pointer;
  user-select: none;
}

td.house-name:hover {
  background-color: rgba(227, 157, 227, 0.2);
}

td.house-completed {
  opacity: 0.7;
  background-color: rgba(224, 152, 75, 0.25);
  color: #F4CF8B;
  border-left: 3px solid #E0984B;
}

td:nth-child(2) {
  text-align: center;
  padding: 2px;
}

.house-logo-cell {
  text-align: center;
  padding: 2px;
}

.house-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

td:nth-child(3) {
  text-align: center;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

td:nth-child(3):hover {
  background-color: rgba(227, 157, 227, 0.2);
}

td.rep-completed {
  text-decoration: line-through;
  opacity: 0.7;
  background-color: rgba(224, 152, 75, 0.25);
}

td:nth-child(n+5) {
  text-align: center;
}

select.coord-select {
  width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(227, 157, 227, 0.3);
  border-radius: 3px;
  font-size: 11px;
  background-color: #1a1016;
  color: #F4CF8B;
  cursor: pointer;
}

select.coord-select:focus {
  outline: none;
  border-color: #AA5EEA;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

td input[type="checkbox"]:disabled {
  background-color: #f5f5f5;
}

.day-selector {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.view-btn {
  flex: 1;
  min-width: 85px;
  padding: 5px 8px;
  border: 1px solid rgba(227, 157, 227, 0.3);
  background: #1a1016;
  color: #F4CF8B;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
}

.view-btn:hover {
  background-color: rgba(227, 157, 227, 0.2);
}

.view-btn.active {
  background-color: #AA5EEA;
  color: #F4CF8B;
  border-color: #AA5EEA;
}

.view-btn.disabled {
  background-color: #443521;
  color: rgba(244, 207, 139, 0.4);
  cursor: not-allowed;
  opacity: 0.6;
}

.grid-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.show-all-days {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(244, 207, 139, 0.9);
}

.show-all-days input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.color-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(244, 207, 139, 0.9);
}

.color-selector select {
  padding: 3px 6px;
  border: 1px solid rgba(227, 157, 227, 0.3);
  border-radius: 3px;
  font-size: 11px;
  background-color: #1a1016;
  color: #F4CF8B;
  cursor: pointer;
}

.color-selector select:focus {
  outline: none;
  border-color: #AA5EEA;
}

.grid {
  display: grid;
  grid-template-columns: 25px repeat(9, 1fr);
  gap: 1px;
  background-color: rgba(68, 53, 33, 0.5);
  padding: 2px;
  border-radius: 4px;
  max-width: 693px;
  margin: 0 auto;
}

.grid-header {
  background-color: #443521;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #F4CF8B;
  padding: 2px;
}

.grid-row-label {
  background-color: #443521;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #F4CF8B;
}

.grid-cell {
  aspect-ratio: 1;
  background-color: #1a1016;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all 0.2s;
  position: relative;
  padding: 2px;
}

.coord-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 208%;
  font-weight: 700;
  color: rgba(224, 152, 75, 0.15);
  z-index: 1;
  pointer-events: none;
}

.grid-cell.selected .coord-watermark {
  color: rgba(36, 32, 29, 0.4);
}

.grid-cell.selected {
  background-color: #E0984B;
  color: #24201D;
  font-weight: 600;
}

.grid-cell .house-name {
  font-size: 10.5px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
  text-align: center;
  font-weight: 700;
  z-index: 2;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.house-name-bottom {
  bottom: 2px;
}

.house-name-top {
  top: 2px;
}

.house-name-center {
  top: 50%;
  transform: translate(-50%, -50%);
}

.house-name-white {
  color: white;
}

.house-name-black {
  color: #24201D;
}

.house-name-red {
  color: #E53E3E;
}

.house-name-green {
  color: #00FF00;
}

/* Help Modal Styles */
.help-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: #311C35;
  margin: 5% auto;
  padding: 20px 20px 30px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  width: 80%;
  max-width: 500px;
  border: 1px solid rgba(227, 157, 227, 0.3);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #F4CF8B;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(224, 152, 75, 0.2);
  color: #E0984B;
}

.modal-content h3 {
  margin: 0 0 15px 0;
  color: #E5C6FF;
  font-size: 16px;
}

.help-text p {
  margin: 8px 0;
  color: #F4CF8B;
  font-size: 12px;
  line-height: 1.4;
}

.help-text strong {
  color: #E0984B;
}

.privacy-notice {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(227, 157, 227, 0.3);
}

.privacy-notice p {
  margin: 0;
  color: rgba(244, 207, 139, 0.8);
  font-size: 11px;
  line-height: 1.4;
}

.privacy-notice strong {
  color: #AA5EEA;
}