.cell {
    border: 1px solid #000; /* Add border to each cell */
    padding: 10px; /* Ensure spacing within the cell */
    box-sizing: border-box; /* Include padding in width/height calculations */
}
.main-frame-error {
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.hidden {
  display: none;
}

#offline-resources {
  display: none;
}

.offline .interstitial-wrapper {
  color: #2b2b2b;
  font-size: 1em;
  line-height: 1.55;
  margin: 100px auto 0;
  max-width: 100%;
  width: 100%;
}

.offline .runner-container {
  height: 150px;
  max-width: 100%;
  overflow: hidden;
  position: absolute;
  top: 10px;
  width: 100%;
  box-sizing: border-box;
  z-index: 2;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 100%;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  width: 100%;
  box-sizing: border-box;
}

.runner-canvas {
  border-radius: 0px !important;
  width: 100% !important;
  height: 150px !important;
  display: block;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.offline .controller {
  background: rgba(247, 247, 247, .1);
  height: 100vh;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1;
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  background: #fff;
  width: 100% !important;
  height: 150px !important;
}

.dino-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.dino-controls-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px #0002;
  padding: 32px 36px 28px 36px;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

.dino-controls-title {
  display: flex;
  align-items: center;
  font-size: 1.35em;
  font-weight: 700;
  color: #183153;
  margin-bottom: 8px;
  gap: 12px;
}

.dino-controls-row {
  display: flex;
  align-items: center;
  font-size: 1.13em;
  color: #183153;
  gap: 12px;
  width: 100%;
}

.dino-controls-row-icon {
  color: #183153;
  font-size: 1rem;
  width: 25px;
  display: flex;
  justify-content: center;
}

.dino-controls-row .dino-controls-row-icon:nth-child(3) i {
  border: 1px solid #000;
}

.dino-controls-row b {
  color: #1a7b8c;
  font-weight: 600;
}

.dino-game-outer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.dino-game-card {
  border-radius: 18px;
  padding: 32px 20px 24px 20px;
  width: 100%;
  max-width: 600px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.interstitial-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 0;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#main-frame-error img[id*="horizon"] {
  opacity: 1 !important;
  filter: none !important;
}

/* Responsive Media Queries */

/* Extra large devices (1299px and down) */
@media (max-width: 1299px) {
  .dino-game-outer {
    padding: 25px 15px;
  }
  
  .dino-game-card {
    padding: 28px 18px 20px 18px;
  }
  
  .offline .runner-container {
    left: 10px;
    width: calc(100% - 20px);
  }
  
  .offline .runner-canvas {
    left: 10px;
    width: calc(100% - 20px);
  }
}

/* Large devices (992px and down) */
@media (max-width: 992px) {
  .dino-game-outer {
    padding: 20px 12px;
  }
  
  .dino-game-card {
    padding: 24px 16px 18px 16px;
  }
  
  .offline .runner-container {
    left: 9px;
    width: calc(100% - 18px);
  }
  
  .offline .runner-canvas {
    left: 9px;
    width: calc(100% - 18px);
  }
}

/* Medium devices (768px and down) */
@media (max-width: 768px) {
  .dino-game-outer {
    padding: 15px 10px;
  }
  
  .dino-game-card {
    padding: 20px 14px 16px 14px;
  }
  
  .dino-controls-box {
    padding: 24px 20px 20px 20px;
  }
  
  .offline .runner-container {
    left: 8px;
    width: calc(100% - 16px);
  }
  
  .offline .runner-canvas {
    left: 8px;
    width: calc(100% - 16px);
  }
}

/* Small devices (600px and down) */
@media (max-width: 600px) {
  .dino-game-outer {
    padding: 10px 8px;
    width: 95%;
  }
  
  .dino-game-card {
    padding: 16px 12px 12px 12px;
    width: 100%;
  }
  
  .dino-controls-box {
    padding: 20px 16px 16px 16px;
    margin-bottom: 18px;
  }
  
  .dino-controls-container {
    margin-top: 18px;
    margin-bottom: 18px;
  }
  
  .interstitial-wrapper {
    margin-top: 5px;
    min-height: 160px;
  }
  
  .offline .runner-container {
    left: 0;
    width: 100%;
    top: 5px;
  }
  
  .offline .runner-canvas {
    left: 0;
    width: 100%;
  }
  
  .runner-canvas {
    height: 140px !important;
  }
  
  #gameCanvas {
    height: 140px !important;
  }
}

