/* =========================================================
   CARO 5
   BRIGHT NAVY / CYAN UI
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html,
body {
    width: 100%;
    height: 100%;

    min-height: 100%;

    overflow: hidden;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: #f7fbff;

    background:
        radial-gradient(
            circle at 12% 10%,
            rgba(45, 212, 255, 0.22),
            transparent 30%
        ),
        radial-gradient(
            circle at 88% 82%,
            rgba(168, 85, 247, 0.18),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #10294d,
            #173b68 48%,
            #10294c
        );
        -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}


body {
    min-height: 100vh;
    min-height: 100dvh;
}


button,
select,
input {
    font: inherit;
}


button {
    border: 0;
    cursor: pointer;
}


button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}


.hidden {
    display: none !important;
}


/* =========================================================
   SCREEN
========================================================= */

.screen {
    width: 100%;
    height: 100vh;
    height: 100dvh;

    position: relative;
}


/* =========================================================
   MENU
========================================================= */

.menu-screen {
    display: flex;

    align-items: center;
    justify-content: center;

    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));

    overflow: auto;
}


.menu-card {
    width: min(
        1180px,
        calc(100vw - 32px)
    );

    min-height:
        min(
            700px,
            calc(100dvh - 32px)
        );

    position: relative;

    display: flex;
    flex-direction: column;

    padding:
        55px 27px 17px;

    border:
        1px solid
        rgba(154, 205, 255, 0.22);

    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            rgba(27, 63, 105, 0.97),
            rgba(18, 45, 79, 0.97)
        );

    box-shadow:
        0 30px 80px
        rgba(3, 17, 38, 0.45),

        inset 0 1px 0
        rgba(255, 255, 255, 0.09);

    overflow: hidden;
}


.menu-card::before {
    content: "";

    position: absolute;

    width: 600px;
    height: 600px;

    top: -350px;
    left: 50%;

    transform: translateX(-50%);

    background:
        radial-gradient(
            circle,
            rgba(45, 212, 255, 0.13),
            transparent 67%
        );

    pointer-events: none;
}


/* =========================================================
   SMALL BUTTON
========================================================= */

.small-btn {
    min-height: 36px;

    padding:
        7px 13px;

    color: #dceeff;

    border:
        1px solid
        rgba(151, 204, 255, 0.25);

    border-radius: 10px;

    background:
        rgba(60, 117, 176, 0.4);

    transition: 0.2s ease;
}


.small-btn:hover {
    color: white;

    background:
        rgba(73, 139, 204, 0.6);

    border-color:
        rgba(92, 224, 255, 0.5);

    transform:
        translateY(-1px);
}


.gamehub-btn {
    position: absolute;

    top: 17px;
    left: 20px;

    z-index: 10;
}


/* =========================================================
   MENU GRID
========================================================= */

.menu-grid {
    flex: 1;

    min-height: 0;

    position: relative;
    z-index: 2;

    display: grid;

    grid-template-columns:
        minmax(210px, 0.88fr)
        minmax(350px, 1.35fr)
        minmax(210px, 0.88fr);

    gap: 21px;
}


