/* =========================================================
   TWL — SALA DE DADOS
   ---------------------------------------------------------
   O layout público vem de css/lore.css.
   Este arquivo estiliza somente a sala.
========================================================= */

.dice-page {
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - var(--header-height, 72px));
    padding: 34px 34px 55px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(38,39,59,.46),
            transparent 36%
        ),
        #181927;
    color: #CBC6BD;
    font-family: 'Poppins', sans-serif;
}

.dice-hero {
    width: min(1180px, 100%);
    margin: 0 auto 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding-bottom: 17px;
    border-bottom: 1px solid rgba(178,151,88,.18);
}

.dice-kicker,
.dice-user-badge span,
.dice-login-required > span,
.dice-log-heading span {
    display: block;
    color: #B29758;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 1.05px;
    text-transform: uppercase;
}

.dice-hero h1 {
    margin: 3px 0 4px;
    color: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: clamp(31px, 4vw, 48px);
    font-weight: 500;
}

.dice-hero p {
    margin: 0;
    color: rgba(203,198,189,.60);
    font-size: 12px;
}

.dice-user-badge {
    min-width: 190px;
    padding: 11px 14px;
    border: 1px solid rgba(178,151,88,.18);
    background: rgba(31,32,50,.72);
}

.dice-user-badge strong {
    display: block;
    margin-top: 3px;
    color: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   DESLOGADO
========================================================= */

.dice-login-required {
    width: min(720px, 100%);
    min-height: 360px;
    margin: 36px auto 0;
    padding: 55px 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(178,151,88,.20);
    outline: 1px solid rgba(178,151,88,.08);
    outline-offset: -7px;
    background:
        linear-gradient(
            145deg,
            rgba(31,32,50,.96),
            rgba(24,25,39,.98)
        );
    text-align: center;
}

.dice-login-ornament {
    margin-bottom: 15px;
    color: #B29758;
    font-size: 25px;
}

.dice-login-required h2 {
    margin: 9px 0;
    color: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: clamp(21px, 3vw, 30px);
    font-weight: 500;
}

.dice-login-required p {
    max-width: 460px;
    margin: 0;
    color: rgba(203,198,189,.58);
    font-size: 9.5px;
    line-height: 1.8;
}

.dice-login-button {
    min-width: 180px;
    min-height: 43px;
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #B29758;
    background: #B29758;
    color: #181927;
    font-family: 'Cinzel', serif;
    font-size: 8px;
    letter-spacing: .65px;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dice-login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,.20);
}


/* =========================================================
   SALA
========================================================= */

.dice-room {
    width: min(1180px, 100%);
    margin: 0 auto;
    border: 1px solid rgba(178,151,88,.20);
    background:
        linear-gradient(
            160deg,
            rgba(31,32,50,.985),
            rgba(24,25,39,.995)
        );
    box-shadow: 0 18px 45px rgba(0,0,0,.15);
}

.dice-room-toolbar {
    min-height: 52px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(178,151,88,.14);
}

.dice-tabs {
    display: flex;
}

.dice-tab {
    min-width: 108px;
    padding: 0 17px;
    border: 0;
    border-right: 1px solid rgba(178,151,88,.10);
    background: transparent;
    color: rgba(203,198,189,.50);
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: .65px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
}

.dice-tab::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 1px;
    background: transparent;
}

.dice-tab.active {
    color: #E8E2D5;
    background: rgba(178,151,88,.035);
}

.dice-tab.active::after {
    background: #B29758;
}

.dice-settings {
    display: flex;
    align-items: center;
    gap: 17px;
    padding-right: 17px;
}

