/* georgITeasy v0.4 - Styles */
:root {
  --red: #DC1F26;
  --blue: #1e88e5;
  --green: #43a047;
  --orange: #ff9800;
  --purple: #8e24aa;
  --cyan: #00bcd4;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #333333;
  --text2: #666666;
  --text3: #999999;
  --border: #e0e0e0;
  --box1: #ffcdd2;
  --box2: #fff9c4;
  --box3: #c8e6c9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Screens */
.screen {
  display: none;
  height: 100dvh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* Header */
.header {
  background: var(--card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 100;
}
.header-flag { font-size: 1.5rem; }
.header-title { font-size: 1rem; font-weight: 600; }
.header-spacer { flex: 1; }
.header-stars {
  background: linear-gradient(135deg, #fff9c4, #ffecb3);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}
.header-back {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-badge {
  font-size: 0.8rem;
  color: var(--text2);
  margin-left: 8px;
}
.header-score {
  font-weight: 600;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-red { background: var(--red); color: white; }
.btn-green { background: var(--green); color: white; }
.btn-blue { background: var(--blue); color: white; }
.btn-orange { background: var(--orange); color: white; }
.btn-purple { background: var(--purple); color: white; }
.btn-cyan { background: var(--cyan); color: white; }
.btn-light { background: #e0e0e0; color: var(--text); }
.btn-main {
  width: 100%;
  padding: 18px 20px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-small {
  flex: 1;
  padding: 14px 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-action {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 25px;
}
.btn-full {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
}
.btn-row {
  display: flex;
  gap: 12px;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.card-emoji {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 12px;
}
.card-georgian {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.card-word {
  text-align: center;
  margin-top: 12px;
}
.card-german {
  background: #e3f2fd;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  margin-top: 12px;
}

/* Learn Screen */
.learn-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.learn-progress {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text2);
}
.learn-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

/* Box Indicator */
.box-indicator {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 12px;
  background: var(--card);
  border-radius: 12px;
}
.box-item { text-align: center; }
.box-label {
  font-size: 0.7rem;
  color: var(--text2);
  margin-bottom: 4px;
}
.box-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
}
.box-dot.active { background: var(--green); }

/* Done Box */
.done-box {
  text-align: center;
  padding: 40px 20px;
}
.done-emoji { font-size: 4rem; margin-bottom: 16px; }
.done-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.done-text { color: var(--text2); margin-bottom: 24px; }

/* Level Cards */
.level-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
}
.level-card:active { transform: scale(0.98); }
.level-card.locked { opacity: 0.6; cursor: not-allowed; }
.level-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.level-stars { font-size: 1.2rem; }
.level-title { flex: 1; font-weight: 600; }
.level-lock { font-size: 1.2rem; }
.level-info {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.level-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.level-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: var(--bg);
  border: none;
  color: var(--text);
}
.tab.active { background: var(--red); color: white; }

/* Setup Cards */
.setup-card { margin-bottom: 16px; }
.setup-label { font-weight: 600; margin-bottom: 12px; }
.diff-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.diff-btn {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  border: none;
  color: var(--text);
}
.diff-btn.active { background: var(--purple); color: white; }

/* Write Screen */
.write-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.write-letter {
  text-align: center;
  font-size: 3rem;
  color: var(--red);
  font-weight: 700;
}
.write-info {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text2);
}
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.canvas-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10rem;
  color: rgba(220, 31, 38, 0.1);
  pointer-events: none;
}
#cvs {
  width: 100%;
  height: 100%;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: white;
  touch-action: none;
}
.color-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
}
.color-btn.active { border-color: var(--text); }

/* Quiz */
.quiz-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-question {
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.grid-quiz {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
}
.quiz-option {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 1.8rem;
  cursor: pointer;
}
.quiz-option:active { transform: scale(0.95); }
.quiz-option.correct { background: var(--green); border-color: var(--green); color: white; }
.quiz-option.wrong { background: #ef5350; border-color: #ef5350; color: white; }
.quiz-feedback { text-align: center; }

/* Memory */
.memory-content {
  display: flex;
  align-items: center;
  justify-content: center;
}
.grid-memory {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 320px;
  width: 100%;
}
.card-flip {
  perspective: 1000px;
  aspect-ratio: 1;
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}
.card-flip.flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.card-front {
  background: linear-gradient(135deg, var(--purple), #ce93d8);
  color: white;
  font-size: 1.5rem;
}
.card-back {
  transform: rotateY(180deg);
  background: white;
  border: 2px solid var(--border);
}
.card-flip.matched .card-back {
  background: #e8f5e9 !important;
  border-color: var(--green) !important;
}

/* Overview Table */
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  font-size: 0.75rem;
}
.table th {
  background: var(--red);
  color: white;
  padding: 10px 6px;
  text-align: left;
  font-weight: 600;
}
.table td {
  padding: 8px 6px;
  border-top: 1px solid var(--border);
}

/* Progress */
.progress-summary { margin-bottom: 16px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.progress-row:last-child { border-bottom: none; }
.progress-value { font-weight: 600; color: var(--red); }
.section-title {
  font-weight: 600;
  margin-bottom: 12px;
}
.grid-progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.progress-card {
  background: var(--card);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.progress-card.box1 { background: var(--box1); }
.progress-card.box2 { background: var(--box2); }
.progress-card.box3 { background: var(--box3); }
.progress-card-letter {
  font-size: 1.3rem;
  color: var(--red);
  font-weight: 700;
}
.progress-card-box {
  font-size: 0.6rem;
  color: var(--text2);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-text {
  color: var(--text2);
  margin-bottom: 20px;
}
.modal-buttons {
  display: flex;
  gap: 10px;
}
.modal-buttons .btn { flex: 1; padding: 12px; }

/* Confetti */
.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.conf-p {
  position: absolute;
  animation: cfall 2.5s linear forwards;
}
@keyframes cfall {
  to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Alphabet Quiz Options */
.alphabet-option {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.1s, background 0.3s;
  width: 100%;
}
.alphabet-option:active {
  transform: scale(0.98);
}

/* ===== v0.6 Icon + Loading Styles ===== */

/* Loading State */
body.loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  z-index: 9999;
}
body.loading::after {
  content: '🇬🇪 Laden...';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--red);
  z-index: 10000;
}

/* Letter Icons */
.letter-icon {
  display: inline-block;
  vertical-align: middle;
  border-radius: 8px;
}

/* Quiz options with icons */
.quiz-option img {
  pointer-events: none;
}

/* Memory cards with icons */
.card-back img {
  max-width: 90%;
  max-height: 60%;
  object-fit: contain;
}

/* Table icons */
.table td img {
  vertical-align: middle;
}