.menu-side {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* =========================================================
   BRAND
========================================================= */

.brand-block {
    padding:
        3px 3px 0;
}


.logo {
    display: flex;

    align-items: center;

    gap: 4px;

    margin-bottom: 8px;

    font-size: 67px;

    line-height: 0.75;

    font-weight: 1000;

    letter-spacing: -8px;
}


.logo-o {
    color: #35dcff;

    text-shadow:
        0 0 10px
        rgba(53, 220, 255, 0.65),

        0 0 25px
        rgba(53, 220, 255, 0.35);
}


.logo-x {
    color: #f477d2;

    text-shadow:
        0 0 10px
        rgba(244, 119, 210, 0.65),

        0 0 25px
        rgba(244, 119, 210, 0.35);
}


.brand-line {
    margin-bottom: 4px;

    color: #67e8f9;

    font-size: 9px;

    font-weight: 900;

    letter-spacing: 2.5px;
}


.brand-block h1 {
    color: #f8fcff;

    font-size: 52px;

    line-height: 0.95;

    letter-spacing: -2px;

    font-weight: 950;
}


.subtitle {
    max-width: 270px;

    margin-top: 10px;

    color: #b8cee5;

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   MINI BOARD
========================================================= */

.mini-board-wrap {
    display: flex;

    justify-content: center;

    padding: 3px 0;
}


.mini-board {
    width: 145px;
    height: 145px;

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    grid-template-rows:
        repeat(5, 1fr);

    padding: 8px;

    border:
        1px solid
        rgba(141, 205, 255, 0.23);

    border-radius: 15px;

    background:
        rgba(8, 29, 55, 0.48);

    box-shadow:
        0 15px 40px
        rgba(4, 19, 39, 0.28);
}


.mini-board span {
    display: flex;

    align-items: center;
    justify-content: center;

    border-right:
        1px solid
        rgba(130, 193, 235, 0.12);

    border-bottom:
        1px solid
        rgba(130, 193, 235, 0.12);

    font-size: 15px;

    font-weight: 950;
}


.mini-board span:nth-child(5n) {
    border-right: 0;
}


.mini-board span:nth-last-child(-n + 5) {
    border-bottom: 0;
}


.mini-x {
    color: #42dfff;

    text-shadow:
        0 0 12px
        rgba(66, 223, 255, 0.65);
}


.mini-o {
    color: #f77bd3;

    text-shadow:
        0 0 12px
        rgba(247, 123, 211, 0.65);
}


/* =========================================================
   FEATURES
========================================================= */

.feature-list {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin-top: auto;
}


.feature-item {
    display: flex;

    gap: 9px;

    padding: 9px;

    border:
        1px solid
        rgba(144, 202, 255, 0.13);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(50, 102, 158, 0.45),
            rgba(28, 67, 112, 0.42)
        );
}


.feature-item > span {
    width: 29px;
    height: 29px;

    flex: 0 0 29px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        rgba(94, 190, 255, 0.12);
}


.feature-item strong {
    display: block;

    margin-bottom: 2px;

    font-size: 10px;
}


.feature-item small {
    display: block;

    color: #9eb7d0;

    font-size: 8px;

    line-height: 1.35;
}


/* =========================================================
   CENTER
========================================================= */

.menu-center {
    min-width: 0;

    padding: 4px;

    display: flex;
    flex-direction: column;

    justify-content: center;
}


.panel-title {
    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 16px;
}


.panel-icon {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(92, 218, 255, 0.25);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(44, 124, 190, 0.7),
            rgba(35, 87, 144, 0.6)
        );

    font-size: 20px;
}


.panel-title strong {
    display: block;

    margin-bottom: 2px;

    font-size: 19px;
}


.panel-title small {
    color: #9eb9d5;

    font-size: 10px;
}


.section {
    margin-bottom: 11px;
}


.section h3 {
    margin-bottom: 7px;

    color: #e0ebf8;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 1.4px;
}


/* =========================================================
   MODE
========================================================= */

.mode-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}


.mode-btn {
    min-width: 0;
    min-height: 61px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 8px 10px;

    text-align: left;

    color: #c8d9eb;

    border:
        1px solid
        rgba(154, 207, 255, 0.2);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(47, 98, 153, 0.67),
            rgba(32, 69, 116, 0.67)
        );

    transition: 0.2s ease;
}


.mode-btn:hover {
    border-color:
        rgba(83, 224, 255, 0.45);
}


.mode-btn.active {
    color: white;

    border:
        2px solid
        #39dcff;

    background:
        linear-gradient(
            145deg,
            rgba(39, 111, 163, 0.9),
            rgba(31, 75, 124, 0.9)
        );

    box-shadow:
        0 0 25px
        rgba(53, 220, 255, 0.12);
}


.mode-icon {
    width: 33px;
    height: 33px;

    flex: 0 0 33px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.08);

    font-size: 16px;
}


.mode-btn strong {
    display: block;

    margin-bottom: 2px;

    font-size: 11px;
}


.mode-btn small {
    display: block;

    color: #91adca;

    font-size: 8px;
}


/* =========================================================
   BOARD SIZE
========================================================= */

.select-wrap {
    height: 44px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding:
        0 12px;

    border:
        1px solid
        rgba(151, 207, 255, 0.2);

    border-radius: 11px;

    background:
        linear-gradient(
            145deg,
            rgba(47, 96, 151, 0.7),
            rgba(30, 68, 113, 0.7)
        );
}


.grid-size-icon {
    width: 22px;
    height: 22px;

    flex: 0 0 22px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    grid-template-rows:
        repeat(3, 1fr);

    gap: 2px;

    padding: 2px;
}


