#view-learn main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

#view-learn .main-content {
    width: 95%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: clamp(.65rem, 2vw, 1rem);
}

/* Temporary: ship only the new-player guide until other audience paths are validated. */
#view-learn.learn-audience-new-only .rules-audience-prompt,
#view-learn.learn-audience-new-only #rules-audience-site,
#view-learn.learn-audience-new-only #rules-audience-ace,
#view-learn.learn-audience-new-only #rules-audience-bid {
    display: none !important;
}

#view-learn.learn-audience-new-only #rules-audience-new .rules-audience-header {
    display: none;
}

#view-learn.learn-audience-new-only #rules-audience-new .rules-audience-content {
    display: flex;
    flex-direction: column;
    gap: clamp(.65rem, 2vw, 1rem);
    padding-top: 0;
    padding-left: 0;
}

#view-learn.learn-audience-new-only #rules-audience-new {
    background: none !important;
    box-shadow: none;
}

#view-learn .rules-audience-prompt {
    margin: 0 0 clamp(.35rem, 1.5vw, .65rem);
    padding: 0 clamp(.25rem, 1vw, .5rem);
    font-size: clamp(1.45rem, 4.2vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    color: #F9FAFB;
    text-align: center;
}

#view-learn .rules-audience-group {
    display: flex;
    flex-direction: column;
    gap: clamp(.65rem, 2vw, 1rem);
}

#view-learn .rules-audience-group--divider {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

#view-learn .rules-audience-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(.55rem, 1.5vw, .75rem) clamp(.25rem, 1vw, .5rem);
    cursor: pointer;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(222, 184, 135, 0.22);
    transition: border-color 0.2s ease, color 0.2s ease;
}

#view-learn .rules-audience-header:hover,
#view-learn .rules-audience-header:focus-visible {
    border-bottom-color: rgba(222, 184, 135, 0.5);
}

#view-learn .rules-audience-group.expanded .rules-audience-header {
    border-bottom-color: rgba(222, 184, 135, 0.45);
}

#view-learn .rules-audience-heading {
    margin: 0;
    text-align: left;
    font-size: clamp(1.05rem, 3.2vw, 1.45rem);
    font-weight: 600;
    line-height: 1.35;
    color: #DEB887;
    flex: 1 1 auto;
}

#view-learn .rules-audience-group.expanded .rules-audience-heading {
    color: #F5DEB3;
}

#view-learn .rules-audience-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 1.5rem;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    font-weight: 500;
    color: rgba(222, 184, 135, 0.85);
    line-height: 1;
    flex-shrink: 0;
    pointer-events: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

#view-learn .rules-audience-group.expanded .rules-audience-toggle {
    color: #F5DEB3;
}

#view-learn .rules-audience-content {
    display: none;
    flex-direction: column;
    gap: clamp(.65rem, 2vw, 1rem);
}

#view-learn .rules-audience-group.expanded .rules-audience-content {
    display: flex;
    padding-top: clamp(.35rem, 1.5vw, .65rem);
    padding-left: clamp(.35rem, 1.5vw, .75rem);
}

#view-learn .rules-section {
    position: relative;
    border-radius: clamp(.1rem, 2vw, 1rem);
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3.5vw, 1.75rem);
    cursor: pointer;
    overflow: hidden;
    background: #374151;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#view-learn .rules-section--setup {
    background: linear-gradient(135deg, rgba(222, 184, 135, 0.22) 0%, rgba(210, 180, 140, 0.28) 100%);
    border-color: rgba(222, 184, 135, 0.25);
}

#view-learn .rules-section--bidding {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.22) 0%, rgba(20, 184, 166, 0.28) 100%);
    border-color: rgba(45, 212, 191, 0.25);
}

#view-learn .rules-section--trump {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2) 0%, rgba(249, 115, 22, 0.26) 100%);
    border-color: rgba(251, 146, 60, 0.28);
}

#view-learn .rules-section--rankings {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(96, 165, 250, 0.28) 100%);
    border-color: rgba(96, 165, 250, 0.25);
}

#view-learn .rules-section--tricks {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(167, 139, 250, 0.28) 100%);
    border-color: rgba(167, 139, 250, 0.25);
}

#view-learn .rules-section--scoring {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(74, 222, 128, 0.26) 100%);
    border-color: rgba(74, 222, 128, 0.25);
}

#view-learn .rules-section--strategy {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.24) 100%);
    border-color: rgba(251, 191, 36, 0.28);
}

#view-learn .rules-section--special {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(251, 113, 133, 0.24) 100%);
    border-color: rgba(251, 113, 133, 0.25);
}

#view-learn .rules-section--bid-open {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(56, 189, 248, 0.26) 100%);
    border-color: rgba(56, 189, 248, 0.28);
}

#view-learn .rules-section--bid-hand {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(192, 132, 252, 0.26) 100%);
    border-color: rgba(192, 132, 252, 0.28);
}

