/* === Reset and Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  overflow: hidden;
  background: url("../images/mount.jpg") no-repeat center center fixed;
  background-size: cover;
}

/* === Highlight animation for landed square === */
.landed-glow {
  animation: landFlash 1.2s ease-out;
  position: relative;
  z-index: 10 !important;
  border: 3px solid white !important;
}

@keyframes landFlash {
  0%   { box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0); }
  25%  { box-shadow: 0 0 20px 10px rgba(255, 255, 0, 0.8); }
  50%  { box-shadow: 0 0 15px 5px rgba(255, 255, 0, 0.5); }
  100% { box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0); }
}

/* === Initial Selection Page === */
#initialPage {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fef6d8;
  border: 4px solid #d4af37;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  text-align: center;
}

#initialPage h2 {
  margin-bottom: 15px;
}

.form-wrapper {
  background: #fff9e8;
  border: 2px solid #d4af37;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 600px;
}

.cyclist-option {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  justify-content: space-between;
}

.cyclist-option img {
  width: 60px;
  height: 60px;
  margin-right: 10px;
  object-fit: contain;
  border: 1px solid #333;
}

#initialPage label {
  margin-right: 10px;
}

.cyclist-name-input {
  padding: 5px;
  border: 1px solid #ccc;
  flex-grow: 1;
  margin-left: 10px;
}

#initialPage button {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #88c9bf;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

/* === Instruction Box === */
.instruction-box {
  font-family: Tahoma, sans-serif;
  font-style: italic;
  margin-top: 30px;
  padding: 15px;
  border: 2px solid #888;
  border-radius: 8px;
  background-color: #fce8d5;
  max-width: 800px;
  line-height: 1.5;
  text-align: justify;
}

.instruction-box-title {
  text-align: center;
  font-style: normal;
  margin-top: 0;
  font-weight: bold;
}

/* ... The rest of the original CSS remains unchanged and has been reviewed. */
/* === Game Board Layout === */
#gameBoard {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.title-square {
  font-family: Tahoma, sans-serif;
  font-size: 22px !important;
  font-weight: bold;
  color: #d4af37 !important;
  background-color: #fffbe6;
  border: 2px solid black !important;
  text-align: center;
  z-index: 1;
  position: relative;
}

/* === Grid === */
#grid {
  display: grid;
  grid-template-columns: repeat(25, 1fr);
  grid-template-rows: repeat(15, 1fr);
  width: 95vw;
  height: 90vh;
  margin: 20px auto 0 auto;
  border: 2px solid #444;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.square {
  background-color: transparent;
  border: 2px solid rgba(170, 170, 170, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  position: relative;
  overflow: visible;
}

.square-count {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  color: black;
  font-weight: bold;
  pointer-events: none;
}

.path-square.border-hide {
  border-color: transparent !important;
}


/* === Path Road Logic with Blur === */
.path-square {
  color: transparent !important;
  font-size: 0 !important;
  border: 2px solid black !important;
}

.path-square::before,
.path-square.yellow::before,
.path-square.red::before,
.path-square.violet::before,
.path-square.green::before,
.path-square.black::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(5px);
  z-index: -1;
  border-radius: inherit;
}

.path-square.flat-road:not(.yellow):not(.red):not(.violet):not(.green):not(.black) {
  background: rgba(200, 200, 200, 0.3);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5), inset 0 -1px 1px rgba(102,102,102,0.5);
}

.path-square.mountain-road:not(.yellow):not(.red):not(.violet):not(.green):not(.black) {
  background: rgba(180, 140, 80, 0.3);
  box-shadow: inset 0 1px 2px rgba(255,240,208,0.5), inset 0 -1px 1px rgba(117,84,32,0.5);
}

/* === Special Squares (visible colors) === */
.path-square.yellow:not(.border-hide) { background-color: rgba(255, 235, 59, 0.6) !important; }
.path-square.red:not(.border-hide)    { background-color: rgba(255, 0, 0, 0.6) !important; }
.path-square.violet:not(.border-hide) { background-color: rgba(255, 105, 180, 0.6) !important; }
.path-square.green:not(.border-hide)  { background-color: rgba(0, 127, 0, 0.6) !important; }
.path-square.black:not(.border-hide)  { background-color: rgba(42, 42, 42, 0.6) !important; }

/* === Hide color when border is hidden (for even squares) === */
.path-square.border-hide {
  background-color: transparent !important;
}

/* === Rounded Corners on Road === */
.round-top-left { border-top-left-radius: 12px; }
.round-top-right { border-top-right-radius: 12px; }
.round-bottom-left { border-bottom-left-radius: 12px; }
.round-bottom-right { border-bottom-right-radius: 12px; }

