body.auth-body {
    background: #f7f3ec;
}

.auth-shell {
    width: auto;
    max-width: none;
    margin: 0 8px 36px;
}

.auth-panel {
    margin: 18px auto 30px;
    padding: 20px 24px 24px;
    border: 2px dotted #b3cfbd;
    background: #fffdf9;
}

.auth-title {
    margin: 0 0 6px;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
}

.auth-subtitle {
    margin: 0 0 18px;
    color: #355c2a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.85fr;
    gap: 24px;
}

.auth-chaos {
    width: auto;
    max-width: none;
    min-height: calc(100vh - 90px);
}

.auth-chaos .auth-grid {
    grid-template-columns: 1fr;
    gap: 0;
}

.auth-chaos .auth-form-table,
.auth-chaos .auth-form-table tbody,
.auth-chaos .auth-form-table tr,
.auth-chaos .auth-form-table td {
    display: block;
    width: auto;
}

.auth-chaos .auth-form-table tr {
    margin: 0 0 18px;
}

.auth-chaos .auth-form-table tr:nth-child(odd) {
    width: 83%;
    margin-left: 7%;
    transform: rotate(-1.1deg);
}

.auth-chaos .auth-form-table tr:nth-child(even) {
    width: 92%;
    margin-left: -2%;
    transform: rotate(1.4deg);
}

.auth-chaos .auth-form-table td:first-child {
    width: 36%;
    margin-bottom: 5px;
}

.auth-chaos .auth-form-table td:last-child {
    width: 100%;
}

.auth-chaos .auth-card,
.auth-chaos .auth-side-card {
    border: 0;
    background: transparent;
    padding: 0;
}

.layout-a .fan-panel {
    width: 88%;
    margin-left: 2%;
}

.layout-a .scientific-picker {
    width: 93%;
    margin-left: 6%;
}

.layout-b .fan-panel {
    width: 97%;
    margin-left: -1%;
}

.layout-b .scientific-picker {
    width: 84%;
    margin-left: 11%;
}

.layout-c .fan-panel {
    width: 81%;
    margin-left: 13%;
}

.layout-c .scientific-picker {
    width: 102%;
    margin-left: -2%;
}

.layout-d .fan-panel {
    width: 104%;
    margin-left: -3%;
}

.layout-d .scientific-picker {
    width: 89%;
    margin-left: 7%;
}

.layout-e .fan-panel {
    width: 86%;
    margin-left: 8%;
}

.layout-e .scientific-picker {
    width: 96%;
    margin-left: 0;
}

.layout-f .fan-panel {
    width: 92%;
    margin-left: 1%;
}

.layout-f .scientific-picker {
    width: 107%;
    margin-left: -5%;
}

.auth-card,
.auth-side-card {
    border: 1px solid #ccd9bf;
    background: #fcfdf9;
    padding: 16px;
}

.auth-form-table {
    width: 100%;
    border-collapse: collapse;
}

.auth-form-table td {
    padding: 7px 4px;
    vertical-align: top;
}

