:root {
  --wff-blue: #97daf5;
  --wff-purple: #a289a7;
  --wff-black: #231f20;
  --wff-gray: #dadbda;
  --wff-ice: #f5f7f7;
  --white: #fff;
  --green: #4f7d5b;
  --yellow: #b88b2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wff-ice);
  color: var(--wff-black);
  font-family: Poppins, Arial, sans-serif;
}

.ff-app {
  width: min(100% - 24px, 680px);
  margin: 28px auto 60px;
  background: #fff;
  box-shadow: 0 12px 45px rgba(35, 31, 32, 0.09);
}

.ff-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91, 64, 114, 0.98), rgba(162, 137, 167, 0.9));
  color: #fff;
  padding: 20px 24px 18px;
  min-height: 170px;
}

.ff-hero::before {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.ff-hero::after {
  content: "";
  position: absolute;
  inset: 18px 24px auto auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-left-color: transparent;
  transform: rotate(18deg);
}

.ff-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ff-brand-wrap {
  flex: 1;
  min-width: 0;
}

.ff-brand-logo {
  display: block;
  width: min(100%, 360px);
  max-width: 100%;
  height: auto;
}

.ff-tag {
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  margin-top: 10px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.95;
}

.ff-mascot-wrap {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -12px;
  margin-bottom: -30px;
}

.ff-mascot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(35, 31, 32, 0.15));
}

.ff-hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: -10px;
}

.ff-hero h1 {
  position: relative;
  z-index: 1;
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 0.9;
  margin: 0;
  letter-spacing: -0.065em;
}

.ff-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.95;
}

.ff-main {
  padding: 28px 26px 40px;
}

.ff-mode-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 12px;
  padding: 6px 11px;
  background: rgba(162, 137, 167, 0.14);
  color: #59455f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ff-daily-progress {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--green);
  background: #f0f5f1;
}

.ff-daily-progress[hidden],
.ff-todays-results[hidden],
.ff-bonus-actions [hidden] {
  display: none;
}

.ff-daily-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ff-daily-progress strong {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ff-daily-progress span {
  font-size: 12px;
  font-weight: 700;
  color: rgba(35, 31, 32, 0.72);
}

.ff-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.ff-category {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ff-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wff-black);
  background: #1d1d1d;
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.ff-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(35, 31, 32, 0.52);
}

.ff-modal[hidden] {
  display: none;
}

.ff-modal-card {
  position: relative;
  width: min(100%, 560px);
  background: #fff;
  border: 2px solid var(--wff-black);
  box-shadow: 0 20px 50px rgba(35, 31, 32, 0.18);
  padding: 28px 26px 22px;
}

.ff-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  background: #fff;
  color: var(--wff-black);
  border: 1px solid var(--wff-black);
}

.ff-modal-card h2 {
  margin: 0 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.ff-modal-card p {
  margin: 0 0 12px;
  line-height: 1.6;
  color: rgba(35, 31, 32, 0.85);
}

.ff-share-card {
  max-height: min(90vh, 760px);
  overflow-y: auto;
}

.ff-share-label {
  display: block;
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.ff-share-text {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--wff-gray);
  background: var(--wff-ice);
  color: var(--wff-black);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.ff-share-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.ff-share-options .ff-button {
  min-height: 42px;
  padding: 9px 12px;
}

.ff-share-options .ff-share-copy {
  grid-column: 1 / -1;
  background: var(--wff-purple);
  color: var(--wff-black);
}

.ff-share-status {
  min-height: 24px;
  font-weight: 700;
}

.ff-modal-card .ff-share-note {
  margin: 0;
  font-size: 12px;
  color: rgba(35, 31, 32, 0.7);
}

.ff-example {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 18px;
}

.ff-mini {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--wff-gray);
  background: #fff;
  font-size: 16px;
  font-weight: 800;
}

.ff-mini.ff-correct {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
}

.ff-message {
  min-height: 38px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  padding: 9px 0;
}

.ff-board {
  width: min(350px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.ff-tile {
  aspect-ratio: 1;
  border: 2px solid var(--wff-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 900 28px Arial;
  background: #fff;
}

.ff-correct {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
}

.ff-present {
  background: var(--yellow) !important;
  color: #fff !important;
  border-color: var(--yellow) !important;
}

.ff-absent {
  background: #777 !important;
  color: #fff !important;
  border-color: #777 !important;
}

.ff-controls {
  display: flex;
  gap: 8px;
  max-width: 430px;
  margin: 22px auto 16px;
}

.ff-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #999;
  padding: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ff-button {
  border: 0;
  background: var(--wff-black);
  color: #fff;
  padding: 11px 18px;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
}

.ff-keyboard {
  display: grid;
  gap: 6px;
}

.ff-keyrow {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.ff-key {
  flex: 1;
  max-width: 46px;
  padding: 0;
  background: var(--wff-gray);
  color: var(--wff-black);
  font-size: 12px;
  border-radius: 2px;
}

.ff-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.ff-actions .ff-button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 38px;
}

.ff-result {
  margin-top: 28px;
  background: var(--wff-ice);
  border-top: 8px solid var(--wff-blue);
  padding: 30px 24px 24px;
  text-align: center;
}

.ff-kicker {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--wff-black);
  opacity: 0.72;
}

.ff-result h2 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.06em;
}

#ff-answer {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wff-black);
}

.ff-fact,
.ff-solve-summary {
  margin: 0 auto 16px;
  max-width: 34rem;
  line-height: 1.6;
  color: rgba(35, 31, 32, 0.8);
}

.ff-solve-summary {
  color: var(--wff-black);
}

.ff-solve-headline {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.ff-solve-context {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.ff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 300px;
  margin: 18px auto 20px;
}

#ff-stats[hidden] {
  display: none;
}

.ff-stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ff-stats b {
  font-size: 20px;
  line-height: 1;
}

.ff-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 220px);
}

.ff-todays-results {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--wff-gray);
  background: #fff;
}

.ff-todays-results h2 {
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.ff-results-list {
  margin: 0;
  border-top: 1px solid var(--wff-gray);
}

.ff-results-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wff-gray);
  font-size: 13px;
}

.ff-results-list dt {
  font-weight: 700;
}

.ff-results-list dd {
  margin: 0;
  text-align: right;
}

.ff-bonus-prompt {
  margin: 18px 0 10px;
  font-weight: 700;
  text-align: center;
}

.ff-bonus-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ff-bonus-button {
  background: #5b4072;
}

.ff-return-button {
  background: #fff;
  color: var(--wff-black);
  border: 1px solid var(--wff-black);
}

.ff-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 22px 24px 18px;
  text-align: center;
  color: var(--wff-black);
  background: #fff;
}

.ff-local-clock,
.ff-countdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.ff-footer-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(35, 31, 32, 0.62);
}

.ff-local-clock time:first-of-type {
  font-size: 13px;
  font-weight: 700;
}

#ff-local-time {
  font-size: 12px;
  color: rgba(35, 31, 32, 0.72);
}

#ff-countdown {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.ff-footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--wff-gray);
  padding-top: 14px;
}

.ff-footer-brand {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(35, 31, 32, 0.7);
}

.ff-version {
  flex: 0 0 auto;
  text-align: right;
  font-size: 10px;
  color: rgba(35, 31, 32, 0.55);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .ff-mascot-wrap {
    width: 120px;
    height: 120px;
  }

  .ff-footer {
    grid-template-columns: 1fr;
  }

  .ff-footer-bottom {
    grid-column: auto;
  }
}