.grid-size-icon i {
    display: block;

    border-radius: 2px;

    background: #42dcff;
}


.select-wrap select {
    width: 100%;

    border: 0;
    outline: 0;

    color: #f8fbff;

    background: transparent;

    font-size: 12px;

    font-weight: 750;

    cursor: pointer;
}


.select-wrap select option {
    color: #10213b;

    background: white;
}


/* =========================================================
   DIFFICULTY SELECT
========================================================= */

.difficulty-section {
    margin-bottom: 11px;

    transition:
        opacity 0.2s ease;
}


.difficulty-title {
    display: flex;

    align-items: baseline;

    gap: 7px;

    margin-bottom: 7px;

    color: #e4edf8;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 1.3px;
}


.difficulty-title small {
    color: #8fb7dd;

    font-size: 6.5px;

    letter-spacing: 0.2px;
}


.difficulty-select-wrap {
    position: relative;

    width: 100%;
    height: 44px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding:
        0 12px;

    border:
        1px solid
        rgba(87, 221, 255, 0.24);

    border-radius: 11px;

    background:
        linear-gradient(
            145deg,
            rgba(46, 105, 162, 0.78),
            rgba(28, 69, 116, 0.78)
        );

    transition:
        0.2s ease;
}


.difficulty-select-wrap:hover {
    border-color:
        rgba(74, 224, 255, 0.48);
}


.difficulty-select-icon {
    width: 27px;
    height: 27px;

    flex: 0 0 27px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background:
        rgba(255, 255, 255, 0.08);

    font-size: 13px;
}


.difficulty-select {
    width: 100%;
    height: 100%;

    min-width: 0;

    border: 0;
    outline: 0;

    appearance: none;
    -webkit-appearance: none;

    padding-right: 25px;

    color: #f4fbff;

    background: transparent;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;
}


.difficulty-select option {
    color: #eaf6ff;

    background: #173b68;

    font-weight: 700;
}


.difficulty-select-wrap::after {
    content: "⌄";

    position: absolute;

    right: 12px;
    top: 50%;

    transform:
        translateY(-55%);

    color: #73e6ff;

    font-size: 15px;

    font-weight: 900;

    pointer-events: none;
}


.difficulty-section.difficulty-disabled {
    opacity: 0.4;
}


.difficulty-section.difficulty-disabled
.difficulty-select {
    cursor: not-allowed;
}


/* =========================================================
   PLAY
========================================================= */

.main-btn {
    width: 100%;
    height: 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    border-radius: 12px;

    color: #06344c;

    font-size: 13px;

    font-weight: 950;

    background:
        linear-gradient(
            135deg,
            #78ebf8,
            #2fd6ee
        );

    box-shadow:
        0 10px 30px
        rgba(45, 212, 255, 0.25);

    transition: 0.2s ease;
}


.main-btn:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 15px 40px
        rgba(45, 212, 255, 0.35);
}


/* =========================================================
   ONLINE
========================================================= */

.online-divider {
    display: flex;

    align-items: center;

    gap: 9px;

    margin:
        11px 0 8px;

    color: #8ba9c5;

    font-size: 7px;

    font-weight: 900;

    letter-spacing: 1.4px;
}


.online-divider::before,
.online-divider::after {
    content: "";

    height: 1px;

    flex: 1;

    background:
        rgba(164, 211, 248, 0.2);
}


.online-actions {
    display: flex;

    flex-direction: column;

    gap: 6px;
}


.online-btn {
    width: 100%;

    min-height: 39px;

    padding:
        8px 12px;

    border:
        1px solid
        rgba(80, 157, 255, 0.5);

    border-radius: 10px;

    color: #eff8ff;

    background:
        linear-gradient(
            135deg,
            rgba(29, 80, 165, 0.88),
            rgba(45, 71, 145, 0.88)
        );

    font-size: 10px;

    font-weight: 850;

    transition: 0.2s ease;
}


.online-btn:hover {
    border-color:
        #46dcff;

    transform:
        translateY(-1px);
}


.join-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        100px;

    gap: 6px;
}


.room-input-wrap {
    min-width: 0;

    height: 39px;

    display: flex;

    align-items: center;

    gap: 6px;

    padding:
        0 10px;

    border:
        1px solid
        rgba(151, 207, 255, 0.19);

    border-radius: 10px;

    background:
        rgba(34, 73, 119, 0.68);
}


.room-input-wrap > span {
    color: #8eb9df;
}


