:root {
  --bg-color: #f4f5f4;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --border-color: #e7e5e4;
  --white: #ffffff;
  
  /* Primary accents */
  --emerald-50: #ecfdf5;
  --emerald-500: #10b981;
  --emerald-800: #065f46;
  
  --rose-50: #fff1f2;
  --rose-400: #fb7185;
  --rose-800: #9f1239;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  min-height: 76px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-title {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-header:hover {
  background-color: var(--white);
  border-color: #d6d3d1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-header:active {
  transform: translateY(0);
}

.btn-header .icon {
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

.lang-toggle {
  display: flex;
  background-color: var(--bg-color);
  padding: 4px;
  border-radius: 9999px;
  gap: 4px;
}

.lang-toggle button {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-toggle button:hover {
  color: var(--text-primary);
}

.lang-toggle button.active {
  background-color: var(--white);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
}

.progress-bar {
  width: 100%;
  max-width: 896px;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 28px;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
}

.images-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  max-width: min(896px, calc(360px * var(--total-ratio, 2.5) + 20px));
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .images-container {
    gap: 28px;
    max-width: min(896px, calc(360px * var(--total-ratio, 2.5) + 28px));
  }
}

.image-box {
  flex: var(--ratio, 1) 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.image-box:only-child {
  flex: none;
  max-width: min(100%, 640px);
}

.image-frame {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  line-height: 0;
  position: relative;
  cursor: zoom-in;
}

.image-box:only-child .image-frame {
  width: auto;
  max-width: 100%;
}

.image-frame:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.image-box:only-child .image-frame img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 420px;
}

@media (max-width: 639px) {
  .images-container {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }

  .image-box {
    flex: none;
    width: 100%;
    max-width: 420px;
  }

  .image-frame {
    width: auto;
    max-width: 100%;
  }

  .image-frame img {
    width: auto;
    max-width: 100%;
    max-height: 360px;
  }
}

.image-box p {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.options-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 896px;
  margin-bottom: 32px;
}

@media (min-width: 640px) {
  .options-container {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.btn-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: 20px;
  border: 2px solid var(--border-color);
  background-color: var(--white);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.btn-option:hover:not(:disabled) {
  background-color: #fafaf9;
  border-color: #d6d3d1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-option:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-option:disabled {
  cursor: default;
}

.btn-option.correct {
  background-color: var(--emerald-50);
  border-color: var(--emerald-500);
  color: var(--emerald-800);
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
  z-index: 2;
}

.btn-option.wrong {
  background-color: var(--rose-50);
  border-color: var(--rose-400);
  color: var(--rose-800);
  animation: shake 0.4s ease-in-out;
}

.btn-option.disabled {
  opacity: 0.5;
  border-color: #f5f5f4;
  transform: scale(0.98);
  box-shadow: none;
}

.next-container {
  height: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.btn-primary {
  padding: 16px 48px;
  background-color: var(--text-primary);
  color: var(--white);
  border: none;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover {
  background-color: #44403c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.game-over {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  padding: 44px 36px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 680px;
  gap: 20px;
  text-align: center;
}

.game-over-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.game-over h2 {
  font-size: 2rem;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.game-over-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.score-fraction {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-fraction span {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.score-percent {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-track {
  width: 100%;
  height: 10px;
  background-color: var(--bg-color);
  border-radius: 9999px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background-color: var(--emerald-500);
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.missed-section {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.missed-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.missed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.missed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background-color: #fafaf9;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.missed-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.missed-card img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.missed-card span {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.perfect-note {
  font-size: 1rem;
  font-weight: 600;
  color: var(--emerald-800);
}

.icon {
  display: inline-block;
  background-color: currentColor;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
}

.icon {
  width: 24px;
  height: 24px;
}

.icon-check {
  -webkit-mask-image: url('/icons/check.svg');
  mask-image: url('/icons/check.svg');
}

.icon-cross {
  -webkit-mask-image: url('/icons/cross.svg');
  mask-image: url('/icons/cross.svg');
}

.icon-refresh {
  -webkit-mask-image: url('/icons/refresh.svg');
  mask-image: url('/icons/refresh.svg');
}

.icon-arrow-right {
  -webkit-mask-image: url('/icons/arrow-right.svg');
  mask-image: url('/icons/arrow-right.svg');
}

.icon-arrow-left {
  -webkit-mask-image: url('/icons/arrow-left.svg');
  mask-image: url('/icons/arrow-left.svg');
}

.icon-zoom-in {
  -webkit-mask-image: url('/icons/zoom-in.svg');
  mask-image: url('/icons/zoom-in.svg');
}

.icon-zoom-out {
  -webkit-mask-image: url('/icons/zoom-out.svg');
  mask-image: url('/icons/zoom-out.svg');
}

.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

.zoom-trigger {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(28, 25, 23, 0.72);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  backdrop-filter: blur(4px);
}

.image-frame:hover .zoom-trigger,
.zoom-trigger:focus-visible {
  opacity: 1;
  transform: scale(1.06);
  background-color: rgba(28, 25, 23, 0.9);
}

.zoom-trigger .icon {
  width: 19px;
  height: 19px;
}

.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(28, 25, 23, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.2s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.zoom-toolbar {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 102;
}

.zoom-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(28, 25, 23, 0.75);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.zoom-tool-btn:hover:not(:disabled) {
  background-color: rgba(68, 64, 60, 0.95);
  transform: scale(1.05);
}

.zoom-tool-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.zoom-tool-btn .icon {
  width: 20px;
  height: 20px;
}

.zoom-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  padding: 24px;
}

.zoom-stage img {
  margin: auto;
  max-width: 90vw;
  max-height: 84vh;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  transition: width 0.2s ease;
  cursor: zoom-in;
  user-select: none;
  flex-shrink: 0;
}

.zoom-stage img.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.zoom-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(28, 25, 23, 0.75);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 102;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.zoom-nav-btn:hover {
  background-color: rgba(68, 64, 60, 0.95);
  transform: translateY(-50%) scale(1.06);
}

.zoom-nav-prev {
  left: 20px;
}

.zoom-nav-next {
  right: 20px;
}

.zoom-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  background-color: rgba(28, 25, 23, 0.72);
  padding: 6px 14px;
  border-radius: 9999px;
  z-index: 102;
}

.site-footer {
  width: 100%;
  padding: 20px 24px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}


