* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

#app {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem
}

h2.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0)
}

.top-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center
}

.status-bar {
    font-size: 14px;
    color: var(--color-text-secondary);
    background: var(--color-background-secondary);
    border: 0.5px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-md);
    padding: 8px 20px;
    min-width: 300px;
    text-align: center
}

.status-bar span {
    font-weight: 500;
    color: var(--color-text-primary)
}

.ai-badge {
    font-size: 11px;
    background: var(--color-background-info);
    color: var(--color-text-info);
    border-radius: var(--border-radius-md);
    padding: 3px 10px;
    font-weight: 500
}

.thinking {
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-style: italic
}

.game-area {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start
}

.hand-box {
    width: 110px;
    background: var(--color-background-secondary);
    border: 0.5px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-lg);
    padding: 8px;
    min-height: 200px
}

.hand-box h3 {
    font-size: 11px;
    color: var(--color-text-tertiary);
    font-weight: 500;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.05em
}

.hand-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center
}

.hand-piece {
    width: 32px;
    height: 36px;
    background: #f5e9c8;
    border: 1px solid #c9a84c;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s
}

.hand-piece:hover {
    transform: scale(1.1)
}

.hand-piece.selected {
    outline: 2px solid #c0392b;
    background: #ffe0d0
}

.hand-piece.enemy {
    background: #c8d5f5;
    border-color: #4c6cc9;
    transform: rotate(180deg);
    cursor: default
}

.hand-piece .count {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 9px;
    color: #888;
    font-weight: 500
}

.board {
    display: grid;
    grid-template-columns: repeat(9, 52px);
    grid-template-rows: repeat(9, 52px);
    border: 2px solid #6b4c11;
    background: #dcb65a;
    gap: 1px;
    padding: 1px
}

.cell {
    width: 52px;
    height: 52px;
    background: #f0d080;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.1s
}

.cell:hover {
    background: #f5e4a0
}

.cell.selected {
    background: #b8f0b8 !important
}

.cell.movable {
    background: #d0f0d0 !important
}

.cell.movable::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 160, 0, 0.3);
    border: 2px solid rgba(0, 160, 0, 0.5)
}

.cell.last-move {
    background: #ffe8a0 !important
}

.piece {
    width: 44px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px 4px 8px 8px;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    cursor: pointer;
    border: 1px solid #c9a84c;
    background: #f5e9c8;
    box-shadow: 1px 1px 0 #c9a84c;
    transition: transform 0.1s
}

.piece.enemy {
    transform: rotate(180deg);
    background: #c8d5f5;
    border-color: #4c6cc9;
    box-shadow: 1px 1px 0 #4c6cc9;
    color: #1a3a8a
}

.piece.mine {
    color: #3a1a0a
}

.piece.promoted {
    color: #c0392b
}

.piece.enemy.promoted {
    color: #8b0000
}

.coord-col {
    display: flex;
    justify-content: space-around;
    width: 468px;
    margin-bottom: 2px
}

.coord-col span,
.coord-row span {
    font-size: 10px;
    color: var(--color-text-tertiary)
}

.coord-row {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 468px;
    margin-left: 4px
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center
}

button {
    padding: 6px 16px;
    font-size: 13px;
    border: 0.5px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    cursor: pointer
}

button:hover {
    background: var(--color-background-secondary)
}

button:disabled {
    opacity: 0.4;
    cursor: default
}

select {
    padding: 6px 12px;
    font-size: 13px;
    border: 0.5px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    background: var(--color-background-primary);
    color: var(--color-text-primary)
}

.modal-wrap {
    min-height: 120px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    margin: 0.5rem 0;
    width: 100%
}

.promote-modal {
    background: var(--color-background-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    min-width: 200px
}

.promote-modal h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 1rem
}

.promote-modal .btn-row {
    justify-content: center
}