:root {
  --bg: #5d5050;
  --panel: #232323;
  --accent: #ffcf27;
  --link: #71f3ff;
  --text: #ffffff;
  --muted: #c0c0c0;
  --border: #ffffff;
  --hover: #fb8200;
}

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

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

#wrapper {
  min-width: 1000px;
  min-height: 100%;
}

#app-shell {
  width: 1140px;
  margin: 0 auto;
  position: relative;
}

#header {
  height: 115px;
  width: 180px;
  position: relative;
  left: 0;
  top: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

#header img {
  display: block;
  width: 175px;
  height: 115px;
  margin: 0 auto;
  object-fit: cover;
}

#middle {
  position: relative;
}

#container,
#container2 {
  width: 100%;
  float: left;
}

#links {
  margin-left: 220px;
  position: relative;
  top: -107px;
}

.top-nav {
  display: flex;
  background: var(--panel);
}

.top-link {
  width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-left: 0;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.top-link:first-child {
  width: 112px;
  border-left: 1px solid var(--border);
}

.top-link:hover,
.top-link.is-active {
  background: var(--hover);
}

#seasonHolder,
#titleHolder {
  text-align: center;
  width: 760px;
  position: relative;
  left: 250px;
}

#seasonHolder {
  top: -90px;
}

#titleHolder {
  top: -75px;
}

#title,
#current-title {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent);
  text-align: center;
}

#sideLeft2,
#sideLeft3 {
  float: left;
  width: 180px;
  position: relative;
  left: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: center;
  color: var(--muted);
  clear: left;
}

#sideLeft2 {
  top: -58px;
  padding: 10px 8px;
}

#sideLeft3 {
  top: -38px;
  padding: 10px 8px;
}

.side-section {
  display: block;
}

.side-hidden {
  display: none;
}

.sidebar-button {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sidebar-button:hover,
.sidebar-button.primary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-line {
  margin-bottom: 10px;
  color: var(--muted);
}

.status-line strong {
  color: var(--accent);
}

#content {
  position: absolute;
  left: 250px;
  width: 760px;
  margin-top: -58px;
  padding: 5px;
  color: var(--text);
  text-align: center;
}

.history-nav {
  margin-bottom: 14px;
  line-height: 1.6;
}

.history-button {
  display: inline-block;
  margin: 0 4px 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.history-button.is-active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.page-panel {
  display: none;
}

.page-panel-visible {
  display: block;
}

.lead-copy,
.empty-copy,
.setup-copy,
.help-copy {
  margin-bottom: 14px;
  line-height: 1.5;
}

.winner-banner {
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: bold;
}

.subheading {
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: bold;
}

.events-list {
  text-align: center;
}

.event-line {
  margin-bottom: 10px;
  line-height: 1.55;
}

.fallen-holder {
  margin-top: 20px;
}

.fallen-list {
  line-height: 1.6;
}

.bottom-controls {
  margin-top: 26px;
  text-align: center;
}

.bottom-button {
  min-width: 130px;
  margin: 0 6px 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.bottom-button.primary,
.bottom-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.bottom-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
}

.tribute-table {
  width: 650px;
  margin: 0 auto;
  border-collapse: collapse;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: bold;
}

.tribute-table th,
.tribute-table td {
  padding: 6px 4px;
  vertical-align: middle;
}

.tribute-table th {
  color: var(--accent);
}

.tribute-table input {
  width: 100%;
  border: 1px solid #8f8f8f;
  background: #3c3434;
  color: var(--text);
  padding: 4px 5px;
}

.tribute-table input[type="color"] {
  min-width: 56px;
  height: 28px;
  padding: 2px;
}

.district-input {
  width: 48px;
  text-align: center;
}

.tribute-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.avatar-shell {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 32px;
}

.avatar-image,
.avatar-fallback {
  width: 100%;
  height: 100%;
}

.avatar-image {
  display: none;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 10px;
}

.preview-name {
  display: block;
  text-align: left;
  min-height: 32px;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.remove-button {
  width: 32px;
  padding: 4px 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  text-align: left;
}

.field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

.field input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  background: transparent;
}

.theme-heading {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }
}