.auth-label {
    width: 34%;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.auth-input,
.auth-review-box {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #9aae83;
    background: #ffffff;
    color: #1f1f1f;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    padding: 8px 10px;
}

.auth-submit,
.auth-secondary,
.mode-button,
.fan-key {
    display: inline-block;
    border: 1px solid #567e3a;
    background: #eaf2de;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
}

.auth-secondary {
    border-color: #a88a70;
    background: #f6f1ea;
}

.auth-actions {
    margin-top: 14px;
}

.auth-status {
    margin-top: 14px;
    min-height: 18px;
    color: #355c2a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.auth-status.error {
    color: #9f1d20;
}

.auth-status.warning {
    color: #7a5600;
}

.auth-helper {
    margin: 12px 0 0;
    color: #4a4a4a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.auth-list {
    margin: 8px 0 0 16px;
    padding: 0;
    color: #4a4a4a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.6;
}

.auth-list li {
    margin: 0 0 6px;
}

.auth-hidden {
    display: none;
}

.auth-review-box {
    margin-top: 14px;
    background: #f7f3cf;
    border-color: #c8b679;
}

.signup-chaos {
    background:
        repeating-linear-gradient(-37deg, #fff700 0, #fff700 18px, #ff5e00 18px, #ff5e00 36px, #00e1ff 36px, #00e1ff 54px),
        linear-gradient(90deg, #ff00a6 0%, #00ff66 100%);
    border: 5px double #240046;
    box-shadow: inset 0 0 0 6px #fff, 0 0 0 4px #000;
}

.signup-chaos .role-stamp {
    transform: rotate(-8deg);
    background: #000;
    color: #fff700;
    border: 2px dotted #ff00a6;
    font-size: 14px;
}

.signup-chaos .auth-title {
    display: inline-block;
    margin: 0 0 14px;
    padding: 8px 14px;
    background: #00e1ff;
    color: #8b0000;
    border: 3px ridge #ff00a6;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: rotate(1.5deg);
}

.signup-chaos .auth-grid {
    grid-template-columns: 1fr;
}

.signup-chaos .auth-card {
    background: rgba(255, 255, 255, 0.84);
    border: 4px dashed #001b44;
    transform: rotate(-0.7deg);
}

.signup-chaos .auth-card::before {
    content: "MANDATORY";
    position: absolute;
    right: -14px;
    top: -10px;
    padding: 6px 10px;
    background: #000;
    color: #fff700;
    border: 3px solid #ff00a6;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    transform: rotate(14deg);
}

.signup-chaos .auth-card {
    position: relative;
}

.signup-chaos .auth-form-table {
    transform: rotate(0.8deg);
}

.signup-chaos .auth-form-table tr:first-child td:last-child {
    transform: translateX(18px);
}

.signup-chaos .auth-form-table tr:last-child td:last-child {
    transform: translateX(-10px);
}

.signup-chaos .auth-label {
    width: 26%;
    color: #0b0b0b;
    font-size: 13px;
    text-decoration: underline wavy #ff00a6;
}

.signup-chaos .auth-input {
    border: 3px groove #ff5e00;
    background: #f6ff52;
    color: #001b44;
    font-weight: bold;
}

.signup-chaos .auth-input[name="adminId"],
.signup-chaos .auth-input[name="studentId"],
.signup-chaos .auth-input[name="facultyId"] {
    width: 73%;
}

.signup-chaos .auth-input[name="displayName"],
.signup-chaos .auth-input[name="nickname"],
.signup-chaos .auth-input[name="shortName"] {
    width: 109%;
}

.signup-chaos .auth-input:focus {
    outline: 5px dashed #ff00a6;
    transform: skewX(-7deg) rotate(-1deg);
}

.role-stamp {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: 1px dashed #8b9e71;
    background: #f3f8eb;
    color: #355c2a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-button.is-active {
    background: #5b240f;
    color: #fff6e6;
    border-color: #5b240f;
}

.scientific-picker {
    border: 2px dashed #6a7f50;
    background: linear-gradient(180deg, #f3f7ec 0%, #e4ecda 100%);
    padding: 16px;
    margin: 16px 0;
}

.auth-chaos .scientific-picker {
    margin: 28px 0 10px;
    padding: 26px 22px 34px 28px;
}

.signup-chaos .scientific-picker {
    margin: 24px 6px 8px 22px;
    padding: 18px 12px 24px 27px;
    border: 6px dotted #8b0000;
    background:
        radial-gradient(circle at 10% 10%, #fff 0 5%, transparent 5%),
        radial-gradient(circle at 82% 21%, #001b44 0 7%, transparent 7%),
        linear-gradient(135deg, #c6ff00 0%, #ff6a00 35%, #00d9ff 68%, #ff00a6 100%);
    transform: rotate(1.2deg);
}

.signup-chaos .scientific-picker::before {
    display: inline-block;
    margin: 0 0 14px 18px;
    padding: 3px 9px;
    background: #fff700;
    color: #4b0000;
    border: 3px dashed #001b44;
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    font-weight: bold;
    transform: rotate(6deg);
}

.scientific-picker-title {
    margin: 0 0 8px;
    color: #355c2a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: bold;
}

.signup-chaos .scientific-picker-title {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #000;
    color: #fff;
    border: 3px double #fff700;
    transform: rotate(-2deg);
}

.scientific-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.auth-chaos .scientific-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 13px 29px;
}

.signup-chaos .scientific-grid {
    gap: 9px 21px;
}

.science-cell {
    border: 1px solid #b7c7a3;
    background: #fbfdf7;
    padding: 12px;
}

.auth-chaos .science-cell {
    min-height: 240px;
    padding: 18px 16px 22px;
}

.auth-chaos .science-cell:nth-child(1) {
    width: 29%;
    margin-left: 4%;
}

.auth-chaos .science-cell:nth-child(2) {
    width: 38%;
    margin-top: 27px;
}

.auth-chaos .science-cell:nth-child(3) {
    width: 21%;
    margin-left: 10%;
    margin-top: -11px;
}

.signup-chaos .science-cell {
    border: 4px ridge #001b44;
    background: rgba(255, 255, 255, 0.88);
    padding: 13px 9px 17px;
}

.signup-chaos .science-cell:nth-child(1) {
    transform: rotate(-2deg) translateY(6px);
}

.signup-chaos .science-cell:nth-child(2) {
    transform: rotate(3deg) translateY(-8px);
}

.signup-chaos .science-cell:nth-child(3) {
    transform: rotate(-1deg) translateY(11px);
}

.signup-chaos .science-cell label {
    background: rgba(255, 0, 166, 0.16);
    padding: 2px 5px;
}

.science-cell label {
    display: block;
    margin-bottom: 8px;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.science-cell input[type="range"] {
    width: 100%;
}

.auth-chaos .science-cell input[type="range"] {
    margin-top: 16px;
    transform: scale(1.18) rotate(-1deg);
}

.signup-chaos .science-cell input[type="range"] {
    transform: scaleX(1.08) rotate(-1deg);
    accent-color: #ff00a6;
}

.science-cell select {
    width: 100%;
    margin-top: 8px;
    padding: 7px 8px;
    border: 1px solid #9aae83;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.auth-chaos .science-cell select {
    width: 100%;
    margin-top: 18px;
    padding: 12px 10px;
    font-size: 16px;
}

.signup-chaos .science-cell select {
    width: 88%;
    border: 3px solid #00e1ff;
    background: #240046;
    color: #fff;
}

.science-formula {
    margin-top: 8px;
    color: #355c2a;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    font-weight: bold;
}

.science-value {
    margin-top: 6px;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: bold;
}

.science-preview {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #d3ddb9;
    background: #fffdf5;
    color: #355c2a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
}

.auth-chaos .science-preview {
    margin: 28px 0 6px;
    padding: 16px 18px;
    font-size: 18px;
}

.science-preview.invalid {
    color: #9f1d20;
    border-color: #d6b3b3;
    background: #fff3f3;
}

.signup-chaos .science-preview {
    margin: 22px 35px 4px 3px;
    border: 4px dashed #ff00a6;
    background: #001b44;
    color: #fff700;
    transform: rotate(-1deg);
}

.signup-chaos .science-preview.invalid {
    background: #4b0000;
    color: #fff;
}

.signup-chaos .auth-actions {
    text-align: center;
}

.signup-chaos .auth-submit {
    margin-top: 10px;
    border: 4px outset #000;
    background: linear-gradient(90deg, #ff00a6 0%, #fff700 52%, #00e1ff 100%);
    color: #111;
    font-size: 15px;
    text-transform: uppercase;
    transform: rotate(-1.6deg);
}

.auth-chaos .auth-submit {
    padding: 16px 24px;
    font-size: 20px;
}

.signup-chaos .auth-status {
    margin-top: 18px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 2px dotted #240046;
    color: #6b0000;
}

.signup-chaos .auth-review-box {
    width: auto;
    border: 4px groove #001b44;
    background: #00e1ff;
    color: #4b0000;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(1deg);
}

.signup-chaos .auth-status.error {
    background: #4b0000;
    color: #fff700;
    border: 3px dotted #fff;
}

.signup-chaos .auth-status.warning {
    background: #fff700;
    color: #4b0000;
    border: 3px dashed #001b44;
}

.fan-panel {
    margin: 14px 0 0;
    border: 2px dotted #c8d6b7;
    background: linear-gradient(180deg, #f7faf1 0%, #edf3e2 100%);
    padding: 16px;
    overflow: hidden;
}

.auth-chaos .fan-panel {
    margin: 22px 0 26px;
    padding: 22px 22px 28px;
}

.fan-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.auth-chaos .fan-head {
    display: block;
    position: relative;
    min-height: 122px;
    margin-bottom: 8px;
    transform: rotate(-0.8deg);
}

.fan-meter {
    min-width: 160px;
}

.auth-chaos .fan-meter {
    width: 240px;
    min-width: 0;
    margin-left: auto;
    margin-right: 3%;
    margin-top: -6px;
    transform: rotate(2.8deg) translateY(10px);
}

.auth-chaos .fan-head > div:first-child {
    width: 57%;
    margin-left: 1%;
    transform: rotate(-1.4deg) translateX(9px);
}

.fan-meter input[type="range"] {
    width: 100%;
    pointer-events: none;
    accent-color: #8b0000;
}

.fan-meter-value {
    margin-top: 6px;
    color: #355c2a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
}

.fan-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.auth-chaos .fan-fields {
    display: block;
    position: relative;
    min-height: 166px;
    margin-bottom: 22px;
}

.fan-field {
    border: 2px solid #cad6bb;
    background: #fffef8;
    padding: 10px;
}

.fan-field.is-active {
    border-color: #5b240f;
    box-shadow: 0 0 0 2px #f6dfca inset;
}

.auth-chaos .fan-field:nth-child(1) {
    width: 29%;
    margin-left: 4%;
    margin-top: 11px;
    transform: rotate(-2.6deg);
}

.auth-chaos .fan-field:nth-child(2) {
    width: 48%;
    margin-left: 37%;
    margin-top: -6px;
    transform: rotate(1.8deg);
}

.auth-chaos .fan-field:nth-child(3) {
    width: 27%;
    margin-left: 17%;
    margin-top: 22px;
    transform: rotate(-1.5deg);
}

.auth-chaos .fan-field:nth-child(4) {
    width: 34%;
    margin-left: 52%;
    margin-top: -14px;
    transform: rotate(2.9deg);
}

.fan-field button {
    width: 100%;
    margin-bottom: 8px;
}

.auth-chaos .fan-field {
    display: block;
    position: relative;
}

.auth-chaos .fan-field button {
    width: auto;
    min-width: 58%;
    padding-left: 20px;
    padding-right: 20px;
}

.auth-chaos .fan-field:nth-child(odd) button {
    margin-left: -7px;
    transform: rotate(1.7deg);
}

.auth-chaos .fan-field:nth-child(even) button {
    margin-left: 23px;
    transform: rotate(-1.5deg);
}

.auth-chaos .fan-field input {
    display: block;
    width: 81%;
}

.auth-chaos .fan-field:nth-child(1) input {
    width: 73%;
    margin-left: 6px;
    transform: rotate(-1deg);
}

.auth-chaos .fan-field:nth-child(2) input {
    width: 109%;
    margin-left: -3px;
    transform: rotate(0.7deg);
}

.auth-chaos .fan-field:nth-child(3) input {
    width: 88%;
    margin-left: 14px;
    transform: rotate(-1.6deg);
}

.auth-chaos .fan-field:nth-child(4) input {
    width: 96%;
    margin-left: 31px;
    transform: rotate(1.2deg);
}

.fan-value {
    min-height: 18px;
    word-break: break-all;
}

.fan-keyboard-shell {
    position: relative;
    min-height: 224px;
    border: 1px solid #b8c6a5;
    background: #eef4e3;
    overflow: visible;
}

.auth-chaos .fan-keyboard-shell {
    min-height: 380px;
}

.fan-keyboard-shell.hostile {
    min-height: 312px;
    border: 4px solid #4f5f2d;
    background:
        radial-gradient(circle at 15% 16%, rgba(255,255,255,0.65) 0 6%, transparent 6%),
        linear-gradient(180deg, #dfe9cf 0%, #d2dfbb 22%, #eff4e3 22%, #eff4e3 100%);
}

.auth-chaos .fan-keyboard-shell.hostile {
    min-height: 460px;
    overflow: visible;
    width: 83%;
    margin-left: -1%;
    margin-top: 34px;
    transform: rotate(-1.8deg) skewX(-2deg);
}

.fan-gust {
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 7px solid #d5e3c2;
    background: radial-gradient(circle, #f7faf1 0%, #c8d7a9 62%, #93aa74 100%);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.62);
}

.fan-gust::before,
.fan-gust::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 5px dashed #6f8357;
}

.fan-gust::after {
    inset: 30px;
    border-style: solid;
    border-width: 4px;
    background: rgba(255,255,255,0.45);
}

.fan-gust.left {
    left: 10px;
    top: 14px;
}

.fan-gust.right {
    right: 10px;
    top: 14px;
}

.fan-gust.bottom {
    left: calc(50% - 46px);
    bottom: 10px;
}

.fan-gust span {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border-top: 5px solid rgba(0, 27, 68, 0.5);
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(255, 0, 166, 0.5);
    border-left: 5px solid transparent;
    animation: fanSpin 0.9s linear infinite;
}

.fan-swirl {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 6px solid #dde9cb;
    opacity: 0.85;
}

.hostile .fan-swirl {
    right: auto;
    left: calc(50% - 39px);
    top: 114px;
    width: 104px;
    height: 104px;
    border-width: 8px;
}

.auth-chaos .hostile .fan-swirl {
    top: 78px;
}

.layout-a.auth-chaos .hostile .fan-swirl {
    left: calc(50% - 11px);
    top: 54px;
}

.layout-b.auth-chaos .hostile .fan-swirl {
    left: calc(50% - 28px);
    top: 62px;
}

.layout-c.auth-chaos .hostile .fan-swirl {
    left: calc(50% + 16px);
    top: 49px;
}

.layout-d.auth-chaos .hostile .fan-swirl {
    left: calc(50% - 44px);
    top: 67px;
}

.layout-e.auth-chaos .hostile .fan-swirl {
    left: calc(50% + 22px);
    top: 58px;
}

.layout-f.auth-chaos .hostile .fan-swirl {
    left: calc(50% - 6px);
    top: 50px;
}

.fan-swirl::before,
.fan-swirl::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 4px dashed #93aa74;
}

.fan-swirl::after {
    inset: 18px;
    border-style: solid;
    border-width: 3px;
}

.fan-keyboard {
    position: absolute;
    left: 18px;
    top: 18px;
    width: calc(100% - 120px);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    transition: transform 120ms linear;
}

.hostile .fan-keyboard {
    left: calc(50% - 265px);
    top: 112px;
    width: 530px;
    gap: 10px;
}

.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 352px);
    top: 64px;
    width: 894px;
    gap: 14px;
}

.layout-a.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 418px);
    top: 48px;
    width: 932px;
}

.layout-b.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 307px);
    top: 36px;
    width: 820px;
}

.layout-c.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 379px);
    top: 52px;
    width: 962px;
}

.layout-d.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 435px);
    top: 50px;
    width: 998px;
}

