/* TrivalRO Server Rules + Web Client confirmation */
.trival-rules-page {
    width: 100%;
    padding: 42px 0 70px;
    background: linear-gradient(180deg, rgba(247,251,253,.96), rgba(234,247,254,.82));
}

.trival-rules-public {
    padding-top: 92px;
}

/* Web Client access gate: keep the hero comfortably below the site navigation. */
.trival-rules-gate {
    padding-top: 108px;
}

.trival-rules-inner,
.trival-rules-admin-inner {
    width: min(var(--trival-shared-content-rail, 1000px), calc(100vw - 48px));
    max-width: var(--trival-shared-content-rail, 1000px);
    margin: 0 auto;
}

.trival-rules-hero {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.trival-rules-kicker {
    display: block;
    margin-bottom: 6px;
    color: #2C9FDF;
    font-family: 'Informb', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.trival-rules-hero h2 {
    display: inline-block;
    margin: 0;
    padding: 13px 28px 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, #68C7F4 0%, #48AFE8 55%, #2993D4 100%);
    color: #fff;
    font-family: 'Grobold', 'Arial Black', sans-serif;
    font-size: 31px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 1.2px;
    text-shadow: 0 2px 2px rgba(36,99,143,.34);
    box-shadow: 0 5px 0 #247FB7, 0 12px 24px rgba(44,159,223,.18);
}

.trival-rules-hero p {
    margin: 18px auto 0;
    color: #627B8D;
    font-family: 'Informb', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.trival-rules-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.trival-rules-meta span,
.trival-rules-version {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #EAF7FE;
    color: #376983;
    font-family: 'Informb', sans-serif;
    font-size: 10px;
    font-weight: 700;
}

.trival-rules-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.trival-rule-item {
    padding: 20px 22px;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 22px rgba(72,143,190,.11);
}

.trival-rule-item h3,
.trival-rule-item h4,
.trival-rules-reading-head h3,
.trival-rules-confirm h3,
.trival-rules-admin-head h2,
.trival-rules-panel-head h3 {
    margin: 0;
    color: #376983;
    font-family: 'Grobold', 'Arial Black', sans-serif;
    font-weight: 400;
}

.trival-rule-item h3 { font-size: 17px; }
.trival-rule-item h4 { font-size: 15px; }

.trival-rule-item p {
    margin: 9px 0 0;
    color: #627B8D;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    line-height: 1.6;
}

.trival-rules-footer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 22px;
    padding: 22px 24px;
    border-radius: 16px;
    background: #EAF7FE;
}

.trival-rules-footer-action strong,
.trival-rules-footer-action span {
    display: block;
    font-family: 'Informb', sans-serif;
}

.trival-rules-footer-action strong {
    color: #376983;
    font-size: 13px;
}

.trival-rules-footer-action span {
    margin-top: 4px;
    color: #718797;
    font-size: 10px;
}

.trival-rules-footer-action a,
.trival-rules-launch,
.trival-rules-admin-preview,
.trival-rules-editor-foot button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px 9px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #5CC3F5 0%, #2FA8EF 50%, #1A88D8 100%);
    color: #fff;
    font-family: 'Grobold', 'Arial Black', sans-serif;
    font-size: 11px;
    letter-spacing: .6px;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0,60,110,.5);
    box-shadow: 0 4px 0 #1573B0, 0 8px 18px rgba(30,130,210,.18);
    cursor: pointer;
}

.trival-rules-footer-action a:hover,
.trival-rules-launch:hover,
.trival-rules-admin-preview:hover,
.trival-rules-editor-foot button:hover {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.trival-rules-gate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
    gap: 20px;
    align-items: start;
}

.trival-rules-reading,
.trival-rules-confirm {
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 30px rgba(72,143,190,.14);
}

.trival-rules-reading { padding: 26px; }
.trival-rules-confirm {
    position: sticky;
    top: 112px;
    padding: 26px;
}

