.rps-page {
    --rps-green: var(--brand-green, #407b28);
    --rps-line: #ddd;
    width: 100%;
    max-width: 888px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 20px 12px 32px;
    color: #333;
    font-size: 13px;
    display: grid;
    grid-template-columns: minmax(0, 160px) minmax(0, 520px) minmax(0, 160px);
    gap: 12px;
    align-items: start;
}
.rps-nav { grid-column: 1; grid-row: 1; min-width: 0; }
.rps-content { grid-column: 2; grid-row: 1; min-width: 0; }
.rps-rules { grid-column: 3; grid-row: 1; min-width: 0; }
.rps-heading { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rps-line); }
.rps-eyebrow { margin: 0 0 4px; color: #666; font-size: 11px; }
.rps-heading h1 { font-size: 20px; font-weight: 600; line-height: 1.4; margin: 0 0 6px; }
.rps-page p { margin: 0 0 12px; line-height: 1.6; }
.rps-page .rps-muted { color: #666; font-size: 12px; }
.rps-heading p:last-child { margin-bottom: 0; }
.rps-page a:not(.green-action-button, .btn-outline-green) { color: var(--rps-green); text-underline-offset: 2px; }
.rps-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.rps-layout > * { min-width: 0; }
.rps-card { background: #fff; border: 1px solid var(--rps-line); border-radius: 3px; padding: 16px; margin-bottom: 12px; overflow-wrap: break-word; overflow-wrap: anywhere; }
.rps-card h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.rps-card.rps-playable { padding: 10px 12px; }
.rps-playable h2 { margin-bottom: 6px; padding-bottom: 0; border-bottom: 0; }
.rps-playable-count { color: #666; font-weight: 400; }
.rps-playable p:last-child { margin-bottom: 0; }
.rps-playable-list { display: flex; gap: 6px; min-width: 0; list-style: none; margin: 0; padding: 3px; overflow-x: auto; }
.rps-playable-list li { flex: 0 0 auto; min-width: 0; max-width: min(240px, 100%); }
.rps-playable-link { display: flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 32px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 3px; background: #f7faf4; text-decoration: none; }
.rps-playable-link .menu-icon { margin-right: 0 !important; }
.rps-playable-link strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.rps-playable-action { flex-shrink: 0; white-space: nowrap; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }
.rps-playable-link:hover, .rps-playable-link[aria-current] { border-color: var(--rps-green); background: #eef6e9; }
.rps-playable-list:focus-visible { outline: 2px solid var(--rps-green); outline-offset: 2px; }
.rps-input { display: block; width: 100%; min-width: 0; box-sizing: border-box; margin-top: 6px; padding: 7px 8px; border: 1px solid #ccc; border-radius: 3px; font: inherit; background: #fff; color: #333; }
.rps-choices { padding: 0; margin: 16px 0; border: 0; min-width: 0; }
.rps-choices legend { padding: 0 0 8px; font-weight: 600; font-size: 13px; }
.rps-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rps-choice { position: relative; cursor: pointer; min-width: 0; }
.rps-choice input { position: absolute; top: 8px; left: 8px; margin: 0; accent-color: var(--rps-green); width: 14px; height: 14px; }
.rps-choice-face { display: flex; flex-direction: column; align-items: center; padding: 22px 4px 8px; border: 1px solid #ccc; border-radius: 3px; background: linear-gradient(#fff, #f7f7f7); }
.rps-choice-face > * + * { margin-top: 6px; }
.rps-choice .rps-symbol { width: 32px; height: 32px; font-size: 24px; }
.rps-glyph { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; vertical-align: middle; background: center / contain no-repeat; }
.rps-glyph-rock { background-image: url('../icons/rps-rock.svg?v=phosphor-1'); }
.rps-glyph-paper { background-image: url('../icons/rps-paper.svg?v=phosphor-1'); }
.rps-glyph-scissors { background-image: url('../icons/rps-scissors.svg?v=phosphor-1'); }
.rps-hand-own .rps-glyph,
.rps-showdown-hand:first-child .rps-glyph,
.rps-reveal > p:first-child .rps-glyph { transform: rotate(90deg) scaleX(-1); }
.rps-hand-opponent .rps-glyph,
.rps-showdown-hand:last-child .rps-glyph,
.rps-reveal > p:last-child .rps-glyph { transform: rotate(-90deg); }
.rps-arena { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 8px; margin-bottom: 12px; background: #f7faf4; border: 1px solid #dce7d6; border-radius: 3px; }
.rps-arena-player { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 12px; min-width: 0; }
.rps-arena-player > * + * { margin-top: 8px; }
.rps-hand { display: block; font-size: 44px; line-height: 1.2; transform-origin: center bottom; animation: rps-hand-beat 600ms ease-in-out 8; }
.rps-hand-opponent { animation-direction: reverse; }
.rps-arena-waiting .rps-hand-own { animation: none; }
.rps-preview-move { display: none; }
.rps-choices:has(input:checked) .rps-preview-idle { display: none; }
.rps-choices:has(input:checked) .rps-hand-own { animation: none; }
.rps-choices:has(input[value="rock"]:checked) .rps-preview-rock,
.rps-choices:has(input[value="paper"]:checked) .rps-preview-paper,
.rps-choices:has(input[value="scissors"]:checked) .rps-preview-scissors { display: inline; }
.rps-symbol { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; font-size: 2.8rem; line-height: 1; }
.rps-symbol-rock { color: #79513c; background: #f0e2d3; }
.rps-symbol-paper { color: #365e76; background: #e0edf3; }
.rps-symbol-scissors { color: #77495c; background: #f1e0e6; }
.rps-choice:hover .rps-choice-face { border-color: #91ae80; }
.rps-choice input:checked + .rps-choice-face { border-color: var(--rps-green); background: #eef6e9; }
.rps-choice input:focus-visible + .rps-choice-face { outline: 2px solid var(--rps-green); outline-offset: 2px; }
.rps-actions { display: flex; align-items: center; flex-wrap: wrap; margin: -5px; }
.rps-actions > * { margin: 5px; }
.rps-page .btn-outline-green { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 36px; padding: 7px 12px; font: 600 12px/1.4 Verdana, Arial, sans-serif; text-decoration: none; cursor: pointer; }
.rps-page :is(a, button, input):focus-visible { outline: 2px solid var(--rps-green); outline-offset: 3px; }
@supports not selector(:focus-visible) {
    .rps-choice input:focus + .rps-choice-face { outline: 2px solid var(--rps-green); outline-offset: 2px; }
    .rps-page a:focus, .rps-page button:focus, .rps-page input:focus { outline: 2px solid var(--rps-green); outline-offset: 3px; }
}
.rps-alert { padding: 10px 12px; background: #fff5f3; border: 1px solid #dcbab3; border-radius: 3px; color: #80392e; }
.rps-notice { padding: 10px 12px; background: #f7faf4; border: 1px solid #dce7d6; border-radius: 3px; }
.rps-list-title { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.rps-result, .rps-waiting { background: #f7faf4; border: 1px solid #dce7d6; border-radius: 3px; padding: 12px; margin-bottom: 12px; }
.rps-result { position: relative; overflow: hidden; }
.rps-showdown { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; animation: rps-showdown-end 150ms ease-out 1.2s forwards; }
.rps-showdown > * + * { margin-top: 12px; }
.rps-showdown-hands { display: flex; }
.rps-showdown-hands > * + * { margin-left: 48px; }
.rps-showdown-hand { display: block; font-size: 40px; line-height: 1.2; transform-origin: center bottom; animation: rps-hand-beat 400ms ease-in-out 3; }
.rps-showdown-hand:last-child { animation-direction: reverse; }
.rps-result-content { animation: rps-result-appear 150ms ease-out 1.2s both; }
@keyframes rps-hand-beat {
    0%, 100% { transform: translateY(0) rotate(-12deg); }
    50% { transform: translateY(-10px) rotate(12deg); }
}
@keyframes rps-showdown-end {
    to { opacity: 0; visibility: hidden; }
}
@keyframes rps-result-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .rps-showdown { display: none; }
    .rps-hand, .rps-showdown-hand, .rps-result-content { animation: none; }
}
.rps-result p:last-child, .rps-waiting p:last-child { margin-bottom: 0; }
.rps-locked-move { display: flex; align-items: center; gap: 6px; }
.rps-locked-move .rps-symbol { flex-shrink: 0; width: 28px; height: 28px; font-size: 20px; }
.rps-page .rps-result-title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 10px; }
.rps-reveal { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; text-align: center; }
.rps-reveal span, .rps-reveal strong { display: block; }
.rps-reveal .rps-symbol { display: flex; margin: 8px auto 0; }
.rps-reveal strong { font-size: 16px; margin-top: 4px; }
.rps-games { list-style: none; margin: 0; padding: 0; }
.rps-games li { padding: 8px 0; border-top: 1px solid #eee; }
.rps-games a { font-weight: 600; }
.rps-games span { display: block; font-size: 12px; color: #666; margin-top: 2px; }
.rps-games .rps-result-unread { display: inline-block; margin: 0 0 0 6px; padding: 2px 6px; border-radius: 3px; background: #245b9e; color: #fff; font-size: 11px; font-weight: 600; }
.rps-history-with-invites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rps-invitations { min-width: 0; }
.rps-invitations .rps-list-title { margin: 0 0 8px; }
.rps-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.rps-pagination span { color: #666; font-size: 12px; }
.rps-rules p { font-size: 12px; }
.rps-rules p:last-child { margin-bottom: 0; }
@media (max-width: 850px) {
    .rps-page { max-width: 544px; grid-template-columns: minmax(0, 1fr); gap: 0; }
    .rps-nav { display: none; }
    .rps-content, .rps-rules { grid-column: 1; grid-row: auto; }
}
@media (max-width: 760px) {
    .rps-page { padding-top: 12px; }
    .rps-card { padding: 12px; }
}
@media (max-width: 520px) {
    .rps-history-with-invites { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 380px) {
    .rps-symbol { width: 48px; height: 48px; font-size: 2.2rem; }
}
.profile-header-controls .profile-rps-controls { display: flex; justify-content: center; gap: 4px; width: 100%; margin: 2px 0 0; }
.profile-rps-controls .profile-rps-move { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid #ccc; border-radius: 3px; font-size: 16px; line-height: 1; cursor: pointer; }
.profile-rps-controls .profile-rps-rock { color: #79513c; background: #f0e2d3; }
.profile-rps-controls .profile-rps-paper { color: #365e76; background: #e0edf3; }
.profile-rps-controls .profile-rps-scissors { color: #77495c; background: #f1e0e6; }
.profile-rps-controls .profile-rps-move:hover { border-color: #407b28; }
.profile-rps-controls .profile-rps-move:focus-visible { outline: 2px solid #407b28; outline-offset: 2px; }
@supports not selector(:focus-visible) {
    .profile-rps-controls .profile-rps-move:focus { outline: 2px solid #407b28; outline-offset: 2px; }
}