/* === Special Squares with Soft Color === */
.yellow { background-color: rgba(255, 235, 59, 0.6) !important; border: 2px solid black; opacity: 0.95; }
.red    { background-color: rgba(255, 0, 0, 0.6) !important; border: 2px solid black; opacity: 0.95; }
violet { background-color: rgba(255, 105, 180, 0.6) !important; border: 2px solid black; opacity: 0.95; }
.green  { background-color: rgba(0, 127, 0, 0.6) !important; border: 2px solid black; opacity: 0.95; }
.black  { background-color: rgba(42, 42, 42, 0.6) !important; border: 2px solid black; opacity: 0.95; }

/* === Cyclist Pieces === */
.cyclist {
  width: 100%;
  height: 100%;
  max-width: 45px;
  max-height: 45px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  object-fit: contain;
  transition: transform 0.3s ease, left 0.3s, top 0.3s;
  z-index: 5;
  pointer-events: none;
}

.moving {
  animation: enlargeShrink 1s infinite;
  max-width: 50px;
  max-height: 50px;
}

@keyframes enlargeShrink {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.2); }
}

/* === Info Table === */
#infoTable {
  position: absolute;
  top: 20px;
  left: 20px;
  background: white;
  border: 2px solid black;
  padding: 10px;
  width: 160px;
  text-align: left;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  z-index: 10;
}

/* === Dice === */
.face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border: 2px solid #444;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  backface-visibility: hidden;
}

.pip {
  width: 30%;
  height: 30%;
  background: black;
  border-radius: 50%;
  justify-self: center;
  align-self: center;
}

.center        { grid-column: 2; grid-row: 2; }
.top-left      { grid-column: 1; grid-row: 1; }
.top-right     { grid-column: 3; grid-row: 1; }
.center-left   { grid-column: 1; grid-row: 2; }
.center-right  { grid-column: 3; grid-row: 2; }
.bottom-left   { grid-column: 1; grid-row: 3; }
.bottom-right  { grid-column: 3; grid-row: 3; }

.face.front  { transform: rotateY(  0deg) translateZ(40px); }
.face.back   { transform: rotateY(180deg) translateZ(40px); }
.face.right  { transform: rotateY( 90deg) translateZ(40px); }
.face.left   { transform: rotateY(-90deg) translateZ(40px); }
.face.top    { transform: rotateX( 90deg) translateZ(40px); }
.face.bottom { transform: rotateX(-90deg) translateZ(40px); }

@keyframes diceShake {
  0%   { transform: translate(0, 0) rotateX(var(--x, 0deg)) rotateY(var(--y, 0deg)); }
  25%  { transform: translate(10px, -10px) rotateX(var(--x)) rotateY(var(--y)); }
  50%  { transform: translate(-10px, 10px) rotateX(var(--x)) rotateY(var(--y)); }
  75%  { transform: translate(10px, 10px) rotateX(var(--x)) rotateY(var(--y)); }
  100% { transform: translate(0, 0) rotateX(var(--x)) rotateY(var(--y)); }
}

.cube.shaking {
  animation: diceShake 3s ease-out;
}

#dice {
  position: absolute;
  width: 60px;
  height: 60px;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%);
  perspective: 600px;
  cursor: grab;
  z-index: 20;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 1s ease-out;
}

/* === Final Results Table === */
#resultsTableContainer {
  display: none;
  background: #ffffffee;
  border: 2px solid #222;
  padding: 15px;
  margin-top: 15px;
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  width: 300px;
  font-family: 'Arial', sans-serif;
}

#resultsTableContainer table {
  width: 100%;
  border-collapse: collapse;
}

#resultsTableContainer th,
#resultsTableContainer td {
  padding: 8px 12px;
  border-bottom: 1px solid #ccc;
  text-align: left;
}

#resultsTableContainer th {
  background-color: #f2f2f2;
  font-weight: bold;
  color: #333;
}

#resultsTableContainer td {
  background-color: #fafafa;
  color: #111;
}

.info-number {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
  display: inline-block;
  background: #eee;
}


/* === Reveal on Land Temporary Color === */
.square.reveal-flat {
  background-color: silver !important;
}

.square.reveal-mountain {
  background-color: #b48c50 !important; /* ochre for mountain */
}

.square.reveal-yellow {
  background-color: rgba(255, 235, 59, 0.95) !important;
}

.square.reveal-red {
  background-color: rgba(255, 0, 0, 0.95) !important;
}

.square.reveal-violet {
  background-color: rgba(255, 105, 180, 0.95) !important;
}

.square.reveal-green {
  background-color: rgba(0, 127, 0, 0.95) !important;
}

.square.reveal-black {
  background-color: rgba(42, 42, 42, 0.95) !important;
}





