/* Name-Order Challenge (/games/name-order-challenge). Effects follow the Grammar Gauntlet kit, prefix noc-. */

.noc-hero { background: linear-gradient(135deg, #7f1d1d, #b45309); }
.noc-card { overflow: hidden; }

/* The stage clips every effect. */
.noc-stage { position: relative; overflow: hidden; }

.noc-example { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem; }
.noc-example-clue { font-size: 1.15rem; font-weight: 700; color: #1f2937; display: flex; align-items: center; gap: 0.4rem; }
.noc-example-arrow { color: #b45309; font-size: 1.3rem; }
.noc-example-name { display: inline-flex; align-items: center; gap: 0.25rem; }
.noc-example-tile { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.8rem; border: 2px solid #86c5a8; border-radius: 0.5rem; background: #f3faf6; font-size: 1.5rem; font-weight: 700; }
.noc-example-sur { border-color: #d4a72c; background: #fef7dc; color: #7c2d12; }
.noc-example-bar { display: inline-block; width: 4px; height: 3rem; border-radius: 2px; background: #c89b3c; margin: 0 0.2rem; }

.noc-band-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
@media (min-width: 768px) { .noc-band-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.noc-band { display: flex; flex-direction: column; align-items: center; padding: 0.55rem 0.4rem; border: 2px solid #e8c9c0; border-radius: 0.75rem; background: #fff; color: #1f2937; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.noc-band span { font-size: 0.78rem; color: #6b7280; text-align: center; }
.noc-band.active, .noc-band[aria-pressed="true"] { background: linear-gradient(135deg, #991b1b, #b45309); border-color: #f59e0b; color: #fff; }
.noc-band.active span, .noc-band[aria-pressed="true"] span { color: #fef3c7; }
@media (hover: hover) { .noc-band:hover:not(.active) { border-color: #991b1b; } }
.noc-band:active { transform: scale(0.97); }
.noc-band.noc-picked { animation: noc-pop 0.3s ease; }

.noc-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.noc-heart { display: inline-block; color: #dc2626; font-size: 1.15rem; }
.noc-heart-lost { color: #9ca3af; }
.noc-sound { margin-left: auto; }
.noc-combo-badge { color: #fff; background: #6b7280; }
.noc-combo-badge.noc-combo-2 { background: #0284c7; }
.noc-combo-badge.noc-combo-3 { background: #7c3aed; }
.noc-combo-badge.noc-combo-4 { background: #ea580c; }
.noc-combo-badge.noc-combo-5 { background: linear-gradient(135deg, #dc2626, #f97316); animation: noc-glow 1.2s ease-in-out infinite; }

/* The desk view reserves its height so nothing below it moves when 3D arrives. */
.noc-scene { position: relative; height: 170px; border-radius: 0.75rem; background: linear-gradient(180deg, #2a2230, #1d1a24); overflow: hidden; margin-bottom: 0.6rem; }
@media (min-width: 768px) { .noc-scene { height: 230px; } }
.noc-scene .noc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.noc-scene-3d .noc-flat { display: none; }
.noc-flat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.45rem; flex-wrap: wrap; padding: 0 8%; }
.noc-coin { width: 20px; height: 20px; border-radius: 50%; background: #4b2a2a; border: 2px solid #6b3a3a; }
.noc-coin-right { background: #e3b23c; border-color: #fde68a; animation: noc-pop 0.35s ease; }
.noc-coin-miss { background: #9aa3ad; border-color: #cbd5e1; }

.noc-clue { padding: 0.6rem 0.75rem; border: 2px dashed #e0b7a9; border-radius: 0.75rem; background: #fffaf5; text-align: center; }
.noc-who { font-weight: 600; color: #1f2937; }
.noc-clue-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin: 0.25rem 0; }
.noc-conv { font-size: 0.75rem; }
.noc-conv-en { background: #1d4ed8; color: #fff; }
.noc-conv-zh { background: #991b1b; color: #fff; }
.noc-roman { font-size: 1.45rem; font-weight: 800; color: #7c2d12; letter-spacing: 0.01em; }
.noc-clue.noc-deal { animation: noc-deal-in 0.3s ease backwards; }
.noc-clue.noc-shake { animation: noc-shake 0.4s ease; }

.noc-step { min-height: 1.5rem; }
.noc-build { display: flex; justify-content: center; align-items: center; gap: 0.3rem; min-height: 4rem; flex-wrap: nowrap; }
.noc-slot { display: inline-block; width: 3.4rem; height: 3.6rem; border: 2px dashed #e0b7a9; border-radius: 0.6rem; }
.noc-gap {
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 3.6rem;
    border: 2px dashed #c89b3c; border-radius: 0.5rem; background: #fffbeb; padding: 0;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    animation: noc-deal-in 0.28s ease backwards;
}
.noc-gap span { display: block; width: 4px; height: 70%; border-radius: 2px; background: #e5c88a; }
@media (hover: hover) { .noc-gap:hover span { background: #b45309; } }
.noc-gap:active span, .noc-gap:focus-visible span { background: #b45309; }
.noc-gap-line { display: inline-block; width: 5px; height: 3.6rem; border-radius: 3px; background: #c89b3c; margin: 0 0.35rem; animation: noc-pop 0.3s ease; }

.noc-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; }
.noc-tile {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 3.4rem; min-height: 3.6rem;
    border: 2px solid #86c5a8; border-radius: 0.6rem; background: #f3faf6; color: #123b2c; padding: 0.1rem;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    animation: noc-deal-in 0.28s ease backwards;
}
.noc-tile-h { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.noc-tile-p { font-size: 0.7rem; color: #4b5563; }
@media (hover: hover) { .noc-tile:hover:not(:disabled) { border-color: #2f7d60; transform: translateY(-2px); } }
.noc-tile:active:not(:disabled) { transform: scale(0.96); background: #d1fae5; }
.noc-tile-placed { border-color: #2f7d60; background: #e7f6ee; }
.noc-tile-placed:disabled { opacity: 1; color: #123b2c; }
.noc-tile.noc-picked { animation: noc-pop 0.3s ease; }

/* Answer colours (owner, 2026-11-14): right is green, the player's wrong order stays on screen in red. */
.noc-tile-right, .noc-tile-right:disabled { border-color: #16a34a; background: #dcfce7; color: #14532d; opacity: 1; animation: noc-pop 0.35s ease; }
.noc-tile-wrong, .noc-tile-wrong:disabled { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; opacity: 1; animation: noc-shake 0.35s ease; }
.noc-tile-neutral, .noc-tile-neutral:disabled { opacity: 1; }
.noc-gap-line.noc-line-right { background: #16a34a; }
.noc-gap-line.noc-line-wrong { background: #dc2626; }
.noc-correct { padding-top: 0.25rem; border-top: 1px dashed #bbf7d0; }

/* Foreign names: two wide blocks joined by the middle dot. */
.noc-tile-wide { width: auto; min-width: 4.6rem; padding: 0.1rem 0.5rem; }
.noc-slot-wide { width: 5rem; }
.noc-dot { font-size: 2rem; font-weight: 900; color: #b45309; line-height: 1; margin: 0 0.15rem; }
.noc-conv-foreign { background: #0f766e; color: #fff; }
.noc-conv-ask { background: #6d28d9; color: #fff; white-space: normal; }

/* Choice questions. */
.noc-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.noc-opt {
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.4rem;
    padding: 0.35rem 0.5rem; border: 2px solid #e0b7a9; border-radius: 0.7rem; background: #fff; color: #1f2937;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    animation: noc-deal-in 0.28s ease backwards;
}
.noc-opt-main { font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.noc-opt-note { font-size: 0.72rem; color: #6b7280; text-align: center; }
@media (hover: hover) { .noc-opt:hover:not(:disabled) { border-color: #991b1b; transform: translateY(-2px); } }
.noc-opt:active:not(:disabled) { transform: scale(0.97); background: #fef3c7; }
.noc-opt.noc-opt-right, .noc-opt.noc-opt-right:disabled { border-color: #16a34a; background: #dcfce7; color: #14532d; opacity: 1; animation: noc-pop 0.35s ease; }
.noc-opt.noc-opt-wrong, .noc-opt.noc-opt-wrong:disabled { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; opacity: 1; animation: noc-shake 0.35s ease; }
.noc-opt.noc-opt-faded { opacity: 0.5; }

.noc-hall { color: #92400e; }

.noc-answer { font-size: 1.3rem; font-weight: 800; }
.noc-chest { display: inline-block; padding: 0.75rem 1.25rem; border-radius: 0.75rem; background: #fef3c7; border: 2px solid #f59e0b; color: #78350f; }
.noc-review li { padding: 0.4rem 0; border-bottom: 1px solid #f1e0d6; }

/* ── Effects (chrome: never clickable, clipped by the stage) ───────── */
.noc-float {
    position: absolute; transform: translate(-50%, -50%);
    font-weight: 800; font-size: 1.5rem; color: #15803d; text-shadow: 0 1px 0 #fff;
    pointer-events: none; z-index: 4;
    animation: noc-float-up 0.9s ease-out forwards;
}
@keyframes noc-float-up {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
    20% { transform: translate(-50%, -70%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
.noc-particle {
    position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
    pointer-events: none; z-index: 3;
    animation: noc-burst 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.noc-spark { width: 6px; height: 6px; animation-duration: 1s; animation-fill-mode: both; }
@keyframes noc-burst {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}
.noc-confetti {
    position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
    pointer-events: none; z-index: 6;
    animation: noc-confetti-fall 1.8s ease-in forwards;
}
@keyframes noc-confetti-fall {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    100% { opacity: 0; transform: translate(var(--drift), 460px) rotate(var(--spin)); }
}
.noc-combo-pop {
    position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
    font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 900; color: #b45309;
    text-shadow: 0 2px 0 #fff, 0 6px 18px rgba(245, 158, 11, 0.45);
    white-space: nowrap; pointer-events: none; z-index: 4;
    animation: noc-combo-pop 1.1s ease-out forwards;
}
.noc-combo-pop-3 { color: #7c3aed; }
.noc-combo-pop-4 { color: #ea580c; }
.noc-combo-pop-5 { color: #dc2626; }
@keyframes noc-combo-pop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-6deg); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(2deg); }
    45% { transform: translate(-50%, -50%) scale(1) rotate(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
.noc-toast {
    position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%);
    padding: 0.35rem 0.9rem; border-radius: 999px;
    background: #facc15; color: #422006;
    font-weight: 800; font-size: 0.9rem; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    pointer-events: none; z-index: 4;
    animation: noc-toast 2.1s ease forwards;
}
@keyframes noc-toast {
    0% { opacity: 0; transform: translate(-50%, -12px); }
    12% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -6px); }
}
.noc-heart.noc-heart-break { animation: noc-heart-break 0.6s ease; }
@keyframes noc-heart-break {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); color: #ef4444; }
    60% { transform: scale(0.7) rotate(-12deg); }
    100% { transform: scale(0.85); }
}
.noc-bump { display: inline-block; animation: noc-bump 0.35s ease; }
@keyframes noc-bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes noc-pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes noc-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes noc-deal-in { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes noc-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}

/* ── Dark theme: selected states named explicitly so they out-rank the plain dark rules ── */
[data-bs-theme="dark"] .noc-band { background: #1f2937; color: #f3f4f6; border-color: #4b5563; }
[data-bs-theme="dark"] .noc-band span { color: #cbd5e1; }
[data-bs-theme="dark"] .noc-band.active,
[data-bs-theme="dark"] .noc-band[aria-pressed="true"] { background: linear-gradient(135deg, #991b1b, #b45309); border-color: #fbbf24; color: #fff; }
[data-bs-theme="dark"] .noc-band.active span,
[data-bs-theme="dark"] .noc-band[aria-pressed="true"] span { color: #fef3c7; }
[data-bs-theme="dark"] .noc-tile { background: #12352a; color: #ecfdf5; border-color: #2f7d60; }
[data-bs-theme="dark"] .noc-tile-p { color: #a7f3d0; }
[data-bs-theme="dark"] .noc-tile-placed,
[data-bs-theme="dark"] .noc-tile-placed:disabled { background: #065f46; border-color: #34d399; color: #fff; }
[data-bs-theme="dark"] .noc-tile:active:not(:disabled) { background: #047857; }
[data-bs-theme="dark"] .noc-clue, [data-bs-theme="dark"] .noc-example-tile { background: #1f2937; border-color: #6b4a3a; color: #f3f4f6; }
[data-bs-theme="dark"] .noc-example-sur { background: #451a03; color: #fde68a; }
[data-bs-theme="dark"] .noc-who, [data-bs-theme="dark"] .noc-example-clue { color: #f3f4f6; }
[data-bs-theme="dark"] .noc-roman { color: #fbbf24; }
[data-bs-theme="dark"] .noc-slot { border-color: #6b4a3a; }
[data-bs-theme="dark"] .noc-gap { background: #292524; border-color: #c89b3c; }
[data-bs-theme="dark"] .noc-chest { background: #451a03; color: #fde68a; }
[data-bs-theme="dark"] .noc-review li { border-color: #374151; }
[data-bs-theme="dark"] .noc-float { text-shadow: none; }
[data-bs-theme="dark"] .noc-tile-right, [data-bs-theme="dark"] .noc-tile-right:disabled,
[data-bs-theme="dark"] .noc-opt.noc-opt-right, [data-bs-theme="dark"] .noc-opt.noc-opt-right:disabled { background: #14532d; border-color: #22c55e; color: #fff; }
[data-bs-theme="dark"] .noc-tile-wrong, [data-bs-theme="dark"] .noc-tile-wrong:disabled,
[data-bs-theme="dark"] .noc-opt.noc-opt-wrong, [data-bs-theme="dark"] .noc-opt.noc-opt-wrong:disabled { background: #7f1d1d; border-color: #f87171; color: #fff; }
[data-bs-theme="dark"] .noc-opt { background: #1f2937; color: #f3f4f6; border-color: #6b4a3a; }
[data-bs-theme="dark"] .noc-opt-note { color: #cbd5e1; }
[data-bs-theme="dark"] .noc-hall { color: #fbbf24; }
[data-bs-theme="dark"] .noc-correct { border-color: #14532d; }

/* Last in the file: reduced motion turns every effect off, not just slower. */
@media (prefers-reduced-motion: reduce) {
    .noc-stage *, .noc-hud * { animation: none !important; transition: none !important; }
    .noc-tile:active:not(:disabled), .noc-band:active, .noc-opt:active:not(:disabled) { transform: none; }
}