.layout-e.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 274px);
    top: 1px;
    width: 760px;
}

.layout-f.auth-chaos .hostile .fan-keyboard {
    left: calc(50% - 401px);
    top: 38px;
    width: 918px;
}

.layout-a.auth-chaos .science-cell:nth-child(1) {
    width: 34%;
    margin-left: -1%;
}

.layout-a.auth-chaos .science-cell:nth-child(2) {
    width: 24%;
    margin-left: 11%;
}

.layout-a.auth-chaos .science-cell:nth-child(3) {
    width: 32%;
    margin-left: 18%;
}

.layout-b.auth-chaos .fan-field:nth-child(1) {
    width: 24%;
    margin-left: 12%;
}

.layout-b.auth-chaos .fan-field:nth-child(2) {
    width: 42%;
    margin-left: 43%;
}

.layout-c.auth-chaos .auth-form-table tr:nth-child(odd) {
    width: 91%;
    margin-left: -3%;
}

.layout-c.auth-chaos .auth-form-table tr:nth-child(even) {
    width: 74%;
    margin-left: 16%;
}

.layout-d.auth-chaos .science-cell:nth-child(1) {
    width: 23%;
    margin-left: 14%;
}

.layout-d.auth-chaos .science-cell:nth-child(2) {
    width: 48%;
    margin-top: 34px;
}

