@font-face {
  font-family: "Rubik";
  src: url("/font/Rubik.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Rubik-Bold";
  src: url("/font/Rubik-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

/* === LAYOUT & ELEMENTS === */

body {
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  margin: auto;
  padding: 20px;
  max-width: var(--width);
  text-align: left;
  background-color: var(--background-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  color: var(--text-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-main);
  color: var(--heading-color);
}

a {
  color: var(--link-color);
  cursor: pointer;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  background-color: var(--link-color);
  color: var(--background-color);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

nav a,
nav span.active {
  margin-right: 8px;
}

nav span.active {
  font-family: "Rubik-Bold";
  margin-right: 8px;
}

.lang-flag {
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.lang-flag-pl {
  width: 24px;
}

.lang-flag-en {
  width: 24px;
}

strong,
b {
  color: var(--heading-color);
}

li {
  list-style-position: outside;
  padding-left: 5px;
}

ul ul {
  list-style-position: inside;
  padding-left: 25px;
}

ul>li::marker {
  content: '»';
  color: var(--link-color);
}

ul ul>li::marker {
  content: '›';
  color: var(--link-color);
}

input,
textarea,
select,
button {
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  color: var(--text-color);
  background-color: var(--background-color);
  border: 2px solid var(--code-border-color);
  padding: 6px 8px;
  outline: none;
  box-sizing: border-box;
  margin: 1.5px;
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--link-color);
}

input::placeholder,
textarea::placeholder {
  color: #999;
  opacity: 1;
}

input[disabled],
textarea[disabled],
select[disabled],
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:hover {
  border-color: var(--link-color);
  box-shadow: 2px 1px 5px var(--link-color);
  background-color: var(--background-color);
}

button:active {
  background-color: var(--code-background-color);
  transform: translateY(1px);
}

input[type="checkbox"] {
  width:20px;height:20px;border:2px solid var(--link-color);
  background:var(--background-color);appearance:none;cursor:pointer;vertical-align:middle;position:relative;
}
input[type="checkbox"]:active{transform:translateY(1px);}
input[type="checkbox"]:checked{background:var(--link-color);}
input[type="checkbox"]:checked::after{
  content:'';position:absolute;top:40%;left:50%;width:5px;height:10px;
  border:solid var(--background-color);border-width:0 2px 2px 0;transform:translate(-50%,-50%) rotate(45deg);
}

main {
  line-height: 1.6;
}

hr {
  border: 0;
  border-top: 1px #444 solid;
}

img {
  max-width: 100%;
}

/* Kod */
pre code {
  background-color: var(--code-background-color);
  color: var(--code-color);
  display: block;
  padding: 20px;
  border: 1px solid var(--code-border-color);
  white-space: pre-wrap;
  font-size: .875rem;
  overflow-x: auto;
}

code {
  font-family: monospace;
  padding: 2px;
  background-color: var(--code-background-color);
  color: var(--code-color);
}

blockquote {
  border-left: 1px solid #999;
  color: var(--code-color);
  margin-left: 10px;
  padding-left: 10px;
  font-style: italic;
}

footer {
  padding: 25px 0;
  font-size: 14px;
  text-align: center;
}

.title:hover {
  text-decoration: none;
}

.title h1 {
  text-decoration: none;
  font-size: 1.5em;
}

.inline {
  width: auto !important;
}

.highlight,
.code {
  padding: 1px 15px;
  background-color: var(--code-background-color);
  color: var(--code-color);
  border-radius: 3px;
  margin-block: 1em;
  overflow-x: auto;
}

/* Blog */
ul.blog-posts {
  list-style: none;
  padding: 0;
}

ul.blog-posts li {
  display: flex;
}

ul.blog-posts li span {
  flex: 0 0 110px;
}

ul.blog-posts li a:visited {
  color: var(--visited-color);
}

ul.blog-posts li a:visited:hover {
  color: var(--background-color);
}

/* Tabele */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: monospace;
  border: 1px solid var(--table-border-color);
  font-size: .875rem;
  overflow: hidden;
  background-color: var(--table-background-color);
}

th,
td {
  border: 1px solid var(--table-cell-border);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-color);
}

th {
  background-color: var(--table-header-background);
  color: var(--heading-color);
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: var(--table-row-even-background);
}

tr:nth-child(odd) {
  background-color: var(--table-row-odd-background);
}

/* Dodatki */
.tags {
  font-size: smaller;
}

/* Game container */
#game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4/3;
  margin: auto;
}

#game-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.search-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 20px;
}

.search-wrapper input {
  flex: 1;
  min-width: 200px;
}

.search-wrapper button,
.search-wrapper select {
  height: 38px;
  /* Matching the input height roughly */
}

.game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  padding: 5px;
  background: var(--background-color);
  text-decoration: none;
}

.game-item:hover span {
  color: var(--background-color);
}

.game-item img {
  opacity: 0;

  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.game-item img.loaded {
  opacity: 1;
}

.game-item span {
  color: var(--heading-color);
  font-size: 16px;
}

@media (max-width: 768px) {
  .game-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.right-side {
  display: flex;
  align-items: center;
}

.header-bar .title h1 {
  margin: 0;
}

@media (max-width: 640px) {
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.message {
  color: var(--text-color);
  padding: 6px 10px;
}

.username {
  color: var(--text-color);
  font-weight: bold;
}

#message_input {
  color: var(--text-color) !important;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 5px 10px;
  width: calc(100% - 20px);
}

.banner-img {
  border: 2px dashed var(--link-color);
}