:root {
  --bg-color: #121213;
  --panel-bg: #1a1a1b;
  --border-color: #3a3a3c;
  --text-primary: #ffffff;
  --text-secondary: #818384;
  --correct: #538d4e;
  --partial: #b59f3b;
  --incorrect: #3a3a3c;
  --font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 650px;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header (Wordle Style) */
.header {
  width: 100%;
  height: 52px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
}

.instruction-banner {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

/* Search Box */
.search-section {
  width: 100%;
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

#anime-input {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--panel-bg);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#anime-input:focus {
  border-color: #565758;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-top: none;
  list-style: none;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 0 0 4px 4px;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #272729;
}

.autocomplete-item:hover {
  background-color: #272729;
}

.autocomplete-thumb {
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
}

.autocomplete-details {
  display: flex;
  flex-direction: column;
}

.autocomplete-name {
  font-size: 14px;
  font-weight: 600;
}

.autocomplete-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Guess Grid */
.grid-container {
  width: 100%;
}

.grid-header {
  display: grid;
  grid-template-columns: 60px 1.8fr 0.9fr 0.9fr 1.8fr;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 8px 0;
  text-align: center;
}

.guesses-list {
  display: flex;
  flex-direction: column-reverse; /* Latest guess on top */
  gap: 8px;
}

.guess-row {
  display: grid;
  grid-template-columns: 60px 1.8fr 0.9fr 0.9fr 1.8fr;
  gap: 6px;
  animation: flipIn 0.5s ease;
}

.cell {
  background-color: var(--incorrect);
  height: 75px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4px;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}

.cell-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.cell-title {
  font-size: 13px;
  word-break: break-word;
}

.arrow {
  font-size: 14px;
  margin-top: 2px;
}

.correct {
  background-color: var(--correct) !important;
}

.partial {
  background-color: var(--partial) !important;
}

.hidden {
  display: none !important;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

#share-btn {
  margin-top: 18px;
  background: var(--correct);
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

@keyframes flipIn {
  from {
    transform: rotateX(90deg);
    opacity: 0;
  }
  to {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

/* Cinematic Quote Window */
.quote-card {
  width: 100%;
  margin-top: 32px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--panel-bg);
}

.quote-image-window {
  position: relative;
  width: 100%;
  height: 210px; /* Wide banner window aspect */
  overflow: hidden;
}

.quote-image-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.65) contrast(1.1);
  display: block;
  transition: transform 0.4s ease;
}

.quote-card:hover .quote-image-window img {
  transform: scale(1.03);
}

.quote-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 24px;
  background: linear-gradient(180deg, rgba(18,18,19,0.1) 0%, rgba(18,18,19,0.85) 100%);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

#quote-text {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

#quote-author {
  font-size: 13px;
  font-weight: 600;
  color: #b0b0b2;
  font-style: normal;
}



