body {
  margin: 0;
  min-height: 100vh;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: system-ui, sans-serif;
  padding: 24px 0;
  box-sizing: border-box;
}

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

.card-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.list-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.top-buttons,
.bottom-buttons {
  display: flex;
  gap: 12px;
}

.backup-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.export-button,
.import-button {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: bold;
  color: #4b5563;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.export-button:hover,
.import-button:hover {
  background-color: #f9fafb;
}

.sync-indicator {
  color: #f59e0b;
  font-size: 14px;
  align-self: center;
  line-height: 1;
}

.card {
  width: 300px;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
}

.front-text {
  font-size: 72px;
  font-weight: bold;
  color: #333;
  text-align: center;
  padding: 0 16px;
  overflow-wrap: break-word;
  max-width: 100%;
}

.front-text.text-mode {
  font-size: 24px;
  line-height: 1.3;
}

.back-text {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  text-align: center;
  padding: 0 16px;
  overflow-wrap: break-word;
  max-width: 100%;
}

.back-text.text-mode {
  font-size: 20px;
  line-height: 1.3;
}

.speaker-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #f0f0f0;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.speaker-button:hover {
  background-color: #e0e0e0;
}

.next-button {
  padding: 12px 32px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background-color: #3b82f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.next-button:hover {
  background-color: #2563eb;
}

.show-list-button {
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background-color: #8b5cf6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.show-list-button:hover {
  background-color: #7c3aed;
}

.add-button,
.delete-button {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: bold;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.add-button {
  background-color: #10b981;
}

.add-button:hover {
  background-color: #059669;
}

.delete-button {
  background-color: #ef4444;
}

.delete-button:hover {
  background-color: #dc2626;
}

.add-button:disabled,
.delete-button:disabled,
.next-button:disabled,
.show-list-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.empty-message {
  margin: 0;
  width: 300px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  color: #666;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0 24px;
  box-sizing: border-box;
}

.list-title {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-list-item {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.15s;
}

.card-list-item:hover {
  background-color: #f9fafb;
}

.card-list-item:last-child {
  border-bottom: none;
}

.card-list-text {
  flex: 1;
  min-width: 0;
}

.card-list-front {
  font-weight: bold;
  color: #333;
  font-size: 16px;
  overflow-wrap: break-word;
}

.card-list-back {
  color: #666;
  font-size: 14px;
  overflow-wrap: break-word;
  margin-top: 2px;
}

.card-list-delete {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  color: white;
  background-color: #ef4444;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.card-list-delete:hover {
  background-color: #dc2626;
}

.card-list-empty {
  padding: 24px 16px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.close-list-button {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: bold;
  color: white;
  background-color: #6b7280;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.close-list-button:hover {
  background-color: #4b5563;
}

.hidden {
  display: none !important;
}
