:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #2d3436;
    --highlight-color: #6c5ce7;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    color: var(--text-color);
}

.container {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.input-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 0.9rem;
    color: #636e72;
}

.input-group input {
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s, opacity 0.3s;
}

button:active {
    transform: scale(0.98);
}

#calculateBtn {
    background-color: var(--primary-color);
    color: white;
    margin-top: 10px;
}

.result-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    /* animation removed to prevent html2canvas issues */
}

.card-header {
    text-align: center;
    padding: 15px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #2d3436;
}

.card-content {
    padding: 30px 25px 0;
    /* Removing bottom padding because footer will handle it */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    position: relative;
    text-align: left;
}

.silver-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin-bottom: 5px;
    padding-bottom: 25px;
    border-bottom: 1px dashed #e1e1e1;
    /* Subtle divider */
    position: relative;
}

.silver-info .label {
    font-size: 0.9rem;
    color: #636e72;
    letter-spacing: 1px;
    font-weight: 500;
}

.silver-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.silver-info .highlight {
    color: var(--highlight-color);
    font-size: 3.2rem;
    /* Impactful size */
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
    font-family: 'Bahnschrift', 'Roboto', sans-serif;
    /* Try a more number-friendly font if available */
}

.base-unit {
    /* Renaming unit class to avoid conflict if any */
    font-size: 1.2rem;
    color: #2d3436;
    font-weight: 600;
}

.silver-info .unit {
    /* Using the class from HTML */
    font-size: 1.4rem;
    color: #2d3436;
    font-weight: 600;
}


.silver-info .emoji {
    font-size: 3rem;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.rank-info {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    margin-top: 5px;
    padding-bottom: 25px;
    /* Space for character */
}

.text-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 15px;
    z-index: 2;
    /* Text over avatar slightly if needed */
}

.text-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #636e72;
    background: rgba(255, 255, 255, 0.8);
    /* Readability if overlap */
    display: inline-block;
}

.text-info p strong {
    color: #2d3436;
    font-size: 1.1rem;
}

/* Cleaner Rank Badge */
.rank-badge {
    background: transparent;
    padding: 0;
    border: none;
    text-align: left;
}

.rank-name {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.5rem;
    /* Larger title */
    display: block;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.rank-desc {
    font-size: 0.9rem;
    color: #636e72;
    line-height: 1.6;
    opacity: 0.9;
}

/* Standing Character - Integrated */
.avatar-container {
    width: auto;
    height: auto;
    max-width: 150px;
    max-height: 240px;
    background: transparent;
    border: none;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    margin-right: -10px;
    /* Slight overflow to right */
    margin-bottom: -10px;
    /* Connect to footer */
}

.avatar-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: none;
    mix-blend-mode: multiply;
    /* Removes white background */
}

/* Static QR Code Section - No Overlap */
/* Anchored Footer */
.qr-code-section {
    position: static;
    margin: 0;
    padding: 15px 25px;
    /* Standard padding */
    width: 100%;
    /* Full width of parent */
    background: #f8f9fa;
    border-top: 1px solid #edf2f7;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    box-sizing: border-box;
}



.qr-code-section #qrcode {
    transform: none;
    width: 48px;
    /* Smaller seal size */
    height: 48px;
    background: white;
    padding: 3px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e1e1;
    /* Subtle border */
}

.qr-code-section #qrcode img {
    width: 48px !important;
    height: 48px !important;
    display: block;
}



.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons button {
    flex: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}