:root { --anim-ease: cubic-bezier(0.4, 0, 0.2, 1); }
body { font-family: 'Inter', sans-serif; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; background-color: #f8fafc; user-select: none; }
.screen-layer { position: absolute; inset: 0; background-color: #fff; transition: transform 0.4s var(--anim-ease), opacity 0.4s var(--anim-ease); will-change: transform, opacity; overflow: hidden; display: flex; flex-direction: column; }
.screen-active { transform: translateX(0); opacity: 1; z-index: 20; pointer-events: auto; }
.screen-next { transform: translateX(100%); opacity: 1; z-index: 30; pointer-events: none; }
.screen-prev { transform: translateX(-20%); opacity: 0; z-index: 10; pointer-events: none; }
.screen-modal-hidden { transform: translateY(100%); opacity: 0; pointer-events: none; z-index: 50; }
.screen-modal-visible { transform: translateY(0); opacity: 1; pointer-events: auto; z-index: 50; }
.math-loading { opacity: 0 !important; transition: opacity 0.2s ease-in; }
@keyframes staggerUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.stagger-item { opacity: 0; }
.feedback-toast { position: absolute; top: 0; left: 0; right: 0; z-index: 60; display: flex; justify-content: center; padding-top: 1rem; transition: transform 0.3s var(--anim-ease), opacity 0.3s ease; transform: translateY(-150%); opacity: 0; pointer-events: none; }
.feedback-visible { transform: translateY(20px); opacity: 1; }
.hint-wrapper { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--anim-ease); }
.hint-wrapper.open { grid-template-rows: 1fr; }
.hint-inner { overflow: hidden; }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 20px); }
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.bottom-btn-container { position: relative; width: 100%; height: 100%; }
.bottom-btn { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.125rem; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; }

.submode-card {
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    background: white; border: 1px solid #e2e8f0; border-radius: 0.5rem;
    padding: 0.6rem; transition: all 0.2s; cursor: pointer; position: relative; overflow: hidden;
    min-height: 60px;
}
.submode-card:active { transform: scale(0.96); background: #f1f5f9; }
.submode-title { font-weight: 700; font-size: 0.8rem; color: #1e293b; line-height: 1.1; margin-bottom: 2px; }
.submode-desc { font-size: 0.6rem; color: #64748b; line-height: 1.1; }
.mode-tag { position: absolute; top: 4px; right: 4px; font-size: 0.5rem; font-weight: 800; color: #cbd5e1; }

/* Animation for question transition */
#problem-wrapper {
  overflow: hidden;
  position: relative;
}

@keyframes slideOutUp {
  from { transform: translateY(0); }
  to { transform: translateY(-120%); }
}

@keyframes slideInUp {
  from { transform: translateY(120%); }
  to { transform: translateY(0); }
}

.anim-exit {
  animation: slideOutUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-enter {
  animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.problem-phantom {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