.trival-rules-reading-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.trival-rules-reading-head h3,
.trival-rules-confirm h3 { font-size: 22px; }

.trival-rules-list--gate {
    grid-template-columns: 1fr;
    gap: 10px;
}

.trival-rules-list--gate .trival-rule-item {
    padding: 15px 17px;
    background: #F7FBFD;
    box-shadow: none;
}

.trival-rules-confirm > p {
    margin: 10px 0 18px;
    color: #627B8D;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    line-height: 1.55;
}

.trival-rules-confirm-facts {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.trival-rules-confirm-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #F7FBFD;
    font-family: 'Informb', sans-serif;
}

.trival-rules-confirm-facts span {
    color: #718797;
    font-size: 10px;
}

.trival-rules-confirm-facts strong {
    color: #376983;
    font-size: 10px;
    text-align: right;
    word-break: break-word;
}

.trival-rules-check {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 15px;
    border-radius: 12px;
    background: #EAF7FE;
    color: #376983;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    line-height: 1.5;
    cursor: pointer;
}

.trival-rules-check input {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 30px;
    height: 30px;
    margin: 0;
    opacity: 0;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
}

.trival-rules-check-error {
    position: relative;
    display: none;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fff;
    color: #263B49;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(30,70,95,.22);
}

.trival-rules-check-error::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 23px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(30,70,95,.08);
}

.trival-rules-check-error.is-visible {
    display: flex;
}

.trival-rules-check-error-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #F26B21;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 900;
}

.trival-rules-check-box {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(44,159,223,.28);
}

.trival-rules-check input:focus-visible + .trival-rules-check-box {
    box-shadow: inset 0 0 0 2px #2C9FDF, 0 0 0 3px rgba(44,159,223,.15);
}

.trival-rules-check input:checked + .trival-rules-check-box {
    background: #2C9FDF;
    box-shadow: 0 3px 0 #247FB7;
}

.trival-rules-check input:checked + .trival-rules-check-box::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 900;
}

.trival-rules-confirm-form .trival-rules-launch {
    width: 100%;
    margin-top: 14px;
}

.trival-rules-launch--disabled {
    width: 100%;
    background: #9CB4C3;
    box-shadow: 0 4px 0 #829EAF;
    cursor: default;
}

.trival-rules-accepted {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #EAF7FE;
}

.trival-rules-accepted-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2C9FDF;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 900;
    box-shadow: 0 4px 0 #247FB7;
}

.trival-rules-accepted strong,
.trival-rules-accepted small {
    display: block;
    font-family: 'Informb', sans-serif;
}

.trival-rules-accepted strong { color: #376983; font-size: 11px; }
.trival-rules-accepted small { margin-top: 3px; color: #718797; font-size: 9px; }

.trival-rules-view-link {
    display: block;
    margin-top: 15px;
    color: #2C9FDF;
    font-family: 'Informb', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.trival-rules-error,
.trival-rules-admin-notice {
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 10px;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    line-height: 1.45;
}

.trival-rules-error { background: #FFF1F1; color: #9C4545; }
.trival-rules-admin-notice { background: #EAF7FE; color: #376983; }

/* Admin manager */
.trival-rules-admin {
    width: 100%;
    padding: 28px 0 58px;
    background: #fff;
}

.trival-rules-admin-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 20px;
}

.trival-rules-admin-head h2 { font-size: 28px; }
.trival-rules-admin-head p {
    margin: 8px 0 0;
    color: #627B8D;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    line-height: 1.5;
}

.trival-rules-admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.trival-rules-admin-stats > div {
    padding: 16px 18px;
    border-radius: 14px;
    background: #EAF7FE;
}

.trival-rules-admin-stats span,
.trival-rules-admin-stats strong {
    display: block;
    font-family: 'Informb', sans-serif;
}

.trival-rules-admin-stats span {
    color: #718797;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.trival-rules-admin-stats strong {
    margin-top: 5px;
    color: #2C9FDF;
    font-size: 20px;
}

.trival-rules-admin-grid {
    display: grid;
    gap: 18px;
}

.trival-rules-editor,
.trival-rules-log {
    padding: 22px;
    border-radius: 16px;
    background: #F7FBFD;
}

.trival-rules-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}

.trival-rules-panel-head h3 { font-size: 20px; }
.trival-rules-panel-head > span {
    color: #718797;
    font-family: 'Informb', sans-serif;
    font-size: 9px;
}

.trival-rules-editor textarea {
    display: block;
    width: 100%;
    min-height: 520px;
    resize: vertical;
    padding: 18px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #376983;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: inset 0 0 0 2px rgba(44,159,223,.14);
}

.trival-rules-editor textarea:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #2C9FDF, 0 0 0 3px rgba(44,159,223,.10);
}

.trival-rules-editor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
}

.trival-rules-editor-foot > span {
    color: #718797;
    font-family: 'Informb', sans-serif;
    font-size: 9px;
    line-height: 1.4;
}

.trival-rules-table-wrap { overflow-x: auto; }
.trival-rules-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    font-family: 'Informb', sans-serif;
    font-size: 10px;
}

