* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background: #f5f5f8;
  color: #222;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1, h2 {
  margin-top: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card p {
  margin: 8px 0 16px;
}

button {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  background: #e0e0e0;
  color: #222;
}

button:hover {
  filter: brightness(0.95);
}

select {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #ccc;
  margin-bottom: 16px;
  font-size: 14px;
  background: white;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.top-bar h2 {
  margin: 0;
}

.link-button {
  background: transparent;
  border: none;
  color: #3f51b5;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
}

.verb-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}

.verb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.verb-cell {
  border-radius: 8px;
  padding: 16px 12px;
  background: #eceff1;
  text-align: center;
  cursor: pointer;
  user-select: none;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.verb-cell.visible {
  background: #c8e6c9;
}

.verb-cell.wrong {
  background: #f8bfbf;
}

.verb-cell.correct {
  background: #2e7d32;
  color: #fff;
}

.verb-cell-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.verb-cell.correct .verb-cell-title {
  opacity: 0.85;
}

.verb-cell-value {
  font-size: 17px;
  font-weight: 500;
  min-height: 24px;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.controls-row button {
  flex: 1;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.history-table th,
.history-table td {
  padding: 10px 14px;
  font-size: 14px;
  text-align: left;
}

.history-table thead {
  background: #e8eaf6;
}

.history-table tbody tr:nth-child(even) {
  background: #f5f5f8;
}

@media (max-width: 600px) {

  #app {
    padding: 12px 10px 0;
  }

  #study-view.active {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .verb-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    margin-bottom: 10px;
  }

  .verb-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, 1fr);
    flex: 1;
    gap: 8px;
  }

  .verb-cell {
    min-height: 64px;
  }

  .controls-row {
    padding: 10px 4px 16px;
  }

  .controls-row button {
    padding: 14px 8px;
    font-size: 15px;
  }

  select {
    font-size: 16px;
    padding: 10px 14px;
  }

  .history-table th,
  .history-table td {
    padding: 6px 8px;
    font-size: 13px;
  }
}