.room-input-wrap input {
    width: 100%;

    min-width: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: white;

    font-size: 16px;

    font-weight: 800;

    letter-spacing: 2px;

    text-transform: uppercase;
}


.room-input-wrap input::placeholder {
    color: #88a4c0;

    letter-spacing: 0;
}


#joinRoomButton {
    min-height: 39px;

    color: #e8f5ff;

    border:
        1px solid
        rgba(151, 207, 255, 0.2);

    border-radius: 10px;

    background:
        rgba(59, 108, 158, 0.65);

    font-size: 9px;

    font-weight: 850;
}


.firebase-status {
    margin-top: 6px;

    text-align: center;

    color: #9bb7d2;

    font-size: 8px;
}


/* =========================================================
   RIGHT MENU
========================================================= */

.info-card,
.rules-card,
.quote-card {
    border:
        1px solid
        rgba(149, 204, 255, 0.17);

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(37, 83, 130, 0.67),
            rgba(25, 59, 99, 0.67)
        );

    padding: 12px;
}


.info-card-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    margin-bottom: 7px;
}


.info-card-title,
.rules-title {
    color: #eff7ff;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 1px;
}


.info-card-header
.info-card-title {
    margin-bottom: 0;
}


/* =========================================================
   SOUND BUTTON
========================================================= */

.caro-sound-button {
    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(112, 224, 255, 0.28);

    border-radius: 9px;

    color: #eaf9ff;

    background:
        linear-gradient(
            145deg,
            rgba(60, 128, 182, 0.75),
            rgba(38, 83, 132, 0.75)
        );

    font-size: 14px;

    transition: 0.2s ease;
}


.caro-sound-button:hover {
    border-color:
        rgba(68, 224, 255, 0.65);

    transform:
        translateY(-1px);
}


.caro-sound-button.muted {
    opacity: 0.65;

    filter: grayscale(0.4);
}


.info-row {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    padding: 8px 0;

    border-bottom:
        1px solid
        rgba(174, 218, 248, 0.1);
}


.info-row:last-child {
    border-bottom: 0;

    padding-bottom: 0;
}


.info-row > span {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background:
        rgba(86, 185, 242, 0.13);
}


.info-row strong {
    display: block;

    margin-bottom: 2px;

    color: #f1f8ff;

    font-size: 9px;
}


.info-row small {
    display: block;

    color: #a3bdd5;

    font-size: 8px;

    line-height: 1.4;
}


/* =========================================================
   RULES
========================================================= */

.rules-card {
    flex: 1;
}


.rule {
    display: flex;

    align-items: flex-start;

    gap: 7px;

    margin-top: 8px;
}


.rule-number {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(77, 218, 255, 0.35);

    border-radius: 50%;

    color: #71e7ff;

    background:
        rgba(38, 149, 194, 0.18);

    font-size: 7px;

    font-weight: 900;
}


.rule p {
    color: #b2c8dd;

    font-size: 8px;

    line-height: 1.5;
}


/* =========================================================
   QUOTE
========================================================= */

.quote-card {
    position: relative;

    overflow: hidden;
}


.quote-mark {
    position: absolute;

    top: -10px;
    left: 9px;

    color:
        rgba(90, 205, 245, 0.25);

    font-family: Georgia, serif;

    font-size: 60px;
}


.quote-card p {
    position: relative;
    z-index: 1;

    padding-top: 17px;

    color: #b3cbe0;

    font-size: 10px;

    line-height: 1.5;

    font-style: italic;

    text-align: center;
}


.menu-footer {
    position: relative;
    z-index: 3;

    display: flex;

    justify-content: center;

    margin-top: 8px;

    color: #8aa8c4;

    font-size: 7px;

    letter-spacing: 1px;
}


/* =========================================================
   GAME
========================================================= */

.game-screen {
    display: flex;

    align-items: stretch;
    justify-content: stretch;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(40, 190, 240, 0.09),
            transparent 36%
        ),
        linear-gradient(
            135deg,
            #0e2647,
            #14355d,
            #0c2342
        );
}


.game-container {
    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    position: relative;

    display: flex;
    flex-direction: column;

    padding:
        max(8px, env(safe-area-inset-top))
        max(13px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom))
        max(13px, env(safe-area-inset-left));
}


/* =========================================================
   GAME HEADER
========================================================= */

.game-header {
    height: 50px;

    flex: 0 0 50px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;
}


