body {
 font-family: Arial, sans-serif;
 display: flex;
 flex-direction: column;
 align-items: center;
 padding: 20px;
 background-color: #f0f0f0;
 margin: 0;
 min-height: 100vh;
}

.container {
 max-width: 600px;
 width: 100%;
}

.card-counter {
 text-align: center;
 margin-bottom: 10px;
 font-size: 18px;
 color: #555;
}

.card-counter .total-count {
 display: inline-block;
 transition: transform 0.15s ease-out, color 0.15s ease-out;
}

.card-counter .total-count.emphasis {
 transform: scale(1.3);
 color: #007bff;
}

.flashcard {
 background-color: white;
 border-radius: 10px;
 box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 padding: 40px;
 min-height: 300px;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 margin-bottom: 20px;
 user-select: none;
 transition: transform 0.1s;
 touch-action: pan-y pinch-zoom;
}

.flashcard:hover {
 transform: scale(1.02);
}

.flashcard:active {
 transform: scale(0.98);
}

.flashcard-content {
 font-size: 20px;
 line-height: 1.5;
 width: 100%;
}

.flashcard-content.centered {
 text-align: center;
}

.flashcard-content.left-aligned {
 text-align: left;
 white-space: pre-wrap;
}

.flashcard-content.right-aligned {
 text-align: right;
 white-space: pre-wrap;
}

.controls {
 display: grid;
 grid-template-columns: auto 1fr 1fr 1fr auto;
 gap: 10px;
 margin-bottom: 20px;
}

.secondary-controls {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 10px;
 align-items: center;
 margin-bottom: 10px;
}

.secondary-controls button {
 font-size: 16px;
 height: 72px;
 padding: 0 16px;
}

.tertiary-controls {
 display: flex;
 justify-content: center;
 gap: 10px;
 margin-bottom: 10px;
}

.tertiary-controls button {
 height: 72px;
}

.font-size-btn {
 width: 72px;
 padding: 0 !important;
}

.remove-btn, .undo-btn {
 background-color: #dc3545;
}

.remove-btn:hover, .undo-btn:hover {
 background-color: #c82333;
}

.undo-btn:disabled {
 background-color: #cccccc;
 cursor: not-allowed;
}

.font-size-btn {
 width: 72px;
 padding: 0 !important;
 font-size: 24px !important;
 line-height: 1;
 display: flex;
 align-items: center;
 justify-content: center;
 background-color: #6c757d;
}

.font-size-btn:hover {
 background-color: #5a6268;
}

.align-btn {
 width: 72px;
 padding: 0 !important;
 font-size: 20px !important;
 line-height: 1;
 display: flex;
 align-items: center;
 justify-content: center;
 background-color: #6c757d;
 height: 72px;
}

.align-btn:hover {
 background-color: #5a6268;
}

button {
 padding: 12px 20px;
 font-size: 20px;
 border: none;
 border-radius: 5px;
 background-color: #007bff;
 color: white;
 cursor: pointer;
 transition: background-color 0.2s;
 touch-action: manipulation;
}

button:hover {
 background-color: #0056b3;
}

button:active {
 transform: scale(0.95);
}

button:disabled {
 background-color: #cccccc;
 cursor: not-allowed;
}

.timer-row {
 margin-top: 15px;
 padding-top: 15px;
 border-top: 1px solid #ddd;
 display: flex;
 justify-content: center;
 align-items: center;
 gap: 15px;
}

.timer-display {
 font-family: 'Courier New', monospace;
 font-size: 24px;
 font-weight: bold;
 color: #333;
 min-width: 120px;
 text-align: center;
}

.timer-btn {
 background-color: #17a2b8;
 padding: 10px 20px;
 font-size: 16px;
}

.timer-btn:hover {
 background-color: #138496;
}

.timer-btn.pause {
 background-color: #ffc107;
}

.timer-btn.pause:hover {
 background-color: #e0a800;
}

.reset-btn {
 background-color: #6c757d;
 padding: 10px 20px;
 font-size: 16px;
}

.reset-btn:hover {
 background-color: #5a6268;
}

.print-row {
 margin-top: 15px;
 padding-top: 15px;
 border-top: 1px solid #ddd;
 display: flex;
 justify-content: center;
 align-items: center;
 gap: 10px;
}

.print-btn, .download-btn {
 background-color: #6c757d;
 padding: 10px 30px;
 font-size: 16px;
}

.print-btn:hover, .download-btn:hover {
 background-color: #5a6268;
}

.language-select {
 background-color: #6c757d;
 color: white;
 padding: 10px 15px;
 font-size: 16px;
 border: none;
 border-radius: 5px;
 cursor: pointer;
 touch-action: manipulation;
}

.language-select:hover {
 background-color: #5a6268;
}

@media print {
 body {
  background: white;
  padding: 5px;
  margin: 0;
 }

 .container {
  display: none;
 }

 .print-table {
  display: table !important;
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 9px;
  line-height: 1.2;
 }

 .print-table thead {
  display: none;
 }

 .print-table td {
  border: 0.5px solid #999;
  padding: 3px;
  text-align: left;
  vertical-align: top;
  width: 50%;
  height: auto;
  max-height: 40px;
  overflow: hidden;
 }

 .print-table tr {
  background-color: white;
  page-break-inside: avoid;
 }

 .print-header {
  display: block !important;
  text-align: center;
  margin-bottom: 5px;
  font-family: Arial, sans-serif;
 }

 .print-header h2 {
  display: none;
 }

 .print-header h3 {
  font-size: 10px;
  margin: 2px 0;
  font-weight: normal;
 }
}

.print-table {
 display: none;
}

.print-header {
 display: none;
}

@media screen {
 .print-header {
  display: none !important;
 }
}

.flip-btn {
 background-color: #28a745;
}

.flip-btn:hover {
 background-color: #218838;
}

.shuffle-btn, .invert-btn {
 background-color: #ffc107;
 color: #333;
}

.shuffle-btn:hover, .invert-btn:hover {
 background-color: #e0a800;
}

.nav-btn {
 background-color: #6c757d;
 width: 60px;
 padding: 12px 8px !important;
}

.nav-btn:hover {
 background-color: #5a6268;
}

.instructions {
 text-align: center;
 color: #666;
 margin-top: 20px;
 font-size: 14px;
 line-height: 1.4;
}

.editor-link {
 text-align: center;
 margin-top: 15px;
 font-size: 12px;
}

.editor-link a {
 color: #007bff;
 text-decoration: none;
}

.editor-link a:hover {
 text-decoration: underline;
}