.trival-rules-table thead th {
    padding: 11px 12px;
    background: #2C9FDF;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.trival-rules-table thead th:first-child { border-radius: 10px 0 0 10px; }
.trival-rules-table thead th:last-child { border-radius: 0 10px 10px 0; }

.trival-rules-table tbody td {
    padding: 12px;
    background: #fff;
    color: #5F7787;
    vertical-align: middle;
}

.trival-rules-table tbody td:first-child {
    border-radius: 10px 0 0 10px;
    color: #376983;
    font-weight: 700;
}
.trival-rules-table tbody td:last-child { border-radius: 0 10px 10px 0; }
.trival-rules-table code { color: #376983; font-size: 10px; }

.trival-rules-log-empty {
    padding: 34px 20px;
    border-radius: 12px;
    background: #fff;
    color: #718797;
    font-family: 'Informb', sans-serif;
    font-size: 11px;
    text-align: center;
}

body.trival-rules-module-page #main-wrapper,
body.trival-rules-module-page #content-col,
body.trival-rules-module-page #content-box,
body.trival-rules-module-page #content-box .content-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.trival-rules-module-page #content-box { background: transparent; }
body.trival-rules-admin-page #main-wrapper,
body.trival-rules-admin-page #content-col,
body.trival-rules-admin-page #content-box,
body.trival-rules-admin-page #content-box .content-inner { background: #fff !important; }

@media (max-width: 900px) {
    .trival-rules-inner,
    .trival-rules-admin-inner { width: min(100% - 28px, var(--trival-shared-content-rail, 1000px)); }
    .trival-rules-list { grid-template-columns: 1fr; }
    .trival-rules-gate-layout { grid-template-columns: 1fr; }
    .trival-rules-confirm { position: static; }
    .trival-rules-admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .trival-rules-page { padding: 28px 0 46px; }
    .trival-rules-gate { padding-top: 72px; }
    .trival-rules-hero h2 { width: 100%; font-size: 23px; padding: 12px 14px 9px; }
    .trival-rules-reading,
    .trival-rules-confirm,
    .trival-rules-editor,
    .trival-rules-log { padding: 18px; }
    .trival-rules-footer-action,
    .trival-rules-admin-head,
    .trival-rules-editor-foot,
    .trival-rules-panel-head { align-items: stretch; flex-direction: column; }
    .trival-rules-footer-action a,
    .trival-rules-admin-preview,
    .trival-rules-editor-foot button { width: 100%; }
    .trival-rules-admin-stats { grid-template-columns: 1fr 1fr; }
    .trival-rules-reading-head { align-items: flex-start; flex-direction: column; }
}