.game-title {
    min-width: 0;

    flex: 1;

    display: flex;

    align-items: center;

    gap: 8px;
}


.game-title-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        rgba(79, 222, 255, 0.3);

    border-radius: 9px;

    color: #52ddff;

    background:
        rgba(37, 128, 176, 0.28);

    font-size: 9px;

    font-weight: 950;
}


.game-title strong {
    display: block;

    font-size: 13px;
}


.game-title span {
    display: block;

    max-width: 55vw;

    margin-top: 2px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: #8eacc7;

    font-size: 7px;
}


.game-header-right {
    display: flex;

    align-items: center;

    gap: 5px;

    color: #a2bdd5;

    font-size: 7px;

    font-weight: 900;

    letter-spacing: 1px;
}


.live-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #2ee879;

    box-shadow:
        0 0 10px
        rgba(46, 232, 121, 0.8);
}


/* =========================================================
   NOTICE
========================================================= */

.online-notice {
    position: absolute;

    z-index: 30;

    top: 60px;
    left: 50%;

    transform:
        translateX(-50%);

    width: min(
        600px,
        calc(100vw - 30px)
    );

    padding:
        8px 13px;

    border:
        1px solid
        rgba(72, 218, 255, 0.28);

    border-radius: 10px;

    text-align: center;

    color: #baf5ff;

    background:
        rgba(18, 59, 92, 0.94);

    box-shadow:
        0 12px 35px
        rgba(4, 25, 47, 0.35);

    backdrop-filter:
        blur(12px);

    font-size: 8px;

    font-weight: 750;
}


/* =========================================================
   GAME AREA
========================================================= */

.game-area {
    flex: 1;

    min-width: 0;
    min-height: 0;

    display: grid;

    grid-template-columns:
        minmax(145px, 0.7fr)
        minmax(0, 1.8fr)
        minmax(145px, 0.7fr);

    gap: 14px;
}


/* =========================================================
   SIDES
========================================================= */

.game-side {
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 8px;
}


.side-heading {
    height: 27px;

    display: flex;

    align-items: center;

    gap: 6px;

    color: #b3cce2;

    font-size: 7px;

    font-weight: 900;

    letter-spacing: 1px;
}


/* =========================================================
   INFO PANEL
========================================================= */

.info-panel {
    display: flex;
    flex-direction: column;

    gap: 6px;

    padding: 8px;

    border:
        1px solid
        rgba(143, 202, 247, 0.16);

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(37, 80, 125, 0.6),
            rgba(25, 57, 96, 0.6)
        );
}


.player-box {
    min-height: 67px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 8px;

    border:
        1px solid
        rgba(151, 209, 249, 0.12);

    border-radius: 10px;

    background:
        rgba(49, 100, 151, 0.35);
}


.player-symbol {
    width: 39px;
    height: 39px;

    flex: 0 0 39px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 18px;

    font-weight: 950;
}


.x-player .player-symbol {
    color: #4be0ff;

    border:
        1px solid
        rgba(61, 220, 255, 0.35);

    background:
        rgba(29, 157, 196, 0.18);

    text-shadow:
        0 0 10px
        rgba(61, 220, 255, 0.55);
}


.o-player .player-symbol {
    color: #f584d5;

    border:
        1px solid
        rgba(245, 132, 213, 0.35);

    background:
        rgba(203, 72, 163, 0.15);

    text-shadow:
        0 0 10px
        rgba(245, 132, 213, 0.55);
}


.player-name {
    margin-bottom: 3px;

    color: #eff7ff;

    font-size: 10px;

    font-weight: 900;
}


.score-label {
    color: #91acc5;

    font-size: 7px;
}


.score-label span {
    color: #e2f2ff;

    font-weight: 900;
}


/* =========================================================
   TURN
========================================================= */

.turn-box {
    min-height: 96px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 8px;

    border:
        1px solid
        rgba(143, 202, 247, 0.13);

    border-radius: 10px;

    background:
        rgba(25, 63, 104, 0.4);
}


#turnText {
    max-width: 100%;

    text-align: center;

    color: #b5cbe0;

    font-size: 7px;

    font-weight: 800;
}


.timer-circle {
    width: 57px;
    height: 57px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    border:
        2px solid
        rgba(67, 220, 255, 0.35);

    border-radius: 50%;

    background:
        rgba(34, 159, 205, 0.1);
}