#view-learn .rules-section--bid-trump {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2) 0%, rgba(249, 115, 22, 0.26) 100%);
    border-color: rgba(251, 146, 60, 0.28);
}

#view-learn .rules-section--bid-special {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(244, 114, 182, 0.24) 100%);
    border-color: rgba(244, 114, 182, 0.28);
}

#view-learn .rules-section--bid-scoring {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(74, 222, 128, 0.26) 100%);
    border-color: rgba(74, 222, 128, 0.28);
}

#view-learn .rules-section--ace-deck {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2) 0%, rgba(245, 158, 11, 0.26) 100%);
    border-color: rgba(245, 158, 11, 0.28);
}

#view-learn .rules-section--ace-call {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(34, 211, 238, 0.26) 100%);
    border-color: rgba(34, 211, 238, 0.28);
}

#view-learn .rules-section--ace-ranks {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.26) 100%);
    border-color: rgba(129, 140, 248, 0.28);
}

#view-learn .rules-section--ace-trump {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.18) 0%, rgba(244, 63, 94, 0.24) 100%);
    border-color: rgba(244, 63, 94, 0.28);
}

#view-learn .rules-section--ace-setting {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.22) 0%, rgba(156, 163, 175, 0.28) 100%);
    border-color: rgba(156, 163, 175, 0.28);
}

#view-learn .rules-section--site-tables {
    background: linear-gradient(135deg, rgba(222, 184, 135, 0.22) 0%, rgba(210, 180, 140, 0.28) 100%);
    border-color: rgba(222, 184, 135, 0.28);
}

#view-learn .rules-section--site-seats {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.22) 0%, rgba(20, 184, 166, 0.28) 100%);
    border-color: rgba(45, 212, 191, 0.25);
}

#view-learn .rules-section--site-play {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(167, 139, 250, 0.28) 100%);
    border-color: rgba(167, 139, 250, 0.25);
}

#view-learn .rules-section--site-toolbar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(96, 165, 250, 0.28) 100%);
    border-color: rgba(96, 165, 250, 0.25);
}

#view-learn .rules-section--site-rooms {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2) 0%, rgba(249, 115, 22, 0.26) 100%);
    border-color: rgba(251, 146, 60, 0.28);
}

#view-learn .rules-section--site-account {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(74, 222, 128, 0.26) 100%);
    border-color: rgba(74, 222, 128, 0.28);
}

#view-learn .rules-collapsed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 4rem;
    gap: 1rem;
}

#view-learn .rules-section h2 {
    color: #F9FAFB;
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
}

#view-learn .rules-section .rules-tap-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.5rem, 7vw, 3.5rem);
    height: clamp(2.5rem, 7vw, 3.5rem);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1;
    flex-shrink: 0;
    pointer-events: none;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

#view-learn .rules-section.expanded .rules-tap-pill {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

#view-learn .rules-content-wrap {
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    max-height: 0;
}

#view-learn .rules-section.expanded .rules-content-wrap {
    max-height: 5000px;
}

#view-learn .rules-section.expanded .rules-collapsed-header {
    margin-bottom: 0.75rem;
}

#view-learn .rules-body {
    line-height: 1.6;
    color: #F3F4F6;
}

#view-learn .rules-body h3 {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    color: #F9FAFB;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-color: rgba(222, 184, 135, 0.55);
}

#view-learn .rules-body h3:first-child {
    margin-top: 0;
}

#view-learn .rules-body p {
    margin: 1rem 0;
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
}

#view-learn .rules-body p.rules-lead {
    font-style: italic;
    color: #E5E7EB;
}

#view-learn .rules-body p.rules-subheading {
    margin: 1.25rem 0 0.35rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-color: rgba(222, 184, 135, 0.65);
    color: #F9FAFB;
}

#view-learn .rules-body p.rules-note {
    font-style: italic;
    border-left: 3px solid rgba(222, 184, 135, 0.45);
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: #E5E7EB;
    border-radius: 4px;
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

#view-learn .rules-deep-link-highlight {
    background-color: rgba(222, 184, 135, 0.22);
    box-shadow: 0 0 0 3px rgba(222, 184, 135, 0.35);
}

#view-learn .rules-body u {
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-color: rgba(222, 184, 135, 0.75);
    font-weight: 600;
}

#view-learn .rules-body ul,
#view-learn .rules-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

#view-learn .rules-body li {
    margin: 0.5rem 0;
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
}

#view-learn .rules-body strong {
    color: #FFF;
    font-weight: 700;
    font-style: normal;
}

#view-learn .rules-body em {
    color: #D1D5DB;
    font-style: italic;
    font-weight: 400;
}

#view-learn .rules-body li em {
    color: #D1D5DB;
}

#view-learn .rules-body a {
    color: #DEB887;
    text-decoration: underline;
    font-weight: 600;
}

#view-learn .rules-body a:hover {
    color: #F9FAFB;
}

#view-learn .table-instruction {
    font-weight: 500;
    font-style: italic;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85em;
}
