* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* game container */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
    backdrop-filter: blur(10px);
}

/* header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.backBtn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.backBtn:hover {
    transform: translateY(-50%) translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.5);
}

.backBtn:active {
    transform: translateY(-50%) translateY(-1px);
}

.game-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0 60px;
}

.game-subtitle {
    color: #666;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 400;
}

/* score board */
.score-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(15px, 4vw, 40px);
    margin-bottom: 40px;
    padding: clamp(15px, 3vw, 20px);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.score-divider {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #999;
    background: white;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 2vw, 15px);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* battle history section */
.history-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 20px;
    padding: clamp(15px, 3vw, 20px);
    margin-bottom: 30px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.history-title {
    text-align: center;
    color: #444;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    margin-bottom: 15px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.history-empty {
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    padding: 15px;
    font-style: italic;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2vw, 15px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease-out;
    transition: all 0.2s ease;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

.history-round {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: #888;
    font-weight: 600;
    min-width: 45px;
}

.history-choices {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 15px);
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.history-player,
.history-computer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 500;
    flex-wrap: wrap;
    justify-content: center;
}

.history-player {
    color: #667eea;
}

.history-computer {
    color: #eb3349;
}

.history-emoji {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.history-vs {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: 700;
}

.history-result {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: 700;
    padding: 4px clamp(8px, 1.5vw, 12px);
    border-radius: 20px;
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
}

.history-result.win {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.history-result.lose {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.history-result.draw {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: white;
}

/* game Arena */
.game-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(15px, 3vw, 30px);
    margin-bottom: 40px;
}

.player-side,
.computer-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.player-label {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hand-container {
    width: clamp(120px, 20vw, 180px);
    height: clamp(120px, 20vw, 180px);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hand-image {
    width: clamp(70px, 12vw, 120px);
    height: clamp(70px, 12vw, 120px);
    object-fit: contain;
    transition: all 0.3s ease;
}

/* hand animations */
.hand-shake {
    animation: shake 0.5s ease-in-out 3;
}

@keyframes shake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(-10deg); }
    75% { transform: translateY(-20px) rotate(10deg); }
}

.hand-win {
    animation: winPulse 0.6s ease-in-out;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.hand-lose {
    animation: loseShake 0.6s ease-in-out;
}

@keyframes loseShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-15px) rotate(-5deg); }
    40% { transform: translateX(15px) rotate(5deg); }
    60% { transform: translateX(-15px) rotate(-5deg); }
    80% { transform: translateX(15px) rotate(5deg); }
}

/* controls center */
.controls-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    flex: 1.5;
}

.result-message {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    text-align: center;
    padding: clamp(10px, 2vw, 15px) clamp(15px, 3vw, 30px);
    border-radius: 15px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: #666;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.result-message.win {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    animation: resultPop 0.5s ease-out;
}

.result-message.lose {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
    animation: resultPop 0.5s ease-out;
}

.result-message.draw {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: white;
    animation: resultPop 0.5s ease-out;
}

@keyframes resultPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/*button container */
.button-container {
    display: flex;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* game buttons */
.game-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: clamp(12px, 2vw, 20px) clamp(15px, 3vw, 30px);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    min-width: clamp(70px, 15vw, 100px);
    flex: 0 1 auto;
    border-width: 3px;
    border-style: solid;
}

.game-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.game-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.game-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.rock-btn {
    border-color: #667eea;
}

.rock-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.paper-btn {
    border-color: #11998e;
}

.paper-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.scissors-btn {
    border-color: #f7971e;
}

.scissors-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: white;
}

.btn-icon {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.btn-text {
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: 600;
}

/* rules section */
.rules-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 20px;
    padding: clamp(15px, 3vw, 25px);
    margin-bottom: 25px;
}

.rules-section h3 {
    text-align: center;
    color: #444;
    margin-bottom: 20px;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.rules-grid {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 3vw, 30px);
    flex-wrap: wrap;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    color: #555;
    font-weight: 500;
    flex-wrap: wrap;
    justify-content: center;
}

.rule-icon {
    font-size: clamp(1.3rem, 2.5vw, 1.5rem);
}

/* reset button */
.reset-btn {
    display: block;
    margin: 0 auto;
    padding: clamp(12px, 2vw, 15px) clamp(30px, 5vw, 40px);
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    width: fit-content;
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.5);
}

.reset-btn:active {
    transform: translateY(-1px);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .game-container {
        padding: 25px;
    }

    .game-title {
        padding: 0 50px;
    }

    .backBtn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .game-arena {
        flex-direction: column;
        gap: 25px;
    }

    .controls-center {
        order: -1;
        width: 100%;
    }

    .player-side,
    .computer-side {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }

    .player-label {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .hand-container {
        width: 140px;
        height: 140px;
    }

    .hand-image {
        width: 90px;
        height: 90px;
    }

    .button-container {
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-round {
        width: 100%;
        text-align: left;
    }

    .history-choices {
        width: 100%;
        justify-content: space-between;
    }

    .history-result {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 20px;
        border-radius: 20px;
    }

    .game-title {
        font-size: 1.5rem;
        padding: 0 40px;
    }

    .game-subtitle {
        font-size: 0.85rem;
    }

    .backBtn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .hand-container {
        width: 100px;
        height: 100px;
    }

    .hand-image {
        width: 65px;
        height: 65px;
    }

    .player-label {
        font-size: 0.9rem;
    }

    .game-btn {
        min-width: 65px;
        padding: 10px;
    }

    .btn-icon {
        font-size: 1.6rem;
    }

    .btn-text {
        font-size: 0.7rem;
    }

    .score-board {
        gap: 10px;
        padding: 12px;
    }

    .score-value {
        font-size: 1.8rem;
        min-width: 40px;
    }

    .score-divider {
        padding: 6px 10px;
        font-size: 1rem;
    }

    .result-message {
        font-size: 1rem;
        padding: 10px;
        min-height: 50px;
    }

    .rules-grid {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .rule-item {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 360px) {
    .game-title {
        font-size: 1.2rem;
        padding: 0 35px;
    }

    .backBtn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .hand-container {
        width: 80px;
        height: 80px;
    }

    .hand-image {
        width: 50px;
        height: 50px;
    }

    .button-container {
        gap: 8px;
    }

    .game-btn {
        min-width: 55px;
        padding: 8px 5px;
    }

    .btn-icon {
        font-size: 1.4rem;
    }

    .btn-text {
        font-size: 0.6rem;
    }

    .score-value {
        font-size: 1.5rem;
        min-width: 35px;
    }

    .score-label {
        font-size: 0.7rem;
    }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .game-container {
        padding: 15px;
    }

    .game-arena {
        flex-direction: row;
        gap: 15px;
    }

    .hand-container {
        width: 100px;
        height: 100px;
    }

    .hand-image {
        width: 70px;
        height: 70px;
    }

    .history-list {
        max-height: 120px;
    }

    .button-container {
        gap: 10px;
    }

    .game-btn {
        padding: 10px 15px;
    }
}