.timer-circle span {
    color: #e9faff;

    font-size: 18px;

    line-height: 1;

    font-weight: 950;
}


.timer-circle small {
    margin-top: 3px;

    color: #7fa4c3;

    font-size: 5px;

    letter-spacing: 1px;
}


.side-tip {
    margin-top: auto;

    display: flex;

    align-items: flex-start;

    gap: 7px;

    padding: 9px;

    border:
        1px solid
        rgba(147, 205, 247, 0.12);

    border-radius: 10px;

    background:
        rgba(35, 79, 124, 0.4);
}


.side-tip p {
    color: #8da9c1;

    font-size: 7px;

    line-height: 1.5;
}


/* =========================================================
   BOARD
========================================================= */

.board-area {
    min-width: 0;
    min-height: 0;

    display: flex;

    flex-direction: column;
}


.board-topbar {
    height: 27px;

    flex: 0 0 27px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        0 3px;

    color: #89a9c4;

    font-size: 6px;

    font-weight: 900;

    letter-spacing: 1px;
}


.board-topbar > div:first-child {
    display: flex;

    align-items: center;

    gap: 5px;
}


.board-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #36e47e;

    box-shadow:
        0 0 8px
        rgba(54, 228, 126, 0.7);
}


.board-scroll {
    flex: 1;

    min-width: 0;
    min-height: 0;

    width: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 2px;

    overflow: hidden;

    border-radius: 17px;
}


.board {
    --cell-size: 30px;
    --board-size: 20;

    width:
        calc(
            var(--cell-size) *
            var(--board-size)
        );

    height:
        calc(
            var(--cell-size) *
            var(--board-size)
        );

    flex: 0 0 auto;

    display: grid;

    grid-template-columns:
        repeat(
            var(--board-size),
            var(--cell-size)
        );

    grid-template-rows:
        repeat(
            var(--board-size),
            var(--cell-size)
        );

    overflow: hidden;

    border:
        2px solid
        rgba(78, 55, 28, 0.65);

    border-radius: 5px;

    background: #d2ad6c;

    box-shadow:
        0 25px 60px
        rgba(2, 17, 33, 0.45);

        touch-action: none;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;

    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   CELLS
========================================================= */

.cell {
    width: var(--cell-size);
    height: var(--cell-size);

    min-width: 0;
    min-height: 0;

    padding: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-right:
        1px solid
        rgba(78, 56, 28, 0.42);

    border-bottom:
        1px solid
        rgba(78, 56, 28, 0.42);

    background: #d8b878;

    color: transparent;

    font-size:
        calc(
            var(--cell-size) * 0.62
        );

    font-weight: 950;

    line-height: 1;

    touch-action: none;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;

    -webkit-tap-highlight-color: transparent;

    -webkit-appearance: none;
    appearance: none;
}


.cell:hover {
    background: #e2c282;
}

@media (hover: none) and (pointer: coarse) {
    .cell:hover {
        background: #d8b878;
    }
}

.cell.x {
    color: #087e9b;
}


.cell.o {
    color: #ad2f66;
}


.cell.last-move {
    background: #ebcd91;
}


/* =========================================================
   BOARD BOTTOM
========================================================= */

.board-bottom-info {
    height: 20px;

    flex: 0 0 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #7898b4;

    font-size: 5px;

    letter-spacing: 1px;
}


/* =========================================================
   RIGHT GAME SIDE
========================================================= */

.side-card {
    padding: 10px;

    border:
        1px solid
        rgba(145, 204, 249, 0.16);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(38, 82, 128, 0.62),
            rgba(25, 59, 97, 0.62)
        );
}


.stat-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    padding: 7px 0;

    border-bottom:
        1px solid
        rgba(167, 214, 245, 0.1);
}


.stat-item:last-child {
    border-bottom: 0;
}


.stat-item span {
    color: #89a6c0;

    font-size: 6px;
}


.stat-item strong {
    color: #bdf3ff;

    font-size: 6px;
}


.quick-rules {
    flex: 1;
}


.target-line {
    display: flex;

    align-items: flex-start;

    gap: 7px;

    margin-top: 8px;
}


.target-line > span {
    width: 24px;
    height: 24px;

    flex: 0 0 24px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 7px;

    font-size: 9px;

    font-weight: 950;
}


.target-x {
    color: #4ce0ff;

    background:
        rgba(44, 204, 239, 0.13);
}


