/* === Разгадай ребус — стили игры (logic1.html) === */

.question-text {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  margin: 10px 0 8px;
  line-height: 1.3;
  color: var(--accent1);
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 14px;
  padding: 12px 16px;
}

.rebus-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.loading-spinner {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 16px;
  z-index: 2;
}

.loading-spinner span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent1);
  animation: spinBounce 1.4s ease-in-out infinite both;
}

.loading-spinner span:nth-child(1) { animation-delay: -0.32s; }
.loading-spinner span:nth-child(2) { animation-delay: -0.16s; }

@keyframes spinBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

#rebusCanvas {
  width: 100%;
  max-width: 340px;
  height: 130px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
}

.rebus-container.shake {
  animation: shake 0.4s ease;
}

.hint-definition-inline {
  min-height: 40px;
  margin: 8px 0;
  font-size: 1.15rem;
  color: #555;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: all .3s;
}
.hint-definition-inline.show {
  opacity: 1;
  transform: translateY(0);
}

.input-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0;
}

.rebus-input {
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 10px 16px;
  border: 2px solid var(--help-border);
  border-radius: 14px;
  outline: none;
  width: 200px;
  text-align: center;
  background: var(--glass-bg);
  color: #333;
  transition: border-color .3s;
}

.rebus-input:focus {
  border-color: var(--accent1);
}

.rebus-input.wrong {
  border-color: #ff6b6b;
  background: #fff5f5;
}

.rebus-input.correct {
  border-color: #2ecc71;
  background: #f0fff4;
}

.glass-header {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 1.7rem;
  color: #888;
  font-weight: 700;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--stats-bg1), var(--stats-bg2));
  border-radius: 16px;
  border: 2px solid var(--stats-border);
  transition: all .3s;
}

.stats:hover {
  transform: scale(1.03);
  border-color: var(--stats-hover-border);
}

.stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats b {
  color: #333;
  font-size: 1.1rem;
  transition: all .3s;
}

.stats.bump b {
  animation: statBump .4s ease-out;
}

@keyframes statBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); color: var(--stats-bump-color); }
  100% { transform: scale(1); }
}

.check-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px auto;
}

.check-btn {
  margin: 0;
}

.hint-btn,
.giveup-btn {
  display: none;
  margin: 0;
  padding: 8px 18px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  background: #e8e8e8;
  color: #999;
  opacity: 0.7;
}
.hint-btn:hover,
.giveup-btn:hover {
  opacity: 0.9;
  background: #ddd;
}

.memo-btn {
  margin: 0;
  padding: 8px 14px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(232, 67, 147, 0.12);
  color: var(--accent1);
  transition: all .2s;
}
.memo-btn:hover {
  background: rgba(232, 67, 147, 0.25);
}

.hint-overlay {
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: rgba(var(--white-shadow),.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
  z-index: 10;
}

.hint-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.hint-dialog {
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 20px;
  padding: 24px 28px;
  max-width: 320px;
  text-align: center;
}

#memoOverlay .hint-dialog {
  max-width: 95%;
  width: 100%;
  max-height: 95%;
  overflow-y: auto;
}

.hint-dialog p {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent1);
  margin: 0 0 16px;
  line-height: 1.5;
}

.hint-label {
  margin-bottom: 8px !important;
}

#memoContent { text-align: left; margin: 0 0 16px; }

#memoContent .memo-text-item {
  font-size: .95rem;
  color: #555;
  line-height: 1.5;
  margin: 6px 0;
}

#memoContent .memo-block {
  margin: 14px 0;
  text-align: center;
}

#memoContent .memo-block-text {
  font-size: .95rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 8px;
  text-align: left;
}

#memoContent .memo-block-img {
  max-width: 100%;
  max-height: 12vh;
  width: auto;
  border-radius: 10px;
  display: inline-block;
  margin: 4px auto;
  vertical-align: top;
}

#memoContent .memo-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

#memoContent .memo-image-figure {
  margin: 0;
  text-align: center;
  flex: 1 1 auto;
  min-width: 120px;
}

#memoContent .memo-block-answer {
  font-size: .9rem;
  color: var(--accent1);
  font-weight: 700;
  margin: 8px 0 0;
}

.hint-definition {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #555 !important;
  margin-bottom: 20px !important;
}

.hint-giveup {
  opacity: 0.5;
}
.hint-giveup:hover {
  opacity: 0.8 !important;
}

.next-task-btn {
  display: none;
}

@media (max-width: 480px) {
  .rebus-input { width: 160px; font-size: 1.1rem; }
  .stats { font-size: 1rem; gap: 12px; }
  #rebusCanvas { height: 110px; }
}

@media (min-width: 481px) and (max-width: 768px) {
  #rebusCanvas { height: 120px; }
}

@media (min-width: 769px) {
  #rebusCanvas { max-width: 400px; height: 140px; }
}
