:root {
  color-scheme: light;
  font-family: Georgia, 'Times New Roman', serif;
  background:
    radial-gradient(circle at top, rgba(116, 88, 46, 0.55), transparent 38%),
    linear-gradient(180deg, #2d251c 0%, #433322 48%, #241b14 100%);
  color: #f9ecd2;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(151, 110, 57, 0.42), transparent 34%),
    linear-gradient(180deg, #21160f 0%, #3b2a1d 52%, #1d140f 100%);
}

body.game-started {
  overflow: hidden;
}

button,
input,
iframe {
  font: inherit;
}

button,
input,
canvas {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

#auth-root,
#game-shell {
  width: 100%;
  min-height: 100dvh;
}

#game-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

#app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

#app canvas {
  position: absolute;
  inset: 0;
  margin: auto;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.entry-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px 14px 26px;
}

.entry-card {
  position: relative;
  width: min(100%, 520px);
  padding: 20px 16px 18px;
  border-radius: 28px;
  border: 1px solid rgba(231, 196, 144, 0.32);
  background:
    linear-gradient(180deg, rgba(92, 59, 33, 0.96) 0%, rgba(45, 28, 17, 0.96) 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.entry-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 18px;
  border: 1px solid rgba(245, 216, 174, 0.16);
  pointer-events: none;
}

.entry-card-loading {
  text-align: center;
}

.entry-kicker {
  position: relative;
  z-index: 1;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #dcb980;
}

.entry-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(36px, 7vw, 52px);
  line-height: 1.02;
  color: #fff2d2;
}

.entry-lead {
  position: relative;
  z-index: 1;
  margin: 10px 0 14px;
  font-size: 15px;
  line-height: 1.58;
  color: #f0dfbf;
}

.entry-form {
  display: grid;
  gap: 8px;
}

.auth-panel {
  display: grid;
  gap: 8px;
}

.auth-panel-register .entry-form {
  gap: 6px;
}

.auth-panel-register .entry-field {
  gap: 3px;
}

.auth-panel-register .entry-note-highlight {
  margin: 0;
  padding: 8px 10px;
}

.auth-panel-register .entry-checkbox {
  margin-top: -4px;
}

.entry-field {
  display: grid;
  gap: 6px;
}

.entry-field span {
  font-size: 13px;
  color: #f3dfb7;
}

.entry-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(237, 205, 159, 0.26);
  border-radius: 14px;
  background: rgba(20, 12, 8, 0.52);
  color: #fff4db;
  outline: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.entry-field input::placeholder {
  color: rgba(255, 239, 214, 0.48);
}

.entry-field input:focus {
  border-color: rgba(244, 208, 146, 0.62);
  box-shadow: 0 0 0 3px rgba(228, 177, 92, 0.14);
}

.entry-field-error {
  display: none;
  font-size: 11px;
  line-height: 1.25;
  color: #ffb4a2;
}

.entry-field-error:not(:empty) {
  display: block;
}

.entry-checkbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.55;
  color: #f0dfbf;
}

.entry-checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #d69444;
}

.entry-button,
.entry-link-button {
  border: none;
  border-radius: 18px;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.entry-button {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: bold;
}

.entry-button:hover,
.entry-link-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.entry-button:disabled,
.entry-link-button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  filter: none;
}

.entry-button-primary {
  background: linear-gradient(180deg, #d49a43 0%, #aa6528 100%);
  color: #fff6e7;
}

.entry-button-secondary {
  background: rgba(255, 244, 221, 0.1);
  color: #fff2d2;
  border: 1px solid rgba(236, 208, 159, 0.2);
}

.entry-button-ghost {
  background: rgba(18, 11, 7, 0.36);
  color: #dcb980;
  border: 1px dashed rgba(236, 208, 159, 0.25);
}

.entry-link-button {
  padding: 0;
  background: transparent;
  color: #ffd28d;
  font-size: 13px;
  text-decoration: underline;
}

.entry-status {
  display: none;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(24, 16, 11, 0.55);
  border: 1px solid rgba(236, 208, 159, 0.16);
  color: #f6e2bc;
  font-size: 13px;
  line-height: 1.55;
}

.entry-status.is-visible,
.entry-status:not(:empty) {
  display: block;
}

.entry-status-inline {
  margin: -2px 0 0;
  padding: 8px 10px;
}

.entry-separator {
  margin: 12px 0 10px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 224, 189, 0.54);
}

.entry-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.42;
  color: rgba(247, 230, 199, 0.82);
}

.entry-note-highlight {
  margin: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(214, 148, 68, 0.12);
  color: #ffe2b0;
}

.rules-launcher {
  display: flex;
  justify-content: flex-start;
}

.rules-launcher {
  display: flex;
  justify-content: flex-start;
}

.rules-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

.rules-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 4, 0.4);
}

.rules-modal__card {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  height: min(76dvh, 760px);
  margin: clamp(18px, 6vh, 52px) auto;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, #4b311f 0%, #24160f 100%);
  border: 1px solid rgba(236, 208, 159, 0.22);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  touch-action: auto;
}

.rules-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #fff2d2;
}

.rules-modal iframe {
  display: block;
  width: 100%;
  height: calc(100% - 34px);
  border: 0;
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 540px) {
  .entry-shell {
    padding: 10px 8px 14px;
  }

  .entry-card {
    padding: 14px 11px 12px;
    border-radius: 18px;
  }

  .entry-title {
    font-size: 32px;
  }

  .entry-lead {
    font-size: 13px;
  }

  .entry-button {
    min-height: 42px;
    font-size: 14px;
  }

  .rules-modal__card {
    width: min(96vw, 720px);
    height: min(80dvh, 760px);
    margin-top: 12px;
    padding: 10px;
  }
}

/* Kod połączenia od obsługi (14.10.2026): przycisk na ekranie startu i okno z polem kodu. */
.kod-obslugi-przycisk {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  padding: 8px 16px;
  border: 1px solid rgba(236, 208, 159, 0.35);
  border-radius: 999px;
  background: rgba(18, 11, 7, 0.82);
  color: #ffd28d;
  font: 13px Georgia, 'Times New Roman', serif;
  cursor: pointer;
}

.kod-obslugi-okno {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 5, 4, 0.72);
  backdrop-filter: blur(3px);
}

.kod-obslugi-okno .entry-card {
  display: grid;
  gap: 10px;
}
