/* tetris/index.html 전용 스타일 (클래식 레트로/픽셀 톤) */
.ttr-page {
    margin: 0;
    min-height: 100vh;
    background: #0d0d1a;
    color: #e8e8f0;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    display: flex;
    justify-content: center;
    padding: 24px 16px 40px;
    box-sizing: border-box;
}
.ttr-page *, .ttr-page *::before, .ttr-page *::after {
    box-sizing: border-box;
}

.ttr-wrap {
    width: 100%;
    max-width: 640px;
}

.ttr-back {
    display: inline-block;
    color: #8a8aa8;
    text-decoration: none;
    font-size: 10px;
    margin-bottom: 16px;
}
.ttr-back:hover { color: #e8e8f0; }

.ttr-title {
    font-size: 28px;
    letter-spacing: 4px;
    text-align: center;
    color: #ffcc00;
    text-shadow: 3px 3px 0 #7a4b00;
    margin: 0 0 20px;
}

.ttr-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.ttr-board-area {
    position: relative;
    flex: 0 0 auto;
}

.ttr-board {
    display: block;
    background: #05050c;
    border: 4px solid #4a4a6a;
    box-shadow: 0 0 0 4px #05050c, 0 0 24px rgba(0,0,0,0.6);
    image-rendering: pixelated;
}

.ttr-touch-controls {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
}

.ttr-touch-row {
    display: flex;
    gap: 8px;
}

.ttr-touch-btn {
    width: 56px;
    height: 56px;
    font-family: inherit;
    font-size: 20px;
    color: #e8e8f0;
    background: #14142a;
    border: 3px solid #4a4a6a;
    touch-action: none;
    -webkit-touch-callout: none;
    cursor: pointer;
}
.ttr-touch-btn:active {
    background: #2c2c46;
    border-color: #7bffcb;
}

.ttr-side {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ttr-panel {
    background: #14142a;
    border: 3px solid #4a4a6a;
    padding: 10px 12px;
}

.ttr-panel-label {
    font-size: 9px;
    color: #8a8aa8;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ttr-panel-value {
    font-size: 18px;
    color: #7bffcb;
}

.ttr-next {
    display: block;
    background: #05050c;
    border: 2px solid #2c2c46;
    margin: 0 auto;
}

.ttr-ranking-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.ttr-ranking-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    font-size: 10px;
    line-height: 1.9;
    max-height: 220px;
    overflow-y: auto;
}
.ttr-ranking-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #cfcfe6;
    border-bottom: 1px dashed #2c2c46;
    padding-bottom: 3px;
}
.ttr-ranking-list li:nth-child(1) { color: #ffd23f; }
.ttr-ranking-list li:nth-child(2) { color: #d9d9f0; }
.ttr-ranking-list li:nth-child(3) { color: #e0a86a; }
.ttr-ranking-rank { flex: 0 0 auto; opacity: 0.7; }
.ttr-ranking-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ttr-ranking-score { flex: 0 0 auto; }
.ttr-ranking-empty { color: #6a6a88; }

.ttr-ranking-more {
    display: block;
    font-size: 9px;
    color: #7bffcb;
    text-decoration: none;
    text-align: right;
}
.ttr-ranking-more:hover { text-decoration: underline; }

.ttr-controls-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 9px;
    line-height: 2.2;
    color: #cfcfe6;
}
.ttr-controls-list li {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ttr-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 5px;
    background: #2c2c46;
    border: 1px solid #4a4a6a;
    border-radius: 3px;
    color: #fff;
    font-size: 9px;
}
.ttr-key-wide { min-width: 48px; }

/* overlays */
.ttr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,5,12,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
}
.ttr-hidden { display: none; }

.ttr-overlay-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.ttr-overlay-title {
    font-size: 20px;
    color: #ffcc00;
    margin: 0;
    letter-spacing: 2px;
}

.ttr-overlay-text {
    font-size: 11px;
    line-height: 1.8;
    color: #cfcfe6;
    margin: 0;
}

.ttr-btn {
    font-family: inherit;
    font-size: 11px;
    color: #05050c;
    background: #7bffcb;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #2c2c46;
}
.ttr-btn:hover { background: #a3ffdd; }
.ttr-btn:active { box-shadow: 1px 1px 0 #2c2c46; transform: translate(2px, 2px); }

.ttr-name-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.ttr-name-label {
    font-size: 9px;
    color: #8a8aa8;
}
.ttr-name-input {
    font-family: inherit;
    font-size: 12px;
    padding: 8px 10px;
    background: #05050c;
    border: 2px solid #4a4a6a;
    color: #e8e8f0;
    text-align: center;
    width: 180px;
}
.ttr-name-input:focus {
    outline: none;
    border-color: #7bffcb;
}

.ttr-save-msg {
    font-size: 9px;
    color: #7bffcb;
    min-height: 12px;
    margin: 0;
}

@media (max-width: 520px) {
    .ttr-layout { flex-direction: column; align-items: center; }
    .ttr-side { flex: 0 0 auto; width: 240px; }
}
