
:root {
    --bg: #0b1220;
    --panel: #0f1724;
    --accent: #ffd54f;
    --text: #e6eef6;
}

* {
    box-sizing: border-box;
    font-family: Inter, system-ui, Arial;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #071022 0%, #0b1530 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 18px;
    min-height: 100vh;
}

.top-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
}

h1 {
    margin: 0;
    font-size: 20px
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

button {
    background: var(--accent);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: #082032
}

button.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text)
}

button.exit {
    background: #ff7a7a
}

.board-wrap {
    width: 900px;
    max-width: 92vw;
    aspect-ratio: 1/1;
    perspective: 1200px;
    position: relative;
    border-radius: 12px;
}

/* 3D board container */
.board {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s;
    border-radius: 10px;
    background-image: url('/school/webdevelopment-games/tavonboardgame.png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 0;
    padding: 10px;
}

/* squares grid */
.square {
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #082032;
    height: 100%;
}

.square.prop {
    background: linear-gradient(180deg, #fff9e6, #fff1c0);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px;
    flex-direction: column
}

.square.start {
    background: linear-gradient(180deg, #dff4ff, #bfe8ff)
}

.square.jail {
    background: linear-gradient(180deg, #ffdfe6, #ffc7d1)
}

.square.card {
    background: linear-gradient(180deg, #e6ffe6, #c9f5c9)
}

.square.tax {
    background: linear-gradient(180deg, #ffe6e6, #ffcccc)
}

.token {
    width: 40px;
    height: 40px;
    position: absolute;
    transform: translate(-50%, -50%);
    background-image: url('/school/webdevelopment-games/token2.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    box-shadow: none;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

.token img {
    display: none; /* hide the img completely */
}

.hud {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
}
.property-popup {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: #111;
  color: #fff;
  padding: 14px;
  width: 260px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
  z-index: 9999;
  animation: slideIn .3s ease;
}

.property-popup.hidden {
  display: none;
}

.property-popup h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.property-popup button {
  margin-top: 10px;
  width: 100%;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.panel {
    background: rgba(7, 14, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    min-width: 220px
}

.players {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.player-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between
}

.active {
    box-shadow: 0 6px 20px rgba(255, 213, 80, 0.12);
    border: 1px solid rgba(255, 213, 80, 0.14)
}

.log {
    height: 120px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
    border-radius: 8px;
    font-size: 13px
}

.board-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px
}

.slider {
    appearance: none;
    width: 160px
}

/* modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50
}

.modal {
    background: linear-gradient(180deg, #0f1724, #0b1220);
    padding: 18px;
    border-radius: 10px;
    color: var(--text);
    min-width: 320px;
    max-width: 90vw
}

#rotX::-webkit-slider-thumb,
#rotY::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #333;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #000;
}

#rotX::-moz-range-thumb,
#rotY::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #333;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #000;
}

.modal h3 {
    margin: 0 0 8px
}

.row {
    display: flex;
    gap: 8px;
    align-items: center
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #071226;
    color: var(--text)
}

.dice {
    display: flex;
    gap: 6px;
    align-items: center
}

.dice .die {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #082032
}

.small {
    font-size: 12px;
    opacity: 0.9
}

footer {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.85
}

/* responsive tweaks */
@media (max-width:900px) {
    .board-wrap {
        width: 92vw
    }
    .panel {
        min-width: 160px
    }
}

/* Added Responsive HUD adjustments */
@media (max-width: 1000px) {
    .top-row {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .board-wrap {
        width: 95vw;
        max-width: 600px;
    }

    .hud {
        flex-direction: column;
        gap: 12px;
    }

    .hud > div[style*="flex:1"] {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .dice {
        flex-wrap: wrap;
        gap: 6px;
    }

    .hud .panel[style*="width:320px"],
    .hud > div:last-child {
        width: 100%;
    }

    .hud .players {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .players .player-row {
        flex: 1 1 45%;
        flex-direction: column;
        align-items: flex-start;
    }

    .hud .small {
        font-size: 11px;
    }

    #rollBtn {
        font-size: 0.85rem;
        padding: 5px 8px;
    }
}

@media (max-width: 600px) {
    .board-wrap {
        max-width: 100%;
    }

    .hud .panel[style*="width:320px"],
    .hud > div:last-child {
        width: 100%;
    }

    .players .player-row {
        flex: 1 1 100%;
    }

    .dice .die {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    h1 {
        font-size: 18px;
    }

    button {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
}
