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

body {
  background: #c8c8c8;
  color: #1a1a1a;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #e0e0e0;
  border-bottom: 1px solid #bbb;
}

#toolbar h1 {
  font-size: 1rem;
  color: #444;
}

#rune-input {
  width: 48px;
  text-align: center;
  font-size: 1.2rem;
  background: #f5f5f5;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 4px;
  border-radius: 4px;
}

button {
  background: #555;
  color: #f5f5f5;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: monospace;
}

button:hover {
  background: #333;
}

#canvas-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

canvas {
  display: block;
  cursor: crosshair;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#auth-box {
  background: #f5f5f5;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
}

#auth-box h2 {
  color: #444;
  text-align: center;
  margin-bottom: 8px;
}

#auth-box input {
  background: #fff;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
}

#auth-box button {
  width: 100%;
}

#account-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#account-box {
  background: #f5f5f5;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
}

#account-box h2 {
  color: #444;
  text-align: center;
  margin-bottom: 8px;
}

#account-box input {
  background: #fff;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

#account-box button {
  width: 100%;
}

#account-error {
  color: #555;
  font-size: 0.8rem;
  text-align: center;
  min-height: 1em;
}

#account-avatar-preview {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid #bbb;
  object-fit: cover;
  background: #fff;
  cursor: pointer;
}

#account-avatar-preview:hover {
  border-color: #777;
}

#account-delete-btn {
  background: #a33;
}

#account-delete-btn:hover {
  background: #822;
}

#account-delete-btn.warn-1 {
  background: #822;
  font-weight: bold;
}

#account-delete-btn.warn-1:hover {
  background: #611;
}

#account-delete-btn.warn-2 {
  background: #400;
  font-weight: bold;
  text-transform: uppercase;
}

#account-delete-btn.warn-2:hover {
  background: #200;
}

#place-confirm {
  background: #555;
}

#place-confirm:hover {
  background: #333;
}

#auth-toggle {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  cursor: pointer;
}

#auth-toggle span {
  color: #444;
  text-decoration: underline;
  cursor: pointer;
}

#auth-error {
  color: #555;
  font-size: 0.8rem;
  text-align: center;
  min-height: 1em;
}

#status {
  font-size: 0.8rem;
  color: #777;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#currency-display {
  font-size: 0.8rem;
  color: #555;
  min-width: 90px;
}

#tooltip {
  position: fixed;
  background: #f5f5f5;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  display: none;
  z-index: 5;
}

#place-ui {
  position: absolute;
  display: none;
  align-items: center;
  gap: 4px;
  background: #f5f5f5;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 2px 4px;
  transform: translateX(-50%) translateY(-100%);
  margin-top: -4px;
  z-index: 4;
  user-select: none;
  white-space: nowrap;
}

#place-drag {
  cursor: grab;
  color: #888;
  padding: 0 3px;
  font-size: 1rem;
  line-height: 1;
}

#place-drag:active {
  cursor: grabbing;
}

#place-cost {
  font-size: 0.75rem;
  color: #666;
}

#profile-pic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #bbb;
  object-fit: cover;
  background: #f5f5f5;
  cursor: pointer;
  display: none;
}

#profile-pic:hover {
  border-color: #777;
}

#tooltip img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 4px;
}

#history-dl-wrap {
  position: relative;
}

#history-dl-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  padding: 12px;
  background: #f5f5f5;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 20;
}

#history-dl-panel.open {
  display: flex;
}

#history-dl-panel .hist-modes {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #444;
}

#history-dl-panel .hist-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#history-dl-panel input[type="number"],
#history-dl-panel input[type="datetime-local"] {
  width: 100%;
  background: #fff;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

#history-dl-panel select {
  font-size: 0.85rem;
  color: #444;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 4px 6px;
  font-family: monospace;
  width: 100%;
}

#hist-dl-error {
  color: #b00020;
  font-size: 0.75rem;
  min-height: 1em;
  white-space: pre-wrap;
}

#admin-dash-wrap {
  position: relative;
}

#admin-dash-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  flex-direction: column;
  gap: 10px;
  width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px;
  background: #f5f5f5;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 20;
}

#admin-dash-panel.open {
  display: flex;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.admin-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.admin-section h3 {
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.admin-section .admin-input,
.admin-section select {
  width: 100%;
  background: #fff;
  border: 1px solid #bbb;
  color: #1a1a1a;
  padding: 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

.admin-section label {
  font-size: 0.8rem;
  color: #444;
}

.admin-btn-row {
  display: flex;
  gap: 8px;
}

.admin-btn-row button {
  flex: 1;
  font-size: 0.8rem;
  padding: 6px 8px;
}

.admin-status {
  font-size: 0.75rem;
  color: #666;
  min-height: 1em;
  white-space: pre-wrap;
}

/* Beats the id rules that set display (e.g. .admin-section's flex), so the
   hidden attribute and property always hide. */
[hidden] {
  display: none !important;
}

#coords {
  font-size: 0.8rem;
  color: #777;
  width: 180px;
  font-family: inherit;
  border: 1px solid transparent;
  background: transparent;
}