.target-o {
    color: #f684d6;

    background:
        rgba(224, 84, 177, 0.13);
}


.target-line p {
    color: #8faac2;

    font-size: 6px;

    line-height: 1.5;
}


.online-controls {
    display: flex;

    flex-direction: column;

    gap: 6px;
}


.action-btn {
    width: 100%;

    min-height: 35px;

    padding: 7px 9px;

    border:
        1px solid
        rgba(148, 204, 246, 0.17);

    border-radius: 9px;

    color: #b9d2e7;

    background:
        rgba(45, 90, 137, 0.55);

    font-size: 7px;

    font-weight: 850;
}


/* =========================================================
   RESULT
========================================================= */

.result-box {
    position: absolute;

    z-index: 100;

    top: 50%;
    left: 50%;

    transform:
        translate(-50%, -50%);

    width: min(
        390px,
        calc(100vw - 30px)
    );

    padding: 19px;

    border:
        1px solid
        rgba(88, 221, 255, 0.3);

    border-radius: 17px;

    text-align: center;

    background:
        rgba(22, 58, 93, 0.96);

    box-shadow:
        0 30px 80px
        rgba(2, 17, 34, 0.5);

    backdrop-filter:
        blur(16px);
}


.result-text {
    margin-bottom: 14px;

    color: white;

    font-size: 20px;

    font-weight: 950;
}


.result-buttons {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}


.result-btn {
    min-height: 40px;

    border-radius: 10px;

    font-size: 9px;

    font-weight: 850;
}


.play-again-btn {
    color: #07364a;

    background: #70e6f5;
}


.exit-menu-btn {
    color: #dcecff;

    background:
        rgba(90, 135, 177, 0.45);

    border:
        1px solid
        rgba(160, 212, 249, 0.18);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 930px) {

    .menu-card {
        width:
            calc(100vw - 20px);

        min-height:
            calc(100dvh - 20px);

        padding:
            50px 17px 13px;
    }


    .menu-grid {
        grid-template-columns:
            minmax(175px, 0.8fr)
            minmax(300px, 1.2fr);
    }


    .menu-right {
        display: none;
    }


    .game-area {
        grid-template-columns:
            140px
            minmax(0, 1fr);
    }


    .game-side-right {
        display: none;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .menu-screen {
        align-items: flex-start;

        padding: 8px;
    }


    .menu-card {
        width: 100%;

        min-height:
            calc(100dvh - 16px);

        border-radius: 20px;

        padding:
            48px 12px 10px;
    }


    .menu-grid {
        grid-template-columns: 1fr;

        gap: 11px;
    }


    .menu-left {
        display: grid;

        grid-template-columns:
            1fr 100px;

        align-items: center;

        gap: 9px;
    }


    .feature-list {
        display: none;
    }


    .mini-board {
        width: 100px;
        height: 100px;
    }


    .brand-block h1 {
        font-size: 34px;
    }


    .logo {
        font-size: 43px;
    }


    .subtitle {
        font-size: 9px;
    }


    .menu-center {
        padding: 0;
    }


    .panel-title {
        margin-bottom: 9px;
    }


    .game-header {
        height: 42px;

        flex-basis: 42px;
    }


    .game-header-right {
        display: none;
    }


    .game-area {
        grid-template-columns: 1fr;

        grid-template-rows:
            auto
            minmax(0, 1fr);

        gap: 4px;
    }


    .side-heading {
        display: none;
    }


    .info-panel {
        display: grid;

        grid-template-columns:
            1fr
            auto
            1fr;

        gap: 4px;

        padding: 4px;

        border-radius: 10px;
    }


    .player-box {
        min-height: 45px;

        padding: 4px;
    }


    .player-symbol {
        width: 29px;
        height: 29px;

        flex-basis: 29px;

        font-size: 12px;
    }


    .player-name {
        font-size: 7px;
    }


    .score-label {
        font-size: 6px;
    }


    .turn-box {
        min-height: 45px;

        flex-direction: row;

        gap: 5px;

        padding: 4px 6px;
    }


    #turnText {
        max-width: 65px;

        font-size: 6px;
    }


    .timer-circle {
        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }


    .timer-circle span {
        font-size: 11px;
    }


    .timer-circle small {
        display: none;
    }


    .side-tip {
        display: none;
    }


    .board-topbar {
        height: 18px;

        flex-basis: 18px;

        font-size: 5px;
    }


    .board-bottom-info {
        height: 13px;

        flex-basis: 13px;

        font-size: 4px;
    }


    .online-notice {
        top: 45px;

        font-size: 7px;

        padding: 6px 9px;
    }
}


