* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
}

body {
  background: #121213;
  font-family: Arial, sans-serif;
  color: #fff;
  min-height: 100vh;
}

body.offline {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

.hidden {
  display: none !important;
}

.icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

.icon-offline {
  content: -webkit-image-set(
    url(assets/default_100_percent/100-error-offline.png) 1x,
    url(assets/default_200_percent/200-error-offline.png) 2x
  );
  display: none;
}

.offline .interstitial-wrapper {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 500px;
  margin: 0 auto;
  padding: 24px 34px 34px;
  background: #1f2023;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  align-self: center;
}

/* VIRŠUS */
.top-actions {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  gap: 16px;
  margin-bottom: 56px;
  position: relative;
  z-index: 30;
}

.top-title {
  margin: 0;
  text-align: center;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 500;
  color: #ffffff;
}

.game-btn {
  appearance: none;
  border: none;
  text-decoration: none;
  background: #2f2f31;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 31;
}

.game-btn:hover {
  transform: translateY(-1px);
  background: #3a3a3c;
}

.back-btn {
  justify-self: start;
}

.share-btn {
  justify-self: end;
  background: #5b9a50;
}

.share-btn:hover {
  background: #5b9a50;
  filter: brightness(1.06);
}

.copy-toast {
  position: absolute;
  top: 82px;
  right: 34px;
  background: #2f2f31;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid #4a4a4d;
  z-index: 50;
}

/* ŽAIDIMO BLOKAS */
#main-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 190px;        
  margin: 0 auto;
  display: block;
}

.offline .runner-container {
  position: absolute;
  top: 120px;
  left: 50%;
  width: 44px;
  height: 150px;
  max-width: 600px;
  transform: translateX(-50%);
  overflow: hidden;
  border-radius: 16px;
  background: #f7f7f7;
}

.offline .runner-canvas {
  position: absolute;
  top: 0;
  left: 0;
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  border-radius: 16px;
  z-index: 2;
}

.offline .controller {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: 5;
  pointer-events: auto;
  touch-action: manipulation;
}

#offline-resources {
  display: none;
}

.sendmessage {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(18, 18, 19, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.sendmessage h1 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.25;
  text-align: center;
}

.snackbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #2f2f31;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transition: 0.25s ease;
  white-space: nowrap;
  z-index: 1000;
}

.snackbar-show {
  opacity: 1;
}

/* išjungiam seną fullscreen stilių */
.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 1;
  overflow: visible;
}

.arcade-mode .interstitial-wrapper {
  height: auto;
  max-width: 760px;
  min-height: 300px;
  overflow: visible;
  background: #1f2023;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  border-radius: 22px;
  padding: 24px 34px 34px;
}

.arcade-mode .runner-container {
  left: 50%;
  right: auto;
  margin: 0;
  transform-origin: top center;
  z-index: 2;
}

@media (max-width: 820px) {
  .offline .interstitial-wrapper {
    max-width: 100%;
    min-height: 470px;
    padding: 22px 22px 28px;
  }

  .top-actions {
    grid-template-columns: 120px 1fr 120px;
    gap: 12px;
    margin-bottom: 24px;
  }

  .top-title {
    font-size: 25px;
  }

  .copy-toast {
    top: 74px;
    right: 22px;
  }
}

@media (max-width: 600px) {
  body.offline {
    padding: 14px 10px;
  }

  .offline .interstitial-wrapper {
    border-radius: 18px;
    padding: 18px 14px 22px;
    min-height: 360px;
  }

  .top-actions {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
  }

  .top-title {
    font-size: 18px;
  }

  .game-btn {
    min-height: 40px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  #main-content {
    height: 160px;
    margin-top: 6px;
  }

  .copy-toast {
    top: 58px;
    right: 14px;
    font-size: 13px;
    padding: 7px 10px;
  }

  .sendmessage h1 {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .top-title {
    font-size: 16px;
  }

  .game-btn {
    font-size: 12px;
    padding: 9px 10px;
  }

  .offline .interstitial-wrapper {
    padding: 16px 10px 18px;
  }
}