/* Extra small devices (350px and down) */
@media (max-width: 350px) {
  .dino-game-outer {
    padding: 8px 5px;
    width: 98%;
  }
  
  .dino-game-card {
    padding: 12px 8px 8px 8px;
  }
  
  .dino-controls-box {
    padding: 16px 12px 12px 12px;
  }
  
  .interstitial-wrapper {
    min-height: 140px;
  }
  
  .offline .runner-container {
    left: 5px;
    width: calc(100% - 10px);
  }
  
  .offline .runner-canvas {
    left: 5px;
    width: calc(100% - 10px);
  }
  
  .runner-canvas {
    height: 130px !important;
  }
  
  #gameCanvas {
    height: 130px !important;
  }
}

/* Very small devices (320px and down) */
@media (max-width: 320px) {
  .dino-game-outer {
    padding: 5px 3px;
    width: 99%;
  }
  
  .dino-game-card {
    padding: 10px 6px 6px 6px;
  }
  
  .dino-controls-box {
    padding: 14px 10px 10px 10px;
  }
  
  .interstitial-wrapper {
    min-height: 120px;
  }
  
  .offline .runner-container {
    left: 3px;
    width: calc(100% - 6px);
  }
  
  .offline .runner-canvas {
    left: 3px;
    width: calc(100% - 6px);
  }
  
  .runner-canvas {
    height: 120px !important;
  }
  
  #gameCanvas {
    height: 120px !important;
  }
}

.dino-controls-box {
  margin-bottom: 18px;
}

.dino-start-btn {
  margin-bottom: 18px;
}

.interstitial-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0001;
  padding: 0;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Media Quary  */
@media (max-width: 700px) {
  .dino-game-card {
    padding: 10px 2vw;
  }

  .interstitial-wrapper {
    max-width: 99vw;
    padding: 0 10%;
  }
}

@media (max-width: 600px) {
  .dino-controls-box,
  .dino-start-btn {
    padding-left: 10px;
    padding-right: 10px;
  }

  .dino-controls-container {
    margin-top: 18px;
    margin-bottom: 18px;
  }

  .interstitial-wrapper {
    margin-top: 5px;
  }
}

@media (max-width: 400px) {
  .interstitial-wrapper {
    padding: 0 5%;
  }
}

@media (max-height: 350px) {
  .interstitial-wrapper {
    margin-top: 5%;
  }
}

/* Ensure canvas is visible and properly sized */
.interstitial-wrapper {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.offline .runner-container {
  position: relative !important;
  overflow: hidden;
  background: #fff;
}

.offline .runner-canvas {
  position: relative !important;
  display: block !important;
  background: #fff;
}

#gameCanvas {
  display: block !important;
  background: #fff;
  border: none;
}

/* Ensure the game container is properly sized */
.dino-game-card {
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Fix for canvas not showing */
.interstitial-wrapper canvas {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure proper z-index */
.offline .runner-container {
  z-index: 10;
}

.offline .runner-canvas {
  z-index: 11;
}

/* Mobile optimization for canvas visibility */
@media (max-width: 650px) {
  .interstitial-wrapper {
    min-height: 160px;
    background: #fff;
  }
  
  .offline .runner-container {
    height: 150px;
    background: #fff;
  }
  
  .offline .runner-canvas {
    height: 150px;
    background: #fff;
  }
  
  #gameCanvas {
    height: 150px;
    background: #fff;
  }
}

/* Ensure the game loads properly */
.interstitial-wrapper {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

/* Fix for game not showing */
#main-frame-error {
  display: block !important;
  visibility: visible !important;
}

/* Ensure proper game initialization */
.dino-game-outer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dino-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}