.layout-e.auth-chaos .fan-field:nth-child(3) {
    width: 35%;
    margin-left: 4%;
}

.layout-e.auth-chaos .fan-field:nth-child(4) {
    width: 30%;
    margin-left: 56%;
}

.layout-a.auth-chaos .fan-fields {
    min-height: 175px;
}

.layout-c.auth-chaos .fan-field:nth-child(1) {
    width: 36%;
    margin-left: 9%;
}

.layout-c.auth-chaos .fan-field:nth-child(2) {
    width: 33%;
    margin-left: 48%;
}

.layout-d.auth-chaos .fan-fields {
    min-height: 184px;
}

.layout-d.auth-chaos .fan-field:nth-child(1) {
    width: 26%;
    margin-left: 8%;
}

.layout-d.auth-chaos .fan-field:nth-child(2) {
    width: 37%;
    margin-left: 46%;
}

.layout-f.auth-chaos .fan-field:nth-child(1) {
    width: 33%;
    margin-left: 2%;
}

.layout-f.auth-chaos .fan-field:nth-child(2) {
    width: 43%;
    margin-left: 42%;
}

.layout-f.auth-chaos .auth-form-table tr:nth-child(odd) {
    width: 76%;
    margin-left: 14%;
}

.layout-f.auth-chaos .auth-form-table tr:nth-child(even) {
    width: 97%;
    margin-left: -4%;
}

