html, body {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: none;
}

main {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;

  splash-screen {
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    > img {
      object-fit: contain;
      max-width: 80%;
      max-height: 80%;
    }

    > img.loading {
      position: absolute;
      bottom: 10%;
      max-width: 30em;
      width: 80%;
    }
  }
}




collapse-game {
  display: grid;
  max-height: 100% !important;
  height: 100vh;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "score mode level"
    "game game game"
    "pause lines menu";
  gap: 0.5rem;
  padding: 0.5rem;
  gap: 0.5rem;
  padding: 0.5rem;
  box-sizing: border-box;
}

.score-box { grid-area: score; }
.mode-box  { grid-area: mode; }
.level-box { grid-area: level; }
.lines-box { grid-area: lines; }

#pause-button { grid-area: pause; }
#menu-button  { grid-area: menu; }
#retry-button { grid-area: game; }

#menu-button, #pause-button {
  padding-top: 1em;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: none;
}

#retry-button {
  align-self: center;
  justify-self: center;
  z-index: 20;
  border: none;
  padding: 0;
  background: transparent;
}

  .game {
    grid-area: game;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
  }








collapse-game {
  max-width: 100vw;
  height: 100%;
}

droppy-blocky {
  display: inline-block;
  padding-inline: 0.4em;
  padding-block: 0.4em 0.2em;
  background-color: #0C294E;
  margin: 0;
  border-radius: 0.6em;
  overflow: hidden;
}


button {
  pointer-events: auto;
  z-index: 10;
  display: block;
  max-width: 100%;
  width: 160px;
  padding: 12px 20px;
  margin: 12px auto;
  font-family: 'Cinzel', serif; /* Fantasy-style font */
  font-size: 18px;
  color: #f0e6c8;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border: 2px solid #c9a84e;
  border-radius: 8px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(201, 168, 78, 0.5);
  transition: all 0.2s ease-in-out;
}

button:hover {
  background: linear-gradient(to bottom, #3a3a3a, #2a2a2a);
  opacity: 0.8;
  box-shadow: 0 0 12px rgba(255, 215, 100, 0.8);
  transform: scale(1.05);
  cursor: pointer;
}

button:active {
  transform: scale(0.98);
  box-shadow: 0 0 6px rgba(255, 215, 100, 0.5);
}

.mode-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  margin-top: 1em;
  background: radial-gradient(circle at top, #3a4a5e, #1a1f2b);
  border: 3px solid #8fd0ff;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(143, 208, 255, 0.5);
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  position: relative;
}


.mode-box::before {
  content: 'MODE';
  position: absolute;
  top: -8px;
  background: #1a1f2b;
  padding: 2px 8px;
  font-size: 12px;
  color: #8fd0ff;
  border: 1px solid #8fd0ff;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mode-box .value {
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  margin-top: 8px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.score-box, .level-box, .lines-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  margin-top: 1em;

  background: linear-gradient(to bottom, #1a2433, #0e1824);
  border: 2px solid #6fc3b2;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(111, 195, 178, 0.4);

  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 50vw, 20px);
  font-weight: bold;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  position: relative;
}


.score-box::before, .level-box::before, .lines-box::before {
  position: absolute;
  top: -8px;
  background: #1a1f2b;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid #d4c28a;
  border-radius: 8px;
  letter-spacing: 1px;

  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d4c28a;
}


.score-box::before {
  content: 'SCORE';
}

.level-box::before {
  content: 'LEVEL';
}

.lines-box::before {
  content: 'LINES LEFT';
}

.score-box .value, .level-box .value, .lines-box .value {
  font-size: 22px;
  margin-top: 8px;

  font-size: 28px;
  font-weight: bold;
  color: #ffeaa7;
  text-shadow: 0 0 6px rgba(178, 255, 242, 0.6);
}

droppy-blocky {
  touch-action: manipulation;
}

scene-container {
  background-repeat: no-repeat;
  background-size: cover;
  background-color: #00183A;
  background-image: url("./images/background.png");

  width:100%;
  height: 100%;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mode-box {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mode-box.changed {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(143, 208, 255, 0.8);
}
.mode-box.puzzle { border-color: #c58aff; }
.mode-box.classic { border-color: #ffd966; }
.mode-box.strategy { border-color: #6fc3b2; }
.mode-box.continuous { border-color: #ff8a8a; }


dialog#confirmModal {
  border: none;
  padding: 0;
  background: transparent;
}

dialog#settings-modal {
  border: none;
  padding: 0;
  background: transparent;
}

dialog#high-scores-modal {
  border: none;
  padding: 0;
  background: transparent;
}

dialog#how-to-modal {
  border: none;
  padding: 0;
  background: transparent;
}

.modal-content {
  background: linear-gradient(to bottom, #1a1f2b, #0e141f);
  border: 3px solid #c9a84e;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(201, 168, 78, 0.6);
  padding: 20px 30px;
  width: 320px;
  font-family: 'Cinzel', serif;
  color: #f0e6c8;
  text-align: center;
}

.settings-content {
  width: min(520px, 90vw);
}

.scores-content {
  width: min(560px, 92vw);
}

.how-to-content {
  width: min(600px, 92vw);
  text-align: left;
}

.how-to-content h2 {
  text-align: center;
}

.how-to-intro {
  margin: 8px 0 16px;
  color: #d0f7f4;
  text-align: center;
}

.how-to-list {
  margin: 0 0 18px;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: #f0e6c8;
  font-size: 15px;
}

.scores-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0 6px;
  flex-wrap: wrap;
}

.scores-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #6fc3b2;
  background: rgba(26, 31, 43, 0.8);
  color: #d0f7f4;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
}

.scores-tab.active {
  background: linear-gradient(to bottom, #3a4a5e, #1a1f2b);
  border-color: #ffd966;
  color: #ffd966;
  box-shadow: 0 0 8px rgba(255, 215, 100, 0.5);
}

.scores-mode {
  margin: 0 0 10px;
  font-size: 12px;
  color: #ffd966;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scores-subtitle {
  margin: 4px 0 16px;
  font-size: 14px;
  color: #8fd0ff;
}

.scores-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.scores-entry label {
  font-size: 14px;
  color: #ffd966;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scores-entry input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #6fc3b2;
  background: #0e141f;
  color: #f0e6c8;
  font-family: 'Cinzel', serif;
  font-size: 16px;
}

.scores-entry input:focus {
  outline: 2px solid rgba(143, 208, 255, 0.7);
}

.scores-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}

.scores-item,
.scores-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 78, 0.4);
  background: rgba(14, 20, 31, 0.8);
  text-align: left;
}

