/**
 * C107 Riddle Page Styles
 * Puzzle hint and answer page for Comiket 107
 */

/* ===== Page Layout ===== */
.riddle-page {
  background: var(--redice-bg);
  min-height: 100vh;
}

/* ===== Header ===== */
.riddle-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  background: linear-gradient(180deg, var(--redice-bg) 0%, var(--redice-bg-secondary) 100%);
  text-align: center;
}

.riddle-header__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--redice-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
  transition: color var(--transition-fast);
}

.riddle-header__back:hover {
  color: var(--redice-accent-cyan);
}

.riddle-header__title {
  font-size: var(--font-size-2xl);
  color: var(--redice-text);
  margin-bottom: var(--space-sm);
}

.riddle-header__subtitle {
  color: var(--redice-text-muted);
  font-size: var(--font-size-sm);
}

/* ===== Answer Section ===== */
.riddle-answer-section {
  padding: var(--space-2xl) 0;
  background: var(--redice-bg);
}

.riddle-answer-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--redice-bg-secondary);
  border: 2px solid var(--redice-accent-red);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.riddle-answer-card__title {
  font-size: var(--font-size-xl);
  color: var(--redice-accent-red);
  margin-bottom: var(--space-md);
}

.riddle-answer-trigger {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: var(--redice-accent-red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.riddle-answer-trigger:hover {
  background: #c96a5e;
  transform: translateY(-2px);
}

/* ===== Answer Form ===== */
.riddle-answer-form {
  margin-top: var(--space-xl);
  display: none;
}

.riddle-answer-form.is-visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.riddle-answer-form__label {
  font-size: var(--font-size-lg);
  color: var(--redice-text);
  margin-bottom: var(--space-md);
  display: block;
}

.riddle-answer-form__label span {
  color: var(--redice-accent-red);
  font-weight: var(--font-weight-bold);
}

.riddle-answer-form__input-group {
  display: flex;
  gap: var(--space-sm);
  max-width: 300px;
  margin: 0 auto;
}

.riddle-answer-form__input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--redice-border);
  border-radius: var(--radius-md);
  background: var(--redice-bg);
  color: var(--redice-text);
  font-size: var(--font-size-base);
  text-align: center;
}

.riddle-answer-form__input:focus {
  outline: none;
  border-color: var(--redice-accent-cyan);
}

.riddle-answer-form__submit {
  padding: var(--space-sm) var(--space-lg);
  background: var(--redice-accent-cyan);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.riddle-answer-form__submit:hover {
  background: #5a8fa3;
}

/* ===== Result Messages ===== */
.riddle-result {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  display: none;
}

.riddle-result.is-visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.riddle-result--correct {
  background: rgba(107, 163, 184, 0.15);
  border: 2px solid var(--redice-accent-cyan);
}

.riddle-result--correct .riddle-result__title {
  color: var(--redice-accent-cyan);
}

.riddle-result--wrong {
  background: rgba(184, 84, 80, 0.1);
  border: 1px solid var(--redice-accent-red);
}

.riddle-result--wrong .riddle-result__title {
  color: var(--redice-accent-red);
}

.riddle-result__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
}

.riddle-result__text {
  color: var(--redice-text);
  margin-bottom: var(--space-md);
}

.riddle-result__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.riddle-result__btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.riddle-result__btn--primary {
  background: var(--redice-accent-cyan);
  color: #ffffff;
  border: none;
}

.riddle-result__btn--primary:hover {
  background: #5a8fa3;
}

.riddle-result__btn--secondary {
  background: transparent;
  color: var(--redice-text);
  border: 1px solid var(--redice-border);
}

.riddle-result__btn--secondary:hover {
  border-color: var(--redice-accent-cyan);
  color: var(--redice-accent-cyan);
}

/* ===== Hints Section ===== */
.riddle-hints-section {
  padding: var(--space-2xl) 0;
  background: var(--redice-bg-secondary);
}

.riddle-hints-section__title {
  font-size: var(--font-size-2xl);
  color: var(--redice-accent-cyan);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.riddle-hint {
  max-width: 800px;
  margin: 0 auto var(--space-lg);
  background: var(--redice-bg);
  border: 1px solid var(--redice-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.riddle-hint__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--redice-bg);
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.riddle-hint__header:hover {
  background: rgba(107, 163, 184, 0.1);
}

.riddle-hint__number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--redice-accent-cyan);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
}

.riddle-hint__title {
  flex: 1;
  font-size: var(--font-size-lg);
  color: var(--redice-text);
  font-weight: var(--font-weight-medium);
}

.riddle-hint__icon {
  color: var(--redice-text-muted);
  transition: transform var(--transition-fast);
}

.riddle-hint.is-open .riddle-hint__icon {
  transform: rotate(180deg);
}

.riddle-hint__content {
  display: none;
  padding: var(--space-lg);
  border-top: 1px solid var(--redice-border);
}

.riddle-hint.is-open .riddle-hint__content {
  display: block;
}

.riddle-hint__row {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.riddle-hint__text {
  flex: 1;
  color: var(--redice-text);
  line-height: 1.8;
}

.riddle-hint__image {
  max-width: 300px;
  width: 100%;
  border-radius: var(--radius-md);
}

.riddle-hint__image--full {
  max-width: 100%;
}

/* ===== Explanation Section ===== */
.riddle-explanation-section {
  padding: var(--space-2xl) 0;
  background: var(--redice-bg);
  display: none;
}

.riddle-explanation-section.is-visible {
  display: block;
}

.riddle-explanation-section__title {
  font-size: var(--font-size-2xl);
  color: var(--redice-accent-red);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.riddle-explanation {
  max-width: 800px;
  margin: 0 auto;
}

.riddle-explanation__block {
  margin-bottom: var(--space-xl);
  background: var(--redice-bg-secondary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--redice-accent-red);
}

.riddle-explanation__text {
  color: var(--redice-text);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.riddle-explanation__image {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

/* ===== Survey Section ===== */
.riddle-survey-section {
  padding: var(--space-2xl) 0;
  background: var(--redice-bg-secondary);
}

.riddle-survey-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-xl);
  background: var(--redice-bg);
  border: 1px solid var(--redice-accent-cyan);
  border-radius: var(--radius-lg);
}

.riddle-survey-card__title {
  font-size: var(--font-size-xl);
  color: var(--redice-accent-cyan);
  margin-bottom: var(--space-md);
}

.riddle-survey-card__text {
  color: var(--redice-text);
  margin-bottom: var(--space-lg);
}

.riddle-survey-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--redice-accent-cyan);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  transition: all var(--transition-fast);
}

.riddle-survey-card__link:hover {
  background: #5a8fa3;
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.riddle-footer {
  padding: var(--space-xl) 0;
  background: var(--redice-bg);
  border-top: 1px solid var(--redice-border);
  text-align: center;
}

.riddle-footer__logo {
  max-width: 150px;
  width: 40%;
  margin: 0 auto var(--space-md);
  opacity: 0.8;
}

.riddle-footer__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.riddle-footer__link {
  color: var(--redice-text-muted);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.riddle-footer__link:hover {
  color: var(--redice-accent-cyan);
}

.riddle-footer__copyright {
  color: var(--redice-text-muted);
  font-size: var(--font-size-xs);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.riddle-result--correct {
  animation: successPulse 0.5s ease-out;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .riddle-hint__row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .riddle-answer-form__input-group {
    flex-direction: column;
    max-width: 100%;
  }

  .riddle-answer-form__submit {
    width: 100%;
  }
}
