/*
 * Styling for the "different angle" game. Uses Walnut Care palette + matches
 * the poster look — pink wash background, porcelain-rim cups, soft toast.
 */

#different-angle { display: block; max-width: 1080px; margin: var(--spacing-2xl, 4rem) auto; padding: 0 var(--spacing-md); }

.da-card {
  background: linear-gradient(135deg, #f8d5dd 0%, #f3b8c4 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  color: var(--walnut-burgundy);
}

.da-header { text-align: center; margin-bottom: var(--spacing-lg); }
.da-title {
  font-family: "adobe-garamond-pro", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--walnut-burgundy);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin: 0 0 var(--spacing-xs);
}
.da-sub {
  color: var(--walnut-burgundy);
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

.da-game {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}
@media (min-width: 900px) {
  .da-game { grid-template-columns: 1fr 1.4fr; align-items: start; }
}

.da-stage { background: rgba(255,255,255,0.55); padding: var(--spacing-lg); border-radius: var(--radius-md); }
.da-profile { display: flex; align-items: center; gap: var(--spacing-md); }
.da-portrait {
  width: 64px; height: 64px;
  background: var(--walnut-burgundy);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.da-meta h3 { margin: 0 0 4px; font-size: 1.25rem; color: var(--walnut-burgundy); }
.da-meta p { margin: 0; color: var(--walnut-burgundy); opacity: 0.8; font-size: 0.95rem; }

.da-feedback {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  min-height: 1.5em;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--walnut-burgundy);
  transition: background 0.25s ease;
}
.da-feedback-correct { background: rgba(255,255,255,0.85); border-left: 3px solid #2f6a3a; }
.da-feedback-wrong   { background: rgba(255,255,255,0.7);  border-left: 3px solid #b13a4a; }
.da-feedback-aha     { background: rgba(255,255,255,0.95); padding: var(--spacing-md); font-size: 1rem; }
.da-feedback em { font-style: italic; opacity: 0.85; }

.da-controls { margin-top: var(--spacing-md); text-align: right; }
.da-btn {
  background: var(--walnut-burgundy);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.da-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(105,28,50,0.25); }

.da-link {
  color: var(--walnut-burgundy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  margin-right: var(--spacing-md);
}
.da-link:hover { opacity: 0.7; }

/* ── Tea board: 7-column grid of porcelain cups */
.da-board-tea {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(4px, 1.2vw, 12px);
  background: rgba(255,255,255,0.35);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
}
/* Each cup is a teacup viewed from above: a porcelain bowl + a small ear-shaped
   handle on the right. The bowl is the ::before, the handle is the ::after.
   The button's own background is transparent so the cup-shape stands alone. */
.da-cup {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  transition: transform 0.15s ease, opacity 0.25s ease;
}
.da-cup::before {
  /* The bowl (the round teacup viewed from above) */
  content: "";
  position: absolute;
  inset: 6% 22% 6% 6%;        /* leaves 16% on the right for the handle */
  border-radius: 50%;
  border: 3px solid #fff;
  background:
    radial-gradient(circle at 35% 30%,
      color-mix(in srgb, var(--cup-colour) 75%, white) 0%,
      var(--cup-colour) 60%,
      color-mix(in srgb, var(--cup-colour) 75%, black) 100%);
  box-shadow:
    inset 0 -3px 8px rgba(0,0,0,0.18),
    inset 0 3px 6px rgba(255,255,255,0.35),
    0 2px 6px rgba(105,28,50,0.15);
}
.da-cup::after {
  /* The handle: a thick white ring on the right edge of the bowl, masked to a
     half so it reads as a teacup handle rather than a full circle */
  content: "";
  position: absolute;
  top: 28%;
  right: 4%;
  width: 24%;
  height: 44%;
  border: 4px solid #fff;
  border-left: none;
  border-radius: 0 60% 60% 0 / 0 50% 50% 0;
  box-shadow: 2px 2px 4px rgba(105,28,50,0.18);
}
.da-cup:hover:not(:disabled) { transform: scale(1.08); z-index: 1; }
.da-cup:disabled { cursor: not-allowed; }
.da-cup.da-wrong { opacity: 0.28; transform: scale(0.92); }
.da-cup.da-correct {
  transform: scale(1.15);
  z-index: 2;
}
.da-cup.da-correct::before {
  outline: 3px solid #2f6a3a;
  outline-offset: 4px;
}

/* ── Toast board: 4×3 grid of slices */
.da-board-toast {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.5vw, 16px);
  background: rgba(255,255,255,0.35);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
}
/* Toast: a sliced-loaf shape. Bottom corners gently rounded, top crowned with
   a wider radius so it reads as a slice fresh out of the toaster. Tiny
   asymmetry on the radii makes it look hand-cut rather than machine-perfect.
   A darker crust ring (::after) hugs the outline. */
.da-toast {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  padding: 0;
  border: none;
  background: transparent;
  transition: transform 0.15s ease, opacity 0.25s ease;
  overflow: visible;
}
.da-toast::before {
  /* The slice */
  content: "";
  position: absolute;
  inset: 8% 6% 6% 6%;
  border-radius: 48% 52% 14% 16% / 38% 42% 12% 14%;  /* dome top, flat-ish bottom */
  background:
    radial-gradient(ellipse at 50% 38%,
      color-mix(in srgb, var(--toast-colour) 85%, white 8%) 0%,
      var(--toast-colour) 55%,
      color-mix(in srgb, var(--toast-colour) 70%, black) 95%);
  box-shadow:
    inset 0 -4px 8px rgba(0,0,0,0.22),
    inset 0 4px 6px rgba(255,255,255,0.2),
    0 4px 10px rgba(105,28,50,0.18);
}
.da-toast::after {
  /* The crust outline — sits just inside the slice as a darker ring */
  content: "";
  position: absolute;
  inset: 10% 8% 8% 8%;
  border-radius: 46% 50% 12% 14% / 36% 40% 10% 12%;
  border: 2px solid color-mix(in srgb, var(--toast-colour) 60%, black);
  opacity: 0.35;
  pointer-events: none;
}
.da-toast:hover:not(:disabled) { transform: scale(1.06); z-index: 1; }
.da-toast:disabled { cursor: not-allowed; }
.da-toast.da-wrong { opacity: 0.28; transform: scale(0.94); }
.da-toast.da-correct {
  transform: scale(1.1);
  z-index: 2;
}
.da-toast.da-correct::before {
  outline: 3px solid #2f6a3a;
  outline-offset: 4px;
}

/* Dark-mode tweak: keep the pink card readable */
[data-theme="dark"] .da-card {
  background: linear-gradient(135deg, #5a2a36 0%, #3d1c25 100%);
  color: #f4d4dc;
}
[data-theme="dark"] .da-title,
[data-theme="dark"] .da-meta h3,
[data-theme="dark"] .da-meta p,
[data-theme="dark"] .da-sub,
[data-theme="dark"] .da-feedback,
[data-theme="dark"] .da-link { color: #f4d4dc; }
[data-theme="dark"] .da-stage,
[data-theme="dark"] .da-feedback-correct,
[data-theme="dark"] .da-feedback-wrong,
[data-theme="dark"] .da-feedback-aha,
[data-theme="dark"] .da-board-tea,
[data-theme="dark"] .da-board-toast { background: rgba(0,0,0,0.18); }
