/* Game 9 — light/dark theme (dark palette aligned with mobile ui_p.css) */

/* ── Theme toggle (landscape toolbar) ───────────────────────── */
@media (orientation: landscape) {
  .col1-exit-row {
    padding: 2px 4px !important;
    height: auto !important;
    min-height: 28px;
  }
  .col1-exit-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .col1-exit-inner #exit {
    margin: 0 !important;
    flex-shrink: 0;
  }
  #col1 {
    min-width: 152px;
    width: 152px;
  }
  .theme-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #979797;
    background: linear-gradient(180deg, #fcfcfc 0%, #e8e8e8 100%);
    cursor: pointer;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e4e4e;
  }
  .theme-toggle:hover {
    opacity: 0.88;
  }
  .theme-toggle .theme-toggle__moon {
    display: inline;
  }
  .theme-toggle .theme-toggle__sun {
    display: none;
  }

  html[data-theme="dark"] .theme-toggle {
    border-color: #3c97c6;
    background: linear-gradient(180deg, #2a3544 0%, #1e2833 100%);
    color: #fbbf24;
  }
  html[data-theme="dark"] .theme-toggle .theme-toggle__moon {
    display: none;
  }
  html[data-theme="dark"] .theme-toggle .theme-toggle__sun {
    display: inline;
  }
}