.dice-setting {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(203,198,189,.54);
    font-family: 'Cinzel', serif;
    font-size: 8.5px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.dice-setting input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dice-toggle {
    width: 29px;
    height: 15px;
    position: relative;
    border: 1px solid rgba(178,151,88,.26);
    background: rgba(255,255,255,.025);
}

.dice-toggle span {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 9px;
    height: 9px;
    background: rgba(203,198,189,.35);
    transition: transform .18s ease, background .18s ease;
}

.dice-setting input:checked + .dice-toggle {
    background: rgba(178,151,88,.10);
    border-color: rgba(178,151,88,.48);
}

.dice-setting input:checked + .dice-toggle span {
    transform: translateX(14px);
    background: #B29758;
}


/* =========================================================
   FEED
========================================================= */

.dice-panel {
    position: relative;
}

.dice-panel[hidden] {
    display: none;
}

.dice-feed {
    height: min(58vh, 590px);
    min-height: 390px;
    overflow-y: auto;
    padding: 18px 19px;
    scrollbar-width: thin;
    scrollbar-color: rgba(178,151,88,.28) transparent;
}

.dice-loading,
.dice-empty {
    padding: 35px 15px;
    color: rgba(203,198,189,.34);
    font-size: 8px;
    text-align: center;
}

.dice-entry {
    display: grid;
    grid-template-columns: 38px minmax(0,1fr);
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(178,151,88,.055);
}

.dice-entry:last-child {
    border-bottom: 0;
}

.dice-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(178,151,88,.18);
    background: rgba(178,151,88,.04);
    color: #B29758;
    font-family: 'Cinzel', serif;
    font-size: 9px;
}

.dice-entry-main {
    min-width: 0;
}

.dice-entry-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
}

.dice-entry-user {
    color: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 600;
}

.dice-entry-time {
    color: rgba(203,198,189,.38);
    font-size: 8px;
}

.dice-entry-message {
    margin-top: 4px;
    color: rgba(203,198,189,.74);
    font-size: 11px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.dice-roll-card {
    margin-top: 7px;
    padding: 10px 12px;
    border-left: 2px solid #B29758;
    background: rgba(178,151,88,.045);
}

.dice-roll-expression {
    color: rgba(178,151,88,.80);
    font-family: 'Cinzel', serif;
    font-size: 9px;
}

.dice-roll-result {
    margin-top: 5px;
    color: #E8E2D5;
    font-size: 12px;
    line-height: 1.55;
}

.dice-roll-result strong {
    color: #D6BA74;
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 600;
}

.dice-natural-max {
    color: #D6BA74;
    font-weight: 600;
}

.dice-natural-min {
    color: #B77B7D;
    font-weight: 600;
}


/* =========================================================
   COMPOSER
========================================================= */

.dice-composer {
    padding: 13px 16px 15px;
    border-top: 1px solid rgba(178,151,88,.12);
    background: rgba(11,12,22,.18);
}

.dice-command-help {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: rgba(203,198,189,.38);
    font-size: 8px;
}

.dice-command-help code {
    padding: 3px 6px;
    border: 1px solid rgba(178,151,88,.12);
    color: rgba(178,151,88,.72);
    background: rgba(178,151,88,.025);
    font-size: 8px;
}

.dice-compose-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) 105px;
    gap: 8px;
}

.dice-compose-row textarea {
    width: 100%;
    min-height: 60px;
    max-height: 130px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid rgba(178,151,88,.15);
    outline: 0;
    background: rgba(10,11,20,.40);
    color: #E8E2D5;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    line-height: 1.55;
}

.dice-compose-row textarea:focus {
    border-color: rgba(178,151,88,.40);
}

.dice-compose-row textarea::placeholder {
    color: rgba(203,198,189,.27);
}

.dice-send-button {
    border: 1px solid #B29758;
    background: #B29758;
    color: #181927;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: .55px;
    text-transform: uppercase;
    cursor: pointer;
}

.dice-send-button:disabled {
    opacity: .45;
    cursor: wait;
}

.dice-error {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(183,123,125,.30);
    background: rgba(183,123,125,.06);
    color: #D9A1A3;
    font-size: 9px;
}


/* =========================================================
   ANIMAÇÃO
========================================================= */

.dice-animation-layer {
    position: absolute;
    inset: 0 0 92px;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(13,14,25,.16);
    backdrop-filter: blur(1px);
}

.dice-animation-layer.show {
    display: flex;
}

.dice-d20-wrap {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 700px;
}

.dice-d20 {
    width: 78px;
    height: 78px;
    overflow: visible;
    transform-origin: 50% 50%;
    filter: drop-shadow(0 12px 16px rgba(0,0,0,.30));
}

.dice-d20 polygon {
    fill: #26273B;
    stroke: #D0B46E;
    stroke-width: 3;
}

.dice-d20 line {
    stroke: rgba(208,180,110,.62);
    stroke-width: 1.5;
}

.dice-d20 text {
    fill: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 600;
}

.dice-animation-layer.show .dice-d20 {
    animation:
        diceTumble .88s
        cubic-bezier(.18,.8,.35,1)
        both;
}

