/* Fix My Life — scoped to the game panel. */
.fml-panel.block {
  position: relative;
  max-width: 1040px;
  margin-inline: auto;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  color: #f4efe8;
  background: #3c1224;
  border: 1px solid rgba(224, 122, 106, 0.38);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(42, 8, 18, 0.18);
  overflow: hidden;
}

.fml-panel.block::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028),
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.45;
}

#fmlApp {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.fml {
  display: grid;
  gap: 1rem;
}

.fml.is-entering .fml-main {
  animation: fml-in 0.28s ease;
}

@keyframes fml-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.fml-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.fml-kicker {
  margin: 0 0 0.3rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e7a99c;
}

.fml-title {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.02;
  color: #f7f2eb;
}

.fml-sub,
.fml-lead,
.fml-fine,
.fml-note,
.fml-ru,
.fml-example,
.fml-card-detail,
.fml-card-ru {
  font-family: "Manrope", sans-serif;
  color: #f0e4da;
}

.fml-sub {
  margin: 0.35rem 0 0;
  font-size: 1.02rem;
}

.fml-head-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  align-items: center;
}

.fml-levels {
  display: flex;
  gap: 0.35rem;
}

.fml-level,
.fml-text,
.fml-btn,
.fml-card {
  font-family: "Manrope", sans-serif;
  cursor: pointer;
}

.fml-level {
  min-width: 2.6rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 232, 0.28);
  background: transparent;
  color: #f7f2eb;
  font-weight: 700;
}

.fml-level.is-on {
  background: #e07a6a;
  border-color: #e07a6a;
  color: #2a0d18;
}

.fml-text {
  min-height: 2.4rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: none;
  color: #f0b2a6;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.fml-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  grid-template-areas:
    "main dash"
    "main tasks";
  gap: 0.85rem 1rem;
  align-items: start;
}

.fml-dash { grid-area: dash; }
.fml-main { grid-area: main; min-width: 0; }
.fml-tasks { grid-area: tasks; }

.fml-dash,
.fml-tasks,
.fml-card,
.fml-lang,
.fml-summary {
  background: #2a0d18;
  border: 1px solid rgba(244, 239, 232, 0.14);
  border-radius: 16px;
}

.fml-dash,
.fml-tasks {
  padding: 0.85rem 0.9rem;
}

.fml-stat,
.fml-meter {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0 0 0.45rem;
  font-family: "Manrope", sans-serif;
}

.fml-stat span,
.fml-meter span,
.fml-tasks h3 span,
.fml-summary span {
  color: #e7a99c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fml-stat strong,
.fml-meter strong,
.fml-summary strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: #f7f2eb;
}

.fml-bar,
.fml-meter-track,
.fml-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 239, 232, 0.16);
  overflow: hidden;
}

.fml-bar > span,
.fml-meter-track > span,
.fml-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #e07a6a;
  transition: width 0.28s ease;
}

.fml-meter-track {
  flex: 1;
  align-self: center;
}

.fml-meters {
  margin-top: 0.7rem;
}

.fml-note,
.fml-fine,
.fml-warn {
  margin: 0.55rem 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
}

.fml-warn { color: #f3c2b6; }

.fml-h {
  margin: 0 0 0.45rem;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 400;
  line-height: 1.15;
  color: #f7f2eb;
}

.fml-h-small {
  margin-top: 1.1rem;
  font-size: 1.45rem;
}

.fml-lead {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.fml-ru {
  margin: -0.25rem 0 0.75rem;
  color: #f0c2b8;
}

.fml-label {
  margin: 0.9rem 0 0.4rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e7a99c;
}

.fml-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.fml-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  width: 100%;
  min-height: 8.5rem;
  padding: 0.85rem 0.9rem;
  text-align: left;
  color: #f7f2eb;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.fml-card:hover {
  border-color: #e07a6a;
  background: #351221;
}

.fml-card.is-on {
  border-color: #e07a6a;
  background: #4a2233;
  box-shadow: inset 0 0 0 1px #e07a6a;
}

.fml-card.is-short {
  opacity: 0.72;
}

.fml-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.fml-card-cost {
  color: #f0b2a6;
  font-size: 0.92rem;
  font-weight: 700;
}

.fml-card-detail,
.fml-card-ru,
.fml-card-flag {
  font-size: 0.92rem;
  line-height: 1.4;
}

.fml-card-flag {
  color: #f3c2b6;
  font-weight: 700;
}

.fml-progress { margin-bottom: 0.8rem; }

.fml-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.9rem;
}

.fml-btn {
  min-height: 3rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: #e07a6a;
  color: #2a0d18;
  font-size: 1rem;
  font-weight: 800;
}

.fml-btn:hover:not(:disabled) { background: #f0b2a6; }

.fml-btn:disabled {
  cursor: not-allowed;
  background: rgba(224, 122, 106, 0.35);
  color: #f7f2eb;
}

.fml-tasks h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.55rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e7a99c;
}

.fml-tasks ul,
.fml-chips,
.fml-summary {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fml-tasks li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0 0 0.4rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #f3ebe4;
}

.fml-tasks li.is-done { color: #f7f2eb; }

.fml-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 232, 0.35);
  font-size: 0.72rem;
  flex: 0 0 auto;
}

.fml-tasks li.is-done .fml-tick {
  background: #e07a6a;
  border-color: #e07a6a;
  color: #2a0d18;
  font-weight: 800;
}

.fml-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.fml-chips li {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(224, 122, 106, 0.18);
  font-family: "Manrope", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.fml-phrase {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.35rem;
  color: #f7f2eb;
}

.fml-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.7rem;
}

.fml-summary li {
  display: grid;
  gap: 0.1rem;
}

.fml-langs {
  display: grid;
  gap: 0.55rem;
}

.fml-lang {
  padding: 0.75rem 0.85rem;
}

.fml-lang h4 {
  margin: 0 0 0.25rem;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #f7f2eb;
}

.fml-lang p,
.fml-example {
  margin: 0.15rem 0 0;
  font-family: "Manrope", sans-serif;
  line-height: 1.45;
}

.fml-example { color: #f0c2b8; }

.fml-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fml-btn:focus-visible,
.fml-card:focus-visible,
.fml-level:focus-visible,
.fml-text:focus-visible {
  outline: 2px solid #f3d2c8;
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .fml-head { flex-direction: column; align-items: flex-start; }
  .fml-head-tools { justify-content: flex-start; }
  .fml-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "dash"
      "main"
      "tasks";
  }
  .fml-dash {
    position: sticky;
    top: calc(var(--header-h, 3.7rem) + 0.35rem);
    z-index: 3;
    box-shadow: 0 10px 24px rgba(42, 8, 18, 0.28);
  }
  .fml-choice-grid,
  .fml-summary { grid-template-columns: 1fr; }
  .fml-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fml.is-entering .fml-main { animation: none; }
  .fml-bar > span,
  .fml-meter-track > span,
  .fml-progress > span,
  .fml-card { transition: none; }
}
