* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    font-family: "Courier New", Courier, monospace, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #2b2b2b;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #1a1a1a;
}

.game-wrapper {
    background-color: #fce74f;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 420px;
    position: relative;
}

.title-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.title-bar h1 {
    font-size: 22px;
    margin: 0 15px;
    letter-spacing: 2px;
}

.deco-lines {
    font-size: 12px;
    letter-spacing: 2px;
}

.main-board {
    display: flex;
    justify-content: center;
    border: 4px solid #000;
    background-color: #fce74f;
    padding: 10px;
    position: relative;
    margin-bottom: 20px;
}

.play-area {
    display: flex;
    border: 4px inset #888;
    background-color: #a2b49a;
    position: relative;
}

.matrix {
    width: 200px;
    height: 400px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(20, 1fr);
}

.cell {
    width: 20px;
    height: 20px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.cell.active {
    background-color: #1a1a1a;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.2), inset -2px -2px 0 rgba(0,0,0,0.5);
}

.start-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(162, 180, 154, 0.95);
    z-index: 10;
    transition: opacity 0.3s;
}

.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.dinosaur {
    font-size: 60px;
    margin-bottom: 10px;
}

.start-text {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.start-btn {
    padding: 8px 20px;
    font-size: 16px;
    font-weight: bold;
    background-color: #4caf50;
    color: #fff;
    border: 2px solid #000;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
}
.start-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.info-panel {
    width: 100px;
    border-left: 2px solid #888;
    padding: 10px;
    display: flex;
    flex-direction: column;
    background-color: #a2b49a;
}

.info-item {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 16px;
    text-align: right;
    color: #2e4627;
    font-weight: bold;
}

.next-matrix {
    width: 80px;
    height: 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    margin-top: 5px;
    background-color: rgba(0,0,0,0.05);
}

.next-cell {
    width: 20px;
    height: 20px;
}

.next-cell.active {
    background-color: #1a1a1a;
}

.info-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
}

.side-deco {
    width: 30px;
    background-image: radial-gradient(circle, #000 3px, transparent 3px);
    background-size: 10px 10px;
    background-position: center;
    opacity: 0.8;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.top-buttons {
    display: flex;
    gap: 15px;
}

button {
    border: none;
    outline: none;
    cursor: pointer;
    color: #1a1a1a;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.1s;
    touch-action: none; 
}

button:active {
    transform: scale(0.95);
}

.btn-round {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 3px 3px 0 #000;
}

.btn-round.green { background-color: #4caf50; }
.btn-round.red { background-color: #f44336; }
.btn-round.purple { background-color: #673ab7; color: #fff; }

.btn-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #673ab7;
    color: #fff;
    font-size: 16px;
    box-shadow: 4px 4px 0 #000;
    line-height: 1.2;
}

.bottom-buttons {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.left-btn-area {
    padding-left: 10px;
}

.right-btn-area {
    position: relative;
    width: 180px;
    height: 180px;
}

.rotate-btn {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    z-index: 2;
}

.rotate-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.d-pad {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

.d-pad button {
    position: absolute;
    width: 65px;
    height: 65px;
}

#left-btn { bottom: 40px; left: 0; }
#right-btn { bottom: 40px; right: 0; }
#down-btn { bottom: 0; left: 50%; transform: translateX(-50%); }
#down-btn:active { transform: translateX(-50%) scale(0.95); }

.arrows {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
    font-weight: bold;
}