body {
  background: #000;
  color: #00ff00;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.6);
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  box-sizing: border-box;
}

main {
  padding: 0;
}

.grid {
  display: block;
}

.row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.tile {
  position: relative;
  display: block;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  border: 1px solid #00ff00;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.35);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.03);
}

.tile .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  color: #00ff00;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tile:hover .meta,
.tile:focus-visible .meta {
  opacity: 1;
}

.tile .delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tile:hover .delete,
.tile:focus-within .delete {
  opacity: 1;
}

.sentinel {
  height: 1px;
}

.status {
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.count-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 8px 14px;
  background: #000;
  border: 1px solid #00ff00;
  color: #00ff00;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.35);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.count-pill.visible {
  opacity: 1;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: #000;
  cursor: zoom-out;
}

.viewer[hidden] {
  display: none;
}

.viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 60px);
  width: auto;
  height: auto;
  border: 1px solid #00ff00;
}

.viewer-date {
  font-size: 0.9rem;
  color: #00ff00;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(0, 0, 0, 0.85);
  border: 2px dashed #00ff00;
  box-shadow: inset 0 0 40px rgba(0, 255, 0, 0.35);
  pointer-events: none;
}

.drop-overlay[hidden] {
  display: none;
}

.upload-panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 15;
  width: min(360px, calc(100vw - 32px));
  max-height: 50vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #000;
  border: 1px solid #00ff00;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.35);
}

.upload-panel[hidden] {
  display: none;
}

.admin-panel {
  top: 16px;
  bottom: auto;
}

.upload-panel label {
  display: block;
}

.upload-panel input[type=password] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  background: #000;
  color: #00ff00;
  border: 1px solid #00ff00;
  font-family: inherit;
  font-size: 1rem;
  padding: 15px 12px;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.35);
}

.upload-panel .status {
  text-align: left;
  margin: 0;
}

button {
  background: #000;
  color: #00ff00;
  border: 1px solid #00ff00;
  font-family: inherit;
  font-size: 1rem;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.35);
}

button:hover {
  background: #00ff00;
  color: #000;
}

.upload-actions {
  display: flex;
  gap: 8px;
}

.upload-actions button {
  font-size: 0.85rem;
  padding: 4px 10px;
}

.upload-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #00ff00;
}

.upload-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-state {
  font-size: 0.85rem;
  opacity: 0.8;
}

.upload-bar {
  grid-column: 1 / -1;
  height: 4px;
  border: 1px solid #00ff00;
}

.upload-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #00ff00;
  transition: width 0.2s ease;
}

.upload-row[data-status='failed'],
.upload-row[data-status='rejected'] {
  color: #ff6666;
  text-shadow: none;
}

.upload-row[data-status='failed'] .upload-bar,
.upload-row[data-status='rejected'] .upload-bar {
  border-color: #ff6666;
}

.upload-row[data-status='failed'] .upload-bar i,
.upload-row[data-status='rejected'] .upload-bar i {
  background: #ff6666;
}
