:root {
  --bg: #171A21;
  --surface: #1e1e1e;
  --border: #617073;
  --text: #eee;
  --text-dim: #999;
  --match: green;
  --partial: #ff8c00;
  --none: brown;
  --accent: #7A93AC;

  --square-size: 130px;
}

@keyframes result-appear {
  from { opacity:0 }
  to { opacity:100 }
}

*[hidden] {
  display: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app {
  padding: 24px 16px 64px;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 1.6rem;
  margin: 0;
}

.modes {
  position: absolute;
  right: 30px;
}

.modes button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}

.modes button:first-child {
  border-radius: 6px 0 0 6px;
}

.modes button:last-child {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

.modes button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: center;
}

.input-wrapper {
  position: relative;
}

#input {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

.suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  z-index: 10;
}

.suggestions.open {
  display: block;
}

.suggestion {
  padding: 8px 12px;
  cursor: pointer;
}

.suggestion:hover {
  background: var(--accent);
  color: #fff;
}

button[type="submit"],
.secondary {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.message {
  min-height: 1.4em;
  font-weight: 600;
  margin: 0 0 16px;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.grid-row {
  display: flex;
  gap: .5rem;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.grid-header .grid-cell {
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  min-width: var(--square-size);
  max-width: var(--square-size);
  min-height: 0;
}

.grid-cell {
  background: var(--surface);
  padding: 10px 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: pre-line;

  min-height: var(--square-size);
  max-height: var(--square-size);
  min-width: var(--square-size);
  max-width: var(--square-size);
}

.name-cell {
  justify-content: center;
  font-weight: 600;
  gap: 8px;
}

.result-cell {
  color: #fff;
  border: 1px solid white;
}

.result-cell.match {
  background: var(--match);
}

.result-cell.partial {
  background: var(--partial);
}

.result-cell.none {
  background: var(--none);
}

.result-cell.upper {
  background: purple url(https://marveldle.com/up_arrow.e2594944237e16e5.png);
  background-blend-mode: normal;
  background-size: contain;
}

.result-cell.lower {
  background: #4e5aff url(https://marveldle.com/down_arrow.04c292afd8ffbe9b.png);
  background-blend-mode: normal;
  background-size: contain;

}

.grid-row.new .result-cell {
  animation: result-appear .5s ease forwards;
  opacity: 0;
}

.grid-row.new .result-cell:nth-child(2) {
  animation-delay: .4s;
}

.grid-row.new .result-cell:nth-child(3) {
  animation-delay: 1s;
}

.grid-row.new .result-cell:nth-child(4) {
  animation-delay: 1.5s;
}

.grid-row.new .result-cell:nth-child(5) {
  animation-delay: 2s;
}

.grid-row.new .result-cell:nth-child(6) {
  animation-delay: 2.5s;
}

.result-message {
  display: flex;
  justify-content: center;
}

.result-message .message {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#share {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
}