:root {
  --bg: #101415;
  --panel: #181f20;
  --panel-2: #20292a;
  --line: #334044;
  --text: #f4f0e8;
  --muted: #b9c0bd;
  --accent: #5dd39e;
  --accent-2: #ffd166;
  --danger: #ff6b6b;
  --cell: 36px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 46px;
  background:
    radial-gradient(circle at 20% 10%, rgba(93, 211, 158, .16), transparent 28rem),
    radial-gradient(circle at 85% 0%, rgba(255, 209, 102, .12), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.home-link {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.game-shell {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 12px;
  background: #0b0f10;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .38);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.start-overlay,
.game-over {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  background: rgba(11, 15, 16, .76);
  backdrop-filter: blur(4px);
}

.start-panel {
  width: min(320px, calc(100% - 28px));
  padding: 22px;
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.start-panel h2 {
  font-size: 26px;
}

.hidden {
  display: none !important;
}

.game-over-panel {
  width: min(310px, calc(100% - 28px));
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.game-over-panel h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.game-over-panel p {
  color: var(--accent-2);
  font-weight: 800;
  font-size: 28px;
}

.game-over-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.panel-block {
  padding: 16px;
  background: rgba(24, 31, 32, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label,
.stats span {
  color: var(--muted);
  font-size: 13px;
}

input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: #0d1213;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.primary-btn,
.ghost-btn,
.ghost-link {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  white-space: nowrap;
}

.primary-btn {
  color: #0b1410;
  background: var(--accent);
}

.ghost-btn,
.ghost-link {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

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

.stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stats strong {
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.next-piece canvas {
  display: block;
  margin: 12px auto 0;
  background: #0d1213;
  border-radius: 6px;
}

.legend #legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  background: #0d1213;
  border-radius: 6px;
}

.logo-dot {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #081011;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
}

.logo-dot img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.logo-dot canvas {
  width: 28px;
  height: 28px;
  display: block;
}

.bomb-dot {
  overflow: visible;
}

.legend-item span {
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.leaderboard ol {
  counter-reset: leaderboard;
  margin: 12px 0 0;
  padding: 0 6px 0 0;
  max-height: 278px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #0d1213;
}

.leaderboard ol::-webkit-scrollbar {
  width: 10px;
}

.leaderboard ol::-webkit-scrollbar-track {
  background: #0d1213;
  border: 1px solid rgba(51, 64, 68, .8);
  border-radius: 999px;
}

.leaderboard ol::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), #3ba979);
  border: 2px solid #0d1213;
  border-radius: 999px;
}

.leaderboard ol::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.leaderboard li {
  counter-increment: leaderboard;
  min-height: 40px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  color: var(--muted);
  background: #0d1213;
  border: 1px solid rgba(51, 64, 68, .72);
  border-radius: 6px;
}

.leaderboard li::marker {
  content: "";
}

.leaderboard .leader-empty {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.rank-badge {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.top-rank .rank-badge {
  position: relative;
  background: transparent;
  border: 0;
}

.top-rank .rank-badge::before {
  content: "";
  width: 24px;
  height: 20px;
  display: block;
  background: currentColor;
  clip-path: polygon(8% 38%, 24% 52%, 33% 12%, 50% 45%, 67% 12%, 76% 52%, 92% 38%, 84% 88%, 16% 88%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .42));
}

.rank-1 .rank-badge {
  color: #ffd166;
}

.rank-2 .rank-badge {
  color: #d7dee5;
}

.rank-3 .rank-badge {
  color: #c98a4a;
}

.leader-player {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.leaderboard b {
  color: var(--text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 24px));
  padding: 12px 14px;
  color: #0b1410;
  background: var(--accent-2);
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .35);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(11, 15, 16, .94);
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.game-info {
  grid-column: 1 / -1;
  padding: 22px;
  background: rgba(24, 31, 32, .74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.game-info h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.game-info p {
  max-width: 920px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 430px) {
  .app {
    width: calc(100vw - 16px);
    padding: 12px 0;
  }

  .topbar {
    display: grid;
  }

  .stats strong {
    font-size: 20px;
  }
}


#language-selector {
    display: flex;
    margin: 0;
}

#language {
    display: flex;
    border-radius: 5px;
    border: 1px solid #333;
    height: 34px;
    background-color: #242424;
    color: #fff;
    font-size: 18px;
}

        #cookie-banner {
            display: none;
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.9);
            color: #fff;
            padding: 20px;
            text-align: center;
            border-radius: 8px;
            width: 95%;
            max-width: 800px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
            z-index: 9999;
            font-family: Arial, sans-serif;
        }
        #cookie-banner button {
            margin: 10px;
            padding: 10px 20px;
            border: none;
            cursor: pointer;
            font-size: 14px;
            border-radius: 10px;
            transition: background 0.3s ease;
        }
        .accept {
            background: #28a745;
            color: white;
        }
        .accept:hover {
            background: #218838;
        }
        .managesettings {
            text-decoration: underline;
            color: white;
            cursor: pointer;
        }
        
     
    #cookie-settings {
        display: none;
        text-align: left;
        margin-left: 30px;
    } 
        
    #labelh3 {
        margin-bottom: 15px;
        font-size: 18px;
        color: white;
    }

    .cookie-label {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        color: #fff;
        cursor: pointer;
        margin: 10px 0;
    }

    input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: #fff;
        cursor: pointer;
    }

.ads-slot {
    margin-top: 20px;
    margin-bottom: 20px;
}    
    
.customads {
    width: 728px;
    height: 90px;
    padding: 0px;
}

@media (max-width: 767px) {
    .customads {
        width: 300px;
        height: 250px;
        padding: 0px;
    }
}    
