.pd-body {
    margin: 0;
    padding: 0;
    background: #0f0f23;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pd-container {
    width: 100%;
    max-width: 520px;
    padding: 0;
}

.pd-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
}

.pd-back {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 14px;
}

.pd-back:hover {
    color: #e2e8f0;
}

.pd-title {
    font-size: 16px;
    font-weight: bold;
    color: #FCD34D;
}

.pd-canvas-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4px 0;
}

.pd-canvas-wrap canvas {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #2d2d44;
}

.pd-hand-info {
    text-align: center;
    padding: 2px;
    min-height: 20px;
}

.pd-hand-name {
    font-size: 16px;
    font-weight: bold;
}

.pd-card-area {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    min-height: 70px;
}

.pd-card {
    width: 52px;
    height: 72px;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.pd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pd-card-selected {
    border-color: #EF4444;
    transform: translateY(-8px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.pd-card-rank {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.pd-card-suit {
    font-size: 22px;
    line-height: 1;
    margin-top: 2px;
}

.pd-action-btns {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px 16px;
}

.pd-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.pd-btn:active {
    transform: scale(0.95);
}

.pd-btn-primary {
    background: #2563eb;
    color: #fff;
}

.pd-btn-primary:hover {
    background: #1d4ed8;
}

.pd-btn-secondary {
    background: #374151;
    color: #e2e8f0;
}

.pd-btn-secondary:hover {
    background: #4b5563;
}

.pd-btn-swap {
    background: #7c3aed;
    color: #fff;
}

.pd-btn-swap:hover {
    background: #6d28d9;
}

.pd-btn-discard {
    background: #991b1b;
    color: #fca5a5;
}

.pd-btn-discard:hover {
    background: #7f1d1d;
}

.pd-btn-speed {
    background: #1f2937;
    color: #FCD34D;
    min-width: 48px;
}

.pd-btn-share {
    background: #FEE500;
    color: #191919;
    border-radius: 12px;
}

.pd-result-panel {
    background: #1e1e3a;
    border: 1px solid #3d3d5c;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 16px;
    text-align: center;
}

.pd-result-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 12px;
}

.pd-result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.pd-result-stats strong {
    color: #FCD34D;
}

.pd-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.pd-input {
    width: 180px;
    padding: 8px 12px;
    border: 1px solid #4b5563;
    border-radius: 8px;
    background: #111827;
    color: #e2e8f0;
    font-size: 14px;
    text-align: center;
}

.pd-input:focus {
    outline: none;
    border-color: #2563eb;
}

.pd-ranking-panel {
    background: #1e1e3a;
    border: 1px solid #3d3d5c;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.pd-ranking-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
    color: #FCD34D;
}

.pd-ranking-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #2d2d44;
    font-size: 13px;
}

.pd-ranking-pos {
    width: 30px;
    text-align: center;
}

.pd-ranking-name {
    flex: 1;
    padding: 0 8px;
}

.pd-ranking-score {
    color: #FCD34D;
    font-weight: bold;
    width: 60px;
    text-align: right;
}

.pd-ranking-wave {
    color: #60A5FA;
    width: 30px;
    text-align: right;
}

.pd-ranking-empty {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

.pd-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    transition: transform 0.3s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.pd-toast-show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
    .pd-card {
        width: 46px;
        height: 64px;
    }

    .pd-card-rank {
        font-size: 16px;
    }

    .pd-card-suit {
        font-size: 18px;
    }

    .pd-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}