.fan-key {
    padding: 10px 8px;
    text-align: center;
}

.hostile .fan-key {
    border: 2px outset #47622d;
    background: linear-gradient(180deg, #fffef8 0%, #e7efd6 100%);
}

.auth-chaos .hostile .fan-key {
    padding: 16px 10px;
    font-size: 17px;
}

.auth-chaos .hostile .fan-key:nth-child(odd) {
    transform: rotate(-2.2deg) translateY(-6px);
}

.auth-chaos .hostile .fan-key:nth-child(even) {
    transform: rotate(2.7deg) translateY(11px);
}

.auth-chaos .hostile .fan-key:nth-child(3n) {
    transform: rotate(-4deg) translateY(18px);
}

.auth-chaos .hostile .fan-key:nth-child(5n) {
    transform: rotate(3.6deg) translateY(-12px);
}

.hostile .fan-key:hover {
    transform: scale(0.96) rotate(-3deg);
}

.fan-key.wide {
    grid-column: span 2;
}

.fan-instructions {
    margin-top: 12px;
    color: #4a4a4a;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

@keyframes fanSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 24, 15, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.auth-overlay.active {
    display: flex;
}

.blackjack-modal {
    width: min(880px, 100%);
    max-height: 92vh;
    overflow: auto;
    border: 3px solid #32411d;
    background: #f4efe5;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.blackjack-topbar {
    background: #5b240f;
    color: #f8f4eb;
    padding: 14px 18px;
}

.blackjack-topbar h2 {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
}

.blackjack-topbar p {
    margin: 6px 0 0;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.blackjack-body {
    padding: 18px;
    background: linear-gradient(180deg, #3f5d29 0%, #2d4522 100%);
}

.blackjack-table {
    border: 2px solid #d3ddb9;
    background: radial-gradient(circle at top, #426832 0%, #315126 50%, #29411f 100%);
    padding: 18px;
    color: #f8f4eb;
}

.blackjack-row {
    margin-bottom: 18px;
}

.blackjack-row h3 {
    margin: 0 0 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

.blackjack-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 88px;
}

.card-tile {
    width: 60px;
    height: 84px;
    border-radius: 8px;
    border: 2px solid #f1efe7;
    background: #fffdf8;
    color: #551011;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 6px;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}

.card-tile.red {
    color: #b31b1b;
}

.card-tile.hidden {
    background: repeating-linear-gradient(45deg, #6f2d17, #6f2d17 10px, #d9c3a4 10px, #d9c3a4 20px);
    color: transparent;
}

.card-corner {
    font-size: 14px;
}

.card-suit {
    text-align: center;
    font-size: 22px;
    line-height: 1;
}

.blackjack-score {
    margin-top: 8px;
    color: #f7f0d6;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.blackjack-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.blackjack-button {
    border: 1px solid #d6e3b5;
    background: #f0f6e2;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding: 10px 14px;
    cursor: pointer;
}

.blackjack-button:disabled {
    opacity: 0.55;
    cursor: default;
}

.blackjack-status {
    margin-top: 16px;
    min-height: 18px;
    color: #fff3cf;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
}

.blackjack-status.win {
    color: #d6ffb5;
}

.blackjack-status.loss {
    color: #ffd3c8;
}

.blackjack-status.push {
    color: #ffecae;
}

.blackjack-note {
    margin-top: 10px;
    color: #dce9c4;
    font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.index-auth-hub {
    margin: 18px auto 24px;
    width: 95%;
    border: 2px dotted #b3cfbd;
    background: #fcfdf9;
    padding: 16px;
}

.index-auth-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.index-auth-link {
    display: inline-block;
    min-width: 150px;
    padding: 9px 12px;
    border: 1px solid #7f995f;
    background: #eef4e6;
    color: #551011;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
}

@media (max-width: 980px) {
    .auth-shell {
        width: auto;
        margin: 0 6px 30px;
    }

    .auth-grid,
    .scientific-grid,
    .fan-fields {
        grid-template-columns: 1fr;
    }

    .auth-label {
        width: 38%;
    }

    .fan-head {
        display: block;
    }

    .fan-keyboard {
        position: static;
        width: auto;
        transform: none !important;
        margin-top: 70px;
    }
}
