@import url("board.css");
@import url("tile.css");


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


:root {
    --board-size: 600px;
    --board-border: calc( var(--board-size)/60 );
    --block-size: calc( var(--board-size)/8 );
    --tile-size: calc( var(--block-size)*0.75 );
}


.hide {
    display: none !important;
}
.dfr {
    display: flex;
    flex-direction: row;
}
.dfc {
    display: flex;
    flex-direction: column;
}
.aic {
    align-items: center;
}
.jcc {
    justify-content: center;
}


body {
    min-height: 100%;
    padding-top: 36px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #727272;
    overflow-x: hidden;
}


#content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}


#content #content-title {
    width: var(--board-size);
    justify-content: space-between;
}

#game-layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 34px;
}

#ai-panel {
    width: min(560px, calc(100vw - 32px));
    height: calc(var(--board-size) + (var(--board-border) * 4) + (var(--board-border) * 2));
    box-sizing: border-box;
    padding: 16px;
    color: #e8eaef;
    background: #20242b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

#ai-panel-title {
    font-size: 18px;
    font-weight: 700;
}

#ai-panel-subtitle {
    margin-top: 4px;
    color: #aeb5c2;
    font-size: 13px;
    line-height: 1.35;
}

#ai-table-wrap {
    margin-top: 14px;
    max-height: calc(var(--board-size) + (var(--board-border) * 6) - 132px);
    overflow: auto;
}

#ai-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#ai-stats-table th,
#ai-stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    text-align: left;
    white-space: nowrap;
}

#ai-stats-table th {
    position: sticky;
    top: 0;
    color: #b8bfcc;
    background: #20242b;
    font-weight: 700;
}

#ai-stats-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

#ai-stats-empty td {
    color: #9aa2af;
    text-align: center;
}

#ai-current {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #d8deea;
    font-size: 13px;
    line-height: 1.45;
}

.score-positive {
    color: #78c7ff;
}

.score-negative {
    color: #ffd36b;
}

.score-neutral {
    color: #e8eaef;
}

.source-ai {
    color: #78c7ff;
    font-weight: 700;
}

.source-human {
    color: #f4d06f;
    font-weight: 700;
}


#content #content-title .title-counter {
    margin: 0 16px;
    width: calc( var(--tile-size)*1.25 );
    height: calc( var(--tile-size)*1.25 );
    border-radius: 50%;
    font-size: calc( var(--board-size)/16 );
    box-shadow: calc(var(--board-size)*0.0117) calc(var(--board-size)*0.0117) calc(var(--board-size)*0.0167) rgba(0, 0, 0, 0.25),
    inset calc(var(--board-size)*0.0083) calc(var(--board-size)*0.0083) calc(var(--board-size)*0.0117) rgba(255, 255, 255, 0.25),
    inset calc(var(--board-size)*-0.0083) calc(var(--board-size)*-0.0083) calc(var(--board-size)*0.0117) rgba(0, 0, 0, 0.5);
}
#content #content-title .title-counter:first-child {
    background: #333;
}
#content #content-title .title-counter:last-child {
    background: #fff;
}
#content #content-title .title-counter:first-child .title-counter-data {
    color: #fff;
}
#content #content-title .title-counter:last-child .title-counter-data {
    color: #333;
}


#content #content-title #title {
    font-size: calc( var(--board-size)/8 );
    text-shadow: 0 2px 3px #000;
}
#content #content-title #title span {
    margin: 4px 8px;
}
#content #content-title #title span:nth-child(odd) {
    color: #333;
}
#content #content-title #title span:nth-child(even) {
    color: #fff;
}


#engine-note {
    width: min(var(--board-size), calc(100vw - 32px));
    margin-top: 26px;
    padding-bottom: 12px;
    color: #f0f0f0;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#engine-note p {
    margin: 0;
}

#engine-note .engine-links {
    margin-top: 8px;
}

#engine-note .engine-links a {
    color: #f4d06f;
    text-decoration: none;
    font-weight: 700;
}

#engine-note .engine-links a:hover {
    text-decoration: underline;
}

#engine-note .engine-links span {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.72);
}

#engine-note .engine-tech {
    white-space: nowrap;
    font-size: 13px;
}

#game-summary {
    width: min(var(--board-size), calc(100vw - 32px));
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

#game-summary.hide {
    display: none;
}

#game-summary-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

#restartbtn {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    padding: 8px 14px;
    color: #222;
    background: #f2f2f2;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
}

#restartbtn:hover {
    background: #fff;
}




@media (min-width: 300px) {
    :root {
        --board-size: 280px;
    }
}
@media (min-width: 400px) {
    :root {
        --board-size: 360px;
    }
}
@media (min-width: 600px) {
    :root {
        --board-size: 400px;
    }
}
@media (min-width: 720px) {
    :root {
        --board-size: 540px;
    }
}
@media (min-width: 1024px) {
    :root {
        --board-size: 620px;
    }
}

@media (max-width: 1120px) {
    #game-layout {
        flex-direction: column;
        align-items: center;
    }

    #ai-panel {
        height: auto;
        max-height: none;
    }

    #ai-table-wrap {
        max-height: 260px;
    }
}
