html,
body {
  margin: 0;
  padding: 0;
  background: #f8fbff;
  color: #23364a;
  font-family: Arial, Helvetica, sans-serif;
}

.fraction-game {
  box-sizing: border-box;
  min-height: 650px;
  padding: 14px;
  background: linear-gradient(#fbfdff, #eef7ff);
}

.fraction-shell {
  max-width: 940px;
  margin: 0 auto;
}

.fraction-topbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.fraction-stat {
  min-height: 46px;
  border: 1px solid #b4c9dd;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(35, 54, 74, 0.12);
  color: #61778d;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fraction-stat strong {
  margin-top: 2px;
  color: #173b5b;
  font-size: 20px;
}

.instruction-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #b4c9dd;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(35, 54, 74, 0.12);
}

.instruction-title {
  color: #173b5b;
  font-size: 24px;
  font-weight: bold;
}

.instruction-copy {
  margin-top: 3px;
  color: #5a7188;
  font-size: 14px;
}

.feedback {
  min-height: 44px;
  padding: 10px;
  border-radius: 6px;
  background: #f2f7fb;
  color: #24445f;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.feedback.correct {
  background: #e0f5dd;
  color: #23601d;
}

.feedback.wrong {
  background: #ffe8e2;
  color: #8f3b2f;
}

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
}

.picture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.picture-card,
.card-bank {
  border: 1px solid #b4c9dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(35, 54, 74, 0.12);
}

.picture-card {
  min-height: 218px;
  padding: 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.picture-title {
  color: #173b5b;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
}

.fraction-model {
  justify-self: center;
  align-self: center;
}

.pie-model {
  width: 112px;
  height: 112px;
  border: 3px solid #254c6d;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #fff;
}

.bar-model {
  display: grid;
  width: 168px;
  height: 56px;
  border: 3px solid #254c6d;
  border-radius: 6px;
  overflow: hidden;
}

.grid-model {
  display: grid;
  width: 132px;
  height: 102px;
  border: 3px solid #254c6d;
  border-radius: 6px;
  overflow: hidden;
}

.part {
  border-right: 1px solid #9db5ca;
  border-bottom: 1px solid #9db5ca;
  background: #fff;
}

.part.filled {
  background: #4da3ff;
}

.drop-zone {
  min-height: 42px;
  border: 2px dashed #9db5ca;
  border-radius: 7px;
  background: #f7fbff;
  color: #526b84;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone.is-hover {
  border-color: #2875ad;
  background: #e9f6ff;
}

.drop-zone.is-correct {
  border-style: solid;
  border-color: #35a853;
  background: #ecfae7;
  color: #23601d;
}

.drop-zone.is-wrong {
  border-color: #d85042;
  background: #fff0ed;
}

.card-bank {
  padding: 10px;
}

.bank-title {
  margin-bottom: 8px;
  color: #173b5b;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.fraction-cards {
  display: grid;
  gap: 8px;
}

.fraction-card {
  min-height: 48px;
  border: 2px solid #a9c0d5;
  border-radius: 7px;
  background: #fff;
  color: #173b5b;
  font-size: 24px;
  font-weight: bold;
  cursor: grab;
}

.fraction-card:focus,
.fraction-card.is-selected {
  border-color: #2875ad;
  outline: none;
  box-shadow: 0 0 0 3px #dbefff;
}

.fraction-card.is-used {
  opacity: 0.35;
  cursor: default;
}

.game-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.fraction-button {
  height: 34px;
  border: 1px solid #829bb4;
  border-radius: 5px;
  background: #fff;
  color: #173b5b;
  font-weight: bold;
  cursor: pointer;
}

.fraction-button:hover {
  background: #eaf6ff;
}

@media (max-width: 760px) {
  .fraction-topbar,
  .instruction-card,
  .work-area,
  .picture-grid {
    grid-template-columns: 1fr;
  }

  .fraction-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