/* ── Dark theme (landscape / desktop UI only) ─────────────── */
@media (orientation: landscape) {
  html[data-theme="dark"] body {
    background: #1a2330;
    color: #e2e8f0;
  }

  html[data-theme="dark"] .grm {
    background: #2a3544;
    background: linear-gradient(180deg, #323f50 0%, #26313d 100%);
    filter: none;
  }
  html[data-theme="dark"] .gr {
    background: #2d3a4a;
    background: linear-gradient(180deg, #35445a 0%, #26313d 100%);
    filter: none;
  }
  html[data-theme="dark"] .ggrad {
    background: linear-gradient(180deg, #323f50 0%, #283440 100%);
    filter: none;
  }
  html[data-theme="dark"] .grgrad {
    background: linear-gradient(180deg, #6ba32a 0%, #4e8a18 100%);
    filter: none;
  }
  html[data-theme="dark"] .bb,
  html[data-theme="dark"] .bl {
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] .container {
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] .t18AC {
    color: #94a3b8;
  }
  html[data-theme="dark"] #nick {
    color: #7ed321;
  }
  html[data-theme="dark"] #total_users {
    color: #cbd5e1;
  }

  html[data-theme="dark"] .ico1,
  html[data-theme="dark"] .ico2,
  html[data-theme="dark"] .ico3,
  html[data-theme="dark"] .ico4,
  html[data-theme="dark"] .ico5,
  html[data-theme="dark"] .ico6,
  html[data-theme="dark"] .ico7,
  html[data-theme="dark"] .ico8 {
    background-color: #1e2833;
  }
  html[data-theme="dark"] .ibtn {
    border-image: none;
    border: 1px solid #475569;
    background: #2a3544;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  html[data-theme="dark"] #lvl_list {
    color: #94a3b8;
  }
  html[data-theme="dark"] .lvl {
    background: linear-gradient(180deg, #35445a 0%, #2a3544 100%);
    filter: none;
    transition: box-shadow 0.22s ease, background 0.22s ease, opacity 0.22s ease;
  }
  html[data-theme="dark"] #lvl_list .lvl:not(.current) {
    opacity: 0.9;
  }
  html[data-theme="dark"] .lvl.current {
    opacity: 1;
    overflow: hidden;
    background: linear-gradient(
      105deg,
      rgba(60, 151, 198, 0.34) 0%,
      rgba(38, 52, 68, 0.98) 22%,
      #2d3a4c 55%,
      rgba(30, 42, 56, 0.98) 100%
    );
    box-shadow:
      inset 0 0 0 1px rgba(76, 159, 201, 0.5),
      0 0 18px rgba(60, 151, 198, 0.28);
    outline: none;
    position: relative;
    z-index: 2;
    animation: lvl-row-glow-dark 2.6s ease-in-out infinite;
  }
  html[data-theme="dark"] .lvl.current::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #4c9fc9 0%, #7ed321 50%, #4c9fc9 100%);
    background-size: 100% 220%;
    animation: lvl-bar-flow 2.4s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
  }
  html[data-theme="dark"] .lvl.current::after {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -60%;
    width: 40%;
    background: linear-gradient(
      105deg,
      transparent 0%,
      rgba(158, 224, 255, 0.14) 45%,
      transparent 100%
    );
    animation: lvl-active-shine 3.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
  }
  html[data-theme="dark"] .lvl.current > div:nth-child(1) {
    color: #b8ecff;
    text-shadow: 0 0 16px rgba(76, 159, 201, 0.55);
    animation: lvl-num-breathe-dark 2.2s ease-in-out infinite;
    z-index: 2;
  }
  html[data-theme="dark"] .lvl.current > div:nth-child(3) {
    position: relative;
    z-index: 2;
  }
  html[data-theme="dark"] .lvl.current > div:nth-child(4) {
    z-index: 2;
    animation: lvl-star-pulse 2.4s ease-in-out infinite;
  }
  html[data-theme="dark"] .lvl > div:nth-child(1) {
    color: #4c9fc9;
  }
  html[data-theme="dark"] .lvl > div:nth-child(2) {
    color: #cbd5e1;
  }
  html[data-theme="dark"] .lvl > div:nth-child(3) > div {
    color: #94a3b8;
  }
  html[data-theme="dark"] .lvl > div:nth-child(3) > div:nth-child(1) > div {
    color: #e2e8f0;
  }
  html[data-theme="dark"] .lvl_input {
    background-color: #1e2833;
    color: #7ed321;
    border: 1px solid #3c97c6;
  }
  html[data-theme="dark"] .lvl.current .lvl_input {
    border-color: #5eb8e8;
    box-shadow: 0 0 8px rgba(76, 159, 201, 0.28);
  }
  html[data-theme="dark"] .lvl.current > div:nth-child(2) {
    color: #f1f5f9;
  }
  html[data-theme="dark"] .lvl.current > div:nth-child(4) {
    filter: hue-rotate(76deg) saturate(1.4) brightness(1.08);
  }

  @keyframes lvl-row-glow-dark {
    0%, 100% {
      box-shadow:
        inset 0 0 0 1px rgba(76, 159, 201, 0.45),
        0 0 14px rgba(60, 151, 198, 0.22);
    }
    50% {
      box-shadow:
        inset 0 0 0 1px rgba(126, 211, 33, 0.5),
        0 0 22px rgba(126, 211, 33, 0.2);
    }
  }
  @keyframes lvl-num-breathe-dark {
    0%, 100% {
      text-shadow: 0 0 14px rgba(76, 159, 201, 0.5);
      transform: scale(1);
    }
    50% {
      text-shadow: 0 0 20px rgba(126, 211, 33, 0.45);
      transform: scale(1.04);
    }
  }

  html[data-theme="dark"] #lang_switch,
  html[data-theme="dark"] #lang_switch * {
    color: #cbd5e1;
  }
  html[data-theme="dark"] #lang_switch:hover {
    background-color: #2a3544;
  }
  html[data-theme="dark"] #lang_opt {
    background-color: #26313d;
    border: 1px solid #4b9dc6;
  }
  html[data-theme="dark"] #lang_opt > div:hover {
    background-color: #2a3544;
  }
  html[data-theme="dark"] #lang_opt > div:not(:last-child) {
    border-bottom-color: #3c5c7a;
  }

  html[data-theme="dark"] #chat_btn > div {
    color: #64748b;
  }
  html[data-theme="dark"] #chat_btn > .active,
  html[data-theme="dark"] #chat_btn > div:hover {
    color: #7ed321;
  }

  html[data-theme="dark"] #chat_loader {
    background: rgba(26, 35, 48, 0.72);
  }
  html[data-theme="dark"] #chat > div {
    background: linear-gradient(180deg, #2d3a4a 0%, #26313d 100%);
    border-color: #4b9dc6;
    filter: none;
  }
  html[data-theme="dark"] #chat > div > div:nth-child(1) {
    color: #64748b;
  }
  html[data-theme="dark"] #chat > div > div:nth-child(2) {
    color: #e2e8f0;
  }
  html[data-theme="dark"] #chat > div > div:nth-child(2) > div {
    color: #94a3b8;
  }

  html[data-theme="dark"] #say_chat {
    color: #e2e8f0;
    border-left-color: #3c97c6;
    background: #1e2833;
  }
  html[data-theme="dark"] #chat_talk > div:first-child {
    background-color: #1e2833;
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] #terms > a {
    color: #64748b;
  }

  html[data-theme="dark"] #money_block {
    border-color: #4b9dc6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    background: #26313d;
  }
  html[data-theme="dark"] #money_block > div:nth-child(2) > div:first-child {
    color: #4c9fc9;
    border-color: #4b9dc6;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
    background: #1e2833;
  }
  html[data-theme="dark"] #money_block > div:nth-child(2) > div:not(#money) {
    color: #94a3b8;
  }
  html[data-theme="dark"] #money_block > div > div:last-child {
    color: #7ed321;
  }
  html[data-theme="dark"] #balance_mark {
    color: #94a3b8;
  }
  html[data-theme="dark"] #delta_bal {
    color: #94a3b8;
  }

  html[data-theme="dark"] #bet_lvl_tag {
    color: #7ed321;
  }

  html[data-theme="dark"] #current_game,
  html[data-theme="dark"] #game_win_panel {
    background: #26313d;
    background: linear-gradient(180deg, #2d3a4a 0%, #26313d 100%);
    filter: none;
    border-color: #4b9dc6;
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(75, 157, 198, 0.2);
  }
  html[data-theme="dark"] #bet_lvl_val,
  html[data-theme="dark"] #win_last > div {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(75, 157, 198, 0.4);
    color: #e2e8f0;
    box-shadow:
      inset 0 1px 2px rgba(0, 0, 0, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  html[data-theme="dark"] #win_last > div.gtxt {
    color: #86efac;
    font-weight: 800;
    font-size: 18px;
    text-shadow:
      0 0 14px rgba(126, 211, 33, 0.75),
      0 0 26px rgba(126, 211, 33, 0.35);
  }
  html[data-theme="dark"] #win_last > div.rtxt {
    color: #fca5a5;
    font-weight: 800;
    font-size: 18px;
    text-shadow:
      0 0 14px rgba(248, 113, 113, 0.75),
      0 0 24px rgba(248, 113, 113, 0.35);
  }

  html[data-theme="dark"] .progress {
    color: #94a3b8;
  }
  html[data-theme="dark"] .progress > div:nth-child(2) {
    color: #e2e8f0;
  }

  html[data-theme="dark"] #pole > div,
  html[data-theme="dark"] #op_cancel,
  html[data-theme="dark"] #op_send,
  html[data-theme="dark"] #current_game_history,
  html[data-theme="dark"] #wn_cont,
  html[data-theme="dark"] #gmt_time,
  html[data-theme="dark"] #pers_container,
  html[data-theme="dark"] #pers_chart,
  html[data-theme="dark"] #pers_history {
    background: #26313d;
    background: linear-gradient(180deg, #2d3a4a 0%, #26313d 100%);
    filter: none;
    border-color: #3c97c6;
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(75, 157, 198, 0.25);
  }

  html[data-theme="dark"] div#pole:not(.dark) > div {
    color: #4c9fc9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
  }
  html[data-theme="dark"] div#pole.dark > div {
    color: #64748b;
  }

  html[data-theme="dark"] #cgh_scroll_top,
  html[data-theme="dark"] #cgh_scroll_down,
  html[data-theme="dark"] #ph_scroll_l,
  html[data-theme="dark"] #ph_scroll_r {
    background-color: #2a3544;
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] #cgh_scroll_top,
  html[data-theme="dark"] #ph_scroll_l {
    border-bottom-color: #26313d;
  }
  html[data-theme="dark"] #cgh_scroll_down,
  html[data-theme="dark"] #ph_scroll_r {
    border-top-color: #26313d;
  }
  html[data-theme="dark"] #cgh_scroll_top:hover,
  html[data-theme="dark"] #cgh_scroll_down:hover,
  html[data-theme="dark"] #ph_scroll_l:hover,
  html[data-theme="dark"] #ph_scroll_r:hover {
    background-color: #35445a;
  }

  html[data-theme="dark"] #cgh_data > div:nth-child(2n+1) {
    background-color: #2a3544;
  }
  html[data-theme="dark"] #cgh_data > div > div {
    color: #e2e8f0;
  }
  html[data-theme="dark"] #cgh_data > div:hover,
  html[data-theme="dark"] #cgh_data > div.selected {
    border-color: #7ed321;
  }
  html[data-theme="dark"] #cgh_head > div,
  html[data-theme="dark"] #ph_h > div.ph-hdr {
    color: #94c9e8;
  }
  html[data-theme="dark"] #ph_h {
    background: transparent;
    border: none;
  }
  html[data-theme="dark"] #ph_h > div.ph-hdr.ph-ledger {
    color: #94c9e8;
  }
  html[data-theme="dark"] #ph_h > div.ph-hdr.ph-balance {
    color: #e2eef4;
  }
  html[data-theme="dark"] #ph_h > div.ph-sec-end,
  html[data-theme="dark"] #ph_data > div > div.ph-sec-end {
    border-right-color: #4b9dc6;
  }
  html[data-theme="dark"] #cgh_scroll_top {
    border-bottom: 3px solid #26313d;
  }
  html[data-theme="dark"] #cgh_scroll_down {
    border-top: 3px solid #26313d;
  }

  html[data-theme="dark"] #wn_cont {
    background-color: #26313d;
  }
  html[data-theme="dark"] #win_num {
    color: #f1f5f9;
    text-shadow:
      -1px -1px 0 #3c97c6,
      1px -1px 0 #3c97c6,
      -1px 1px 0 #3c97c6,
      1px 1px 0 #3c97c6;
    -webkit-text-stroke: 1px #3c97c6;
  }
  html[data-theme="dark"] .ang1,
  html[data-theme="dark"] .ang2,
  html[data-theme="dark"] .ang3,
  html[data-theme="dark"] .ang4 {
    background-color: #2a3544;
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] .ang1 > div,
  html[data-theme="dark"] .ang2 > div,
  html[data-theme="dark"] .ang3 > div,
  html[data-theme="dark"] .ang4 > div {
    background-color: #26313d;
  }

  html[data-theme="dark"] #gmt_time > div {
    border-color: #4b9dc6;
    color: #94a3b8;
  }
  html[data-theme="dark"] #gmt_time > div:first-child {
    color: #4c9fc9;
  }
  html[data-theme="dark"] .g_txt {
    color: #7ed321;
  }

  html[data-theme="dark"] #pers_container > div:nth-child(1) {
    border-color: #4b9dc6;
  }
  html[data-theme="dark"] #pers_container > div:nth-child(2) > div:nth-child(1) {
    background-color: rgba(26, 35, 48, 0.92);
  }
  html[data-theme="dark"] #ph_data > div:nth-child(2n+1) > div:not(.empty) {
    background-color: #2a3544;
  }
  html[data-theme="dark"] #ph_data > div:nth-child(2n) > div:not(.empty) {
    background-color: #26313d;
  }
  html[data-theme="dark"] #ph_data > div > div {
    color: #e2e8f0;
  }

  html[data-theme="dark"] div[pgameid]:hover,
  html[data-theme="dark"] div[pgameid].selected {
    border-color: #7ed321 !important;
  }
  html[data-theme="dark"] .nowin {
    background-color: #1e3a5f;
  }

  html[data-theme="dark"] hr.delim {
    border-bottom-color: #4b9dc6;
  }

  html[data-theme="dark"] #sys_msg {
    color: #e2e8f0;
  }
  html[data-theme="dark"] #sys_msg a {
    color: #38bdf8;
  }
  html[data-theme="dark"] #sys_msg a:hover {
    background-color: #38bdf8;
    color: #0f172a;
  }

  html[data-theme="dark"] #tips > div {
    border-color: #4b9dc6;
    background: #26313d !important;
  }
  html[data-theme="dark"] #tips > div > div {
    color: #e2e8f0;
  }

  html[data-theme="dark"] #frm > div {
    background-color: #26313d;
    border: 1px solid #4b9dc6;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
  html[data-theme="dark"] .frm_head {
    color: #e2e8f0;
    box-shadow: none;
    border-bottom: 1px solid #4b9dc6;
  }
  html[data-theme="dark"] #msg_txt,
  html[data-theme="dark"] #msg_txt * {
    color: #e2e8f0;
  }
  html[data-theme="dark"] #pay_frm,
  html[data-theme="dark"] #outpay_frm {
    border-color: #4b9dc6;
    background: #26313d;
  }
  html[data-theme="dark"] .pf_head {
    color: #e2e8f0;
    border-bottom-color: #4b9dc6;
    background: #2a3544;
  }
  html[data-theme="dark"] .close_pay_frm {
    color: #94a3b8;
  }
  html[data-theme="dark"] .gr_btn {
    color: #e2e8f0;
    border-color: #4b9dc6;
    background: #2a3544;
  }

  html[data-theme="dark"] .b_desc {
    color: #cbd5e1;
    fill: #cbd5e1;
  }
}