.scores-empty {
  grid-template-columns: 1fr;
  text-align: center;
  color: #d0f7f4;
}

.scores-rank {
  color: #ffd966;
  font-weight: bold;
}

.scores-name {
  font-weight: bold;
}

.scores-details {
  color: #8fd0ff;
  font-size: 14px;
  white-space: nowrap;
}

.settings-content h2 {
  margin: 0 0 16px;
  font-size: 24px;
  color: #ffd966;
  text-shadow: 0 0 10px rgba(255, 215, 100, 0.6);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

#volume-slider {
  width: 100%;
}

#volume-value {
  min-width: 56px;
  text-align: right;
  color: #8fd0ff;
}

.modal-content p {
  font-size: 18px;
  margin-bottom: 20px;
}

.modal-buttons {
  display: flex;
  justify-content: space-around;
}

.modal-btn {
  padding: 10px 20px;
  font-size: 16px;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  border: 2px solid #c9a84e;
  border-radius: 8px;
  background: #2a2a2a;
  color: #f0e6c8;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(201, 168, 78, 0.4);
  transition: all 0.2s ease;
}

.modal-btn:hover {
  background: #3a3a3a;
  box-shadow: 0 0 10px rgba(255, 215, 100, 0.6);
}

.modal-btn.confirm {
  border-color: #6fc3b2;
  color: #d0f7f4;
}

.modal-btn.cancel {
  border-color: #ff8a8a;
  color: #ffd6d6;
}

dialog::backdrop {
  background: rgba(40, 50, 70, 1);
  backdrop-filter: blur(4px);
}





/* -------------------------------- */

game-menu {
  font-family: 'Verdana', sans-serif;
  color: #f0e6c8;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


#main-menu {
  max-width: 90%;
  width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: #2a2a2a;
  border: 4px ridge #c9a84e;
  box-shadow: 0 0 20px rgba(255, 215, 100, 0.4);
}
.title {
  font-size: 48px;
  color: #ffd966;
  text-shadow: 0 0 12px rgba(255, 215, 100, 0.6);
  margin-bottom: 30px;
}

.menu-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 20px;
  margin-bottom: 30px;
}

.mode-button {
  width: 360px;
  height: 120px;
  background: #3a3a3a;
  border: 3px solid #c9a84e;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(201, 168, 78, 0.3);
  padding: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
  max-height: 10vh;
  max-width: 82%;
}

.mode-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(255, 215, 100, 0.6);
}

.mode-button.locked {
  opacity: 0.4;
  filter: grayscale(100%);
  cursor: default;
}

.label {
  font-size: 20px;
  font-weight: bold;
  color: #ffd966;
  margin-bottom: 8px;
}

.desc {
  font-size: 14px;
  color: #f0e6c8;
}

.lock-reason {
  margin-top: 6px;
  font-size: 12px;
  color: #f6d7a8;
}

.menu-footer {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.footer-button {
  font-size: 18px;
  padding: 12px 24px;
  background: #2a2a2a;
  color: #8fd0ff;
  border: 3px solid #8fd0ff;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(143, 208, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-button:hover {
  background: #3a3a3a;
  box-shadow: 0 0 12px rgba(143, 208, 255, 0.6);
}