/* =========================================================
   SMALL PHONE
========================================================= */

@media (max-width: 500px) {

    .menu-left {
        grid-template-columns:
            1fr 82px;
    }


    .mini-board {
        width: 82px;
        height: 82px;
    }


    .brand-block h1 {
        font-size: 29px;
    }


    .logo {
        font-size: 35px;
    }


    .brand-line {
        font-size: 6px;
    }


    .subtitle {
        font-size: 8px;
    }


    .mode-btn {
        min-height: 52px;

        padding: 6px;
    }


    .mode-icon {
        width: 27px;
        height: 27px;

        flex-basis: 27px;
    }


    .mode-btn strong {
        font-size: 8px;
    }


    .mode-btn small {
        font-size: 6px;
    }


    .difficulty-title {
        font-size: 9px;
    }


    .difficulty-title small {
        font-size: 5.5px;
    }


    .main-btn {
        height: 45px;

        font-size: 12px;
    }


    .online-btn {
        min-height: 38px;
    }


    .join-row {
        grid-template-columns:
            minmax(0, 1fr)
            86px;
    }


    .room-input-wrap,
    #joinRoomButton {
        height: 38px;

        min-height: 38px;
    }


    .game-header .small-btn {
        min-height: 29px;

        padding:
            5px 8px;

        font-size: 8px;
    }


    .game-title-icon {
        width: 27px;
        height: 27px;

        flex-basis: 27px;

        font-size: 8px;
    }


    .game-title strong {
        font-size: 10px;
    }


    .game-title span {
        max-width: 42vw;

        font-size: 5px;
    }


    .board-scroll {
        padding: 1px;
    }


    .board {
        border-width: 1px;
    }


    .result-buttons {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   VERY SMALL
========================================================= */

@media (max-width: 380px) {

    .menu-card {
        padding:
            44px 8px 8px;
    }


    .menu-left {
        grid-template-columns:
            1fr 70px;
    }


    .mini-board {
        width: 70px;
        height: 70px;
    }


    .brand-block h1 {
        font-size: 25px;
    }


    .logo {
        font-size: 30px;
    }


    .subtitle {
        font-size: 7px;
    }


    .mode-btn {
        min-height: 49px;

        padding: 5px;
    }


    .mode-icon {
        width: 24px;
        height: 24px;

        flex-basis: 24px;
    }


    .mode-btn strong {
        font-size: 7px;
    }


    .join-row {
        grid-template-columns:
            minmax(0, 1fr)
            78px;
    }


    .player-box {
        min-height: 40px;
    }


    .player-symbol {
        width: 25px;
        height: 25px;

        flex-basis: 25px;
    }


    .turn-box {
        min-height: 40px;
    }


    .timer-circle {
        width: 31px;
        height: 31px;

        flex-basis: 31px;
    }


    .timer-circle span {
        font-size: 10px;
    }
}


/* =========================================================
   LANDSCAPE PHONE
========================================================= */

@media (
    max-height: 520px
) and (
    orientation: landscape
) {

    .menu-screen {
        align-items: flex-start;

        overflow-y: auto;
    }


    .menu-card {
        min-height: auto;

        margin: 7px 0;
    }


    .menu-grid {
        grid-template-columns:
            170px
            minmax(280px, 1fr)
            170px;
    }


    .menu-right {
        display: flex;
    }


    .mini-board {
        width: 80px;
        height: 80px;
    }


    .feature-list {
        display: none;
    }


    .game-header {
        height: 36px;

        flex-basis: 36px;
    }


    .info-panel {
        display: grid;

        grid-template-columns:
            1fr
            auto
            1fr;

        padding: 3px;
    }


    .player-box {
        min-height: 35px;

        padding: 3px;
    }


    .player-symbol {
        width: 25px;
        height: 25px;

        flex-basis: 25px;
    }


    .turn-box {
        min-height: 35px;

        flex-direction: row;
    }


    .timer-circle {
        width: 29px;
        height: 29px;

        flex-basis: 29px;
    }


    .side-tip {
        display: none;
    }
}
.creator-tag {
    position: fixed;
    right: 12px;
    bottom: 8px;
    z-index: 1000;

    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;

    pointer-events: none;
    user-select: none;
}