* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 30%, #D4F1CA 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    position: relative;
}

#langToggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #FFF;
    border: 2px solid #4A90E2;
    color: #4A90E2;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
    transition: all 0.2s;
}

#langToggle:hover {
    background: #4A90E2;
    color: #FFF;
}

#app {
    width: 100%;
    max-width: 500px;
    padding-top: 30px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.dogs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.dog {
    font-size: 45px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.mahjong-icon {
    font-size: 35px;
    transform: rotate(-10deg);
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.mahjong-icon:nth-child(4) {
    transform: rotate(10deg);
}

h1 {
    color: #fff;
    -webkit-text-stroke: 1.5px #2B5E8A;
    text-shadow: 2px 2px 0 #2B5E8A, 0px 4px 10px rgba(0,0,0,0.3);
    font-size: 26px;
    line-height: 1.3;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

#startGameBtn, #clearAllBtn {
    color: white;
    padding: 12px 25px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), inset 0 -3px 0 rgba(0,0,0,0.1);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s;
    border: 3px solid #FFF;
}

#startGameBtn {
    background: linear-gradient(180deg, #FFD700 0%, #FF8C00 100%);
}

#clearAllBtn {
    background: linear-gradient(180deg, #E74C3C 0%, #C0392B 100%);
}

#startGameBtn:active, #clearAllBtn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.game-round {
    background: #FFF8E7;
    border: 4px solid #D2B48C;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.round-header {
    text-align: center;
    color: #8B4513;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px dashed #DEB887;
    padding-bottom: 10px;
}

.player-row {
    display: flex;
    align-items: center;
    background: #FFF;
    border: 3px solid #CCC;
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 12px;
    gap: 10px;
}

.row-东 { border-color: #4A90E2; background-color: #F0F6FF; }
.row-南 { border-color: #E67E22; background-color: #FFF5EC; }
.row-西 { border-color: #2ECC71; background-color: #F0FFF4; }
.row-北 { border-color: #3498DB; background-color: #EBF5FB; }

.player-dir-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
}

.mahjong-tile {
    width: 36px;
    height: 46px;
    background: #FFF;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.8), 2px 3px 0 rgba(0,0,0,0.15);
    border-style: solid;
    border-width: 2px 2px 4px 2px;
}

.row-东 .mahjong-tile { border-color: #4A90E2; color: #4A90E2; }
.row-南 .mahjong-tile { border-color: #E67E22; color: #E67E22; }
.row-西 .mahjong-tile { border-color: #2ECC71; color: #2ECC71; }
.row-北 .mahjong-tile { border-color: #3498DB; color: #3498DB; }

.player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.player-alias, .tiger-input {
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: bold;
    outline: none;
    color: #333;
}

.player-alias:focus, .tiger-input:focus {
    border-color: #FF8C00;
}

.tiger-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tiger-input {
    width: 60px;
    text-align: center;
    padding: 6px 4px; /* Reduce horizontal padding to fit text */
}

.tiger-input::placeholder {
    font-size: 13px;
    font-weight: normal;
}

.add-btn {
    background: #4A90E2;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 0 #2980B9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.add-btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 0 0 #2980B9;
}
.add-btn:disabled {
    background: #BDC3C7;
    box-shadow: none;
}

.footer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #DEB887;
    flex-wrap: wrap;
    gap: 10px;
}

.unit-input {
    display: flex;
    align-items: center;
    background: #FFF;
    border: 2px solid #4A90E2;
    border-radius: 12px;
    padding: 5px 10px;
    font-weight: bold;
    color: #333;
}

.unit-icon {
    color: #F1C40F;
    font-size: 18px;
    margin-right: 6px;
    text-shadow: 1px 1px 0px #D4AC0D;
}

.unit-input input {
    width: 50px;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-right: 5px;
}

.footer-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.end-game-btn, .clear-round-btn, .modify-round-btn {
    color: white;
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    min-width: 120px;
}

.end-game-btn {
    background: #E74C3C;
    border: 2px solid #C0392B;
    box-shadow: 0 4px 0 #C0392B;
}

.clear-round-btn {
    background: #F39C12;
    border: 2px solid #D68910;
    box-shadow: 0 4px 0 #D68910;
}

.modify-round-btn {
    background: #3498DB;
    border: 2px solid #2980B9;
    box-shadow: 0 4px 0 #2980B9;
}

.end-game-btn input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.end-game-btn:active:not(:disabled), .clear-round-btn:active:not(:disabled), .modify-round-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

.end-game-btn:disabled, .clear-round-btn:disabled, .modify-round-btn:disabled {
    background: #BDC3C7;
    border-color: #95A5A6;
    box-shadow: 0 4px 0 #95A5A6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.round-result {
    margin-top: 15px;
    background: #FFF;
    border: 3px solid #F1C40F;
    border-radius: 15px;
    padding: 15px;
    font-size: 16px;
    box-shadow: inset 0 0 10px rgba(241,196,15,0.2);
}

.result-title {
    text-align: center;
    color: #E74C3C;
    margin-bottom: 15px;
    font-size: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.positive { color: #2ECC71; }
.negative { color: #E74C3C; }
