* {
  box-sizing: border-box;
}

:root {
  --bg: #f9f9f7;
  --white: #ffffff;
  --border: #e0e0e0;
  --text: #111111;
  --muted: #777777;
  --green: #2d9e5f;
  --orange: #e07b39;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Helvetica, Arial, sans-serif;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.page {
  text-align: center;
}

.hidden {
  display: none;
}

h1 {
  margin: 48px 0 12px;
  font-size: clamp(2rem, 6vw, 3rem);
}

h2 {
  margin: 8px 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.intro,
.hint {
  max-width: 680px;
  margin: 16px auto;
  color: #555555;
  line-height: 1.45;
}

.subtle {
  color: var(--muted);
  font-size: 0.95rem;
}

.input-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

input {
  width: min(420px, 65vw);
  padding: 11px 12px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-size: 1rem;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: #444444;
}

.primary {
  background: #222222;
  border-color: #222222;
  color: var(--white);
  font-weight: bold;
  padding: 13px 26px;
}

.primary:hover {
  background: #444444;
}

.feedback {
  min-height: 1.4em;
  margin: 8px 0;
  font-size: 0.95rem;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--orange);
}

.progress {
  height: 10px;
  margin: 12px auto 20px;
  max-width: 760px;
  overflow: hidden;
  border-radius: 99px;
  background: #eeeeee;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: #222222;
  transition: width 180ms ease;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 280px));
  justify-content: center;
  gap: 40px;
  margin: 22px 0;
}

.card {
  position: relative;
  min-height: 220px;
  padding: 42px 18px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.card:hover {
  border-color: #444444;
}

.skip {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #bbbbbb;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
}

.skip:hover {
  color: #888888;
}

.year {
  margin: 0 0 8px;
  color: #aaaaaa;
  font-size: 0.9rem;
}

.title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.director {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions,
.start-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  margin-bottom: 16px;
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eeeeee;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--white);
  font-weight: bold;
}

td:first-child,
td:last-child {
  text-align: right;
}

@media (max-width: 680px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .input-row {
    flex-direction: column;
  }

  input {
    width: 100%;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