@keyframes diceTumble {

    0% {
        transform:
            translate(-100px,-70px)
            rotate(-25deg)
            scale(.68);
    }

    35% {
        transform:
            translate(35px,20px)
            rotate(290deg)
            scale(1.10);
    }

    67% {
        transform:
            translate(-18px,-8px)
            rotate(520deg)
            scale(.92);
    }

    100% {
        transform:
            translate(0,0)
            rotate(720deg)
            scale(1);
    }

}


/* =========================================================
   LOG
========================================================= */

.dice-log-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(178,151,88,.10);
}

.dice-log-heading h2 {
    margin: 3px 0 0;
    color: #E8E2D5;
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 500;
}

.dice-log-heading p {
    max-width: 420px;
    margin: 0;
    align-self: flex-end;
    color: rgba(203,198,189,.48);
    font-size: 9px;
    line-height: 1.6;
    text-align: right;
}

.dice-log {
    min-height: 430px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 12px 18px 20px;
}

.dice-log-row {
    display: grid;
    grid-template-columns: 125px 140px minmax(0,1fr);
    gap: 12px;
    padding: 10px 7px;
    border-bottom: 1px solid rgba(178,151,88,.055);
    font-size: 9px;
}

.dice-log-date {
    color: rgba(203,198,189,.32);
}

.dice-log-user {
    color: rgba(232,226,213,.65);
    font-family: 'Cinzel', serif;
}

.dice-log-content {
    min-width: 0;
    color: rgba(203,198,189,.58);
    overflow-wrap: anywhere;
}

.dice-log-roll {
    color: #B29758;
}


/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 900px) {

    .dice-page {
        padding:
            26px 20px
            45px;
    }

    .dice-room-toolbar {
        align-items: center;
    }

    .dice-settings {
        gap: 10px;
    }

    .dice-setting > span:first-child {
        display: none;
    }

}

@media (max-width: 650px) {

    .dice-page {
        padding:
            20px 14px
            38px;
    }

    .dice-hero {
        display: block;
    }

    .dice-user-badge {
        margin-top: 14px;
        width: 100%;
    }

    .dice-room-toolbar {
        display: block;
    }

    .dice-tabs {
        width: 100%;
    }

    .dice-tab {
        flex: 1;
        min-height: 44px;
    }

    .dice-settings {
        min-height: 40px;
        justify-content: flex-end;
        padding:
            0 12px;
        border-top:
            1px solid rgba(178,151,88,.06);
    }

    .dice-feed {
        min-height: 330px;
        height: 52vh;
        padding:
            12px 9px;
    }

    .dice-entry {
        grid-template-columns:
            31px minmax(0,1fr);
        gap: 8px;
    }

    .dice-avatar {
        width: 29px;
        height: 29px;
    }

    .dice-compose-row {
        grid-template-columns: 1fr;
    }

    .dice-send-button {
        min-height: 39px;
    }

    .dice-animation-layer {
        inset: 0 0 140px;
    }

    .dice-log-heading {
        display: block;
    }

    .dice-log-heading p {
        margin-top: 8px;
        text-align: left;
    }

    .dice-log-row {
        grid-template-columns:
            90px minmax(0,1fr);
    }

    .dice-log-content {
        grid-column: 1 / -1;
    }

}


/* =========================================================
   AJUSTE FINAL DE LEGIBILIDADE DA SALA
   Mantido no fim do arquivo para vencer regras anteriores.
========================================================= */

.dice-room .dice-tab {
    font-size: 10px;
}

.dice-room .dice-setting {
    font-size: 8.5px;
}

.dice-room .dice-entry-user {
    font-size: 10px;
}

.dice-room .dice-entry-time {
    font-size: 8px;
}

.dice-room .dice-entry-message {
    font-size: 11px;
}

.dice-room .dice-roll-expression {
    font-size: 9px;
}

.dice-room .dice-roll-result {
    font-size: 12px;
}

.dice-room .dice-roll-result strong {
    font-size: 17px;
}

.dice-room .dice-command-help,
.dice-room .dice-command-help code {
    font-size: 8px;
}

.dice-room .dice-compose-row textarea {
    font-size: 11px;
}

.dice-room .dice-send-button {
    font-size: 10px;
}

.dice-room .dice-error {
    font-size: 9px;
}

.dice-room .dice-log-row {
    font-size: 9px;
}
