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

:root {
    --cube-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpolygon fill='%236aa84f' points='12,2 3,7 12,12 21,7'/%3E%3Cpolygon fill='%237f6000' points='3,7 3,17 12,22 12,12'/%3E%3Cpolygon fill='%2393c47d' points='21,7 21,17 12,22 12,12'/%3E%3Cpolyline fill='none' stroke='%23000000' stroke-width='1' points='12,2 3,7 3,17 12,22 21,17 21,7 12,2 12,12'/%3E%3Cline x1='12' y1='12' x2='21' y2='17' stroke='%23000000' stroke-width='1'/%3E%3Cline x1='12' y1='12' x2='3' y2='17' stroke='%23000000' stroke-width='1'/%3E%3Cline x1='12' y1='12' x2='21' y2='7' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E") 12 12;
}

body {
    font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
    background:
        linear-gradient(#6aa84f 18px, transparent 18px),
        linear-gradient(#7f6000 0, #7f6000 100%);
    background-size: 100% 18px, 100% calc(100% - 18px);
    background-repeat: no-repeat;
    background-position: top left, 0 18px;
    color: #1a1a1a;
    min-height: 100vh;
    padding: 10px;
    line-height: 1.6;
    font-size: 13px;
    image-rendering: pixelated;
    cursor: var(--cube-cursor), auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #C0C0C0;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #b7e1a1;
    border: 4px solid #38761d;
    box-shadow: 0 0 0 4px #274e13 inset;
}

a,
button,
.btn,
.link,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    cursor: var(--cube-cursor), auto;
}

input,
textarea,
select {
    cursor: var(--cube-cursor), auto;
}

header h1 {
    font-size: 1.6rem;
    font-weight: bold;
    color: #274e13;
    margin-bottom: 8px;
    text-shadow: 0 4px #93c47d, 2px 0 #93c47d, -2px 0 #93c47d, 0 -2px #93c47d;
}

.subtitle {
    font-size: 1rem;
    color: #000000;
    font-weight: normal;
    font-family: 'Arial', sans-serif;
}

header hr {
    border: none;
    border-top: 2px inset #808080;
    margin-top: 15px;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    background: #e6d0a3;
    border: 4px solid #7f6000;
    padding: 14px;
    box-shadow: 0 0 0 4px #b45f06 inset;
}

.card:active {
    border: 3px inset #C0C0C0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 4px solid #7f6000;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000080;
    font-family: 'Arial', sans-serif;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.status-dot {
    width: 12px;
    height: 12px;
    border: 2px outset #808080;
    background: #FF0000;
    display: inline-block;
}

.status-dot.online {
    background: #00FF00;
}

.status-dot.offline {
    background: #FF0000;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric {
    background: #fff2cc;
    padding: 12px;
    border: 4px solid #7f6000;
    border-radius: 0;
    box-shadow: 0 0 0 4px #b45f06 inset;
}

.metric-label {
    font-size: 0.75rem;
    color: #000000;
    margin-bottom: 6px;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000080;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.metric-trend {
    font-size: 0.7rem;
    color: #000000;
    font-family: 'Courier New', monospace;
}

.optimizer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-box {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.recommendation-text {
    flex: 1;
}

.recommendation-text strong {
    display: block;
    margin-bottom: 8px;
    color: #000080;
    font-family: 'Arial', sans-serif;
}

.recommendation-text p {
    color: #000000;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

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

.btn {
    padding: 10px 16px;
    border: 4px solid #3d3d3d;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: normal;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    background: #b7e1a1;
    color: #1a1a1a;
    min-width: 140px;
    box-shadow: 0 0 0 4px #93c47d inset;
}

.btn:active {
    border: 2px inset #C0C0C0;
}

.btn-primary {
    background: #93c47d;
    border-color: #274e13;
    box-shadow: 0 0 0 4px #6aa84f inset;
}

.btn-primary:hover {
    background: #D4D0C8;
}

.btn-secondary {
    background: #b7e1a1;
    border-color: #3d3d3d;
}

.btn-secondary:hover {
    background: #D4D0C8;
}

.tips-section {
    margin-top: 10px;
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 12px;
}

.tips-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #000080;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

.tips-list {
    list-style: none;
    padding-left: 0;
}

.tips-list li {
    padding: 5px 0;
    padding-left: 0;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.decentralization-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-display {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    border: 4px solid #7f6000;
    background: #fff2cc;
    border-radius: 0;
}

.score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #7f6000;
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: #38761d;
    stroke-width: 8;
    stroke-linecap: square;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s linear;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: #000080;
    font-family: 'Courier New', monospace;
}

.score-description {
    text-align: center;
    color: #000000;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 8px;
}

.validator-info h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #000080;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

.validator-chart {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 12px;
    min-height: 150px;
}

.chart-placeholder {
    color: #000000;
    text-align: center;
    padding: 20px;
    font-family: 'Courier New', monospace;
}

.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.problem-item {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 15px;
}

.problem-item h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #000080;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

.problem-item p {
    color: #000000;
    font-size: 0.85rem;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

footer {
    text-align: center;
    padding: 20px;
    color: #1a1a1a;
    font-size: 0.85rem;
    border-top: 4px solid #7f6000;
    margin-top: 20px;
    background: #b7e1a1;
    font-family: 'Press Start 2P', monospace;
}

/* Status Card Full Width */
.status-card {
    grid-column: 1 / -1;
}

/* Optimizer Card Full Width */
.optimizer-card {
    grid-column: 1 / -1;
}

.info-card {
    grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Classic scrollbar (where supported) */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #C0C0C0;
    border: 2px inset #C0C0C0;
}

::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
}

::-webkit-scrollbar-thumb:hover {
    background: #D4D0C8;
}

/* Navigation Styles */
.main-nav {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 8px 12px;
    background: #93c47d;
    border: 4px solid #38761d;
    color: #1a1a1a;
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-weight: normal;
    font-size: 0.75rem;
    box-shadow: 0 0 0 4px #6aa84f inset;
}

.nav-link:hover {
    background: #6aa84f;
}

.nav-link.active {
    background: #6aa84f;
    box-shadow: 0 0 0 4px #38761d inset;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #000000;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    font-size: 0.9rem;
}

.input-field {
    width: 100%;
    padding: 8px;
    border: 2px inset #C0C0C0;
    background: #FFFFFF;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.input-field:focus {
    outline: none;
    border: 2px inset #000080;
}

.input-field select {
    background: #FFFFFF;
    color: #000000;
}

.info-text {
    background: #FFF9C4;
    border: 2px inset #C0C0C0;
    padding: 10px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #000000;
}

/* RPC Results */
.rpc-results {
    margin-top: 15px;
}

.rpc-result-item {
    font-family: 'Courier New', monospace;
}

/* Transaction Results */
.transaction-results {
    margin-top: 15px;
}

.transaction-history {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px inset #808080;
}

.transaction-history h3 {
    font-size: 1rem;
    color: #000080;
    font-family: 'Arial', sans-serif;
    margin-bottom: 10px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

/* Calculator Results */
.cost-results {
    margin-top: 15px;
}

/* Token Results */
.token-results {
    margin-top: 15px;
}

/* Wallet Results */
.wallet-results {
    margin-top: 15px;
}

/* Wallet Generator Styles */
.warning-card {
    grid-column: 1 / -1;
}

.generator-card {
    grid-column: 1 / -1;
}

.result-card {
    grid-column: 1 / -1;
}

.management-card {
    grid-column: 1 / -1;
}

.tips-card {
    grid-column: 1 / -1;
}

.warning-content {
    font-family: 'Courier New', monospace;
}

.generator-content {
    padding: 10px 0;
}

.result-content {
    padding: 10px 0;
}

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

.address-display .input-field {
    flex: 1;
}

.wallet-info {
    margin-bottom: 20px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tip-item {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 15px;
}

/* Agent card interactive hint */
.agent-card { cursor: pointer; }
.agent-card:hover {
    background: #f7e8b3;
    box-shadow: 0 0 0 4px #93c47d inset;
}
.agent-card:focus {
    outline: none;
    box-shadow: 0 0 0 4px #38761d inset, 0 0 0 3px #274e13;
}
.agent-hint {
    color: #274e13;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    display: inline-block;
    margin-top: 4px;
    animation: hintPulse 1.2s infinite;
}
@keyframes hintPulse {
    0% { opacity: 0.6; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(2px); }
    100% { opacity: 0.6; transform: translateX(0); }
}

.tip-item h3 {
    color: #000080;
    font-family: 'Arial', sans-serif;
    margin-bottom: 10px;
    font-size: 1rem;
}

.tip-item ul {
    list-style: none;
    padding-left: 0;
}

.tip-item li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.tip-item li::before {
    content: "*";
    position: absolute;
    left: 0;
    color: #000080;
}

@media (max-width: 768px) {
    .address-display {
        flex-direction: column;
    }
    
    .address-display .btn {
        width: 100%;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* Minecraft 2D Box Loading Animation */
.minecraft-box-container {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 600px;
    height: 200px;
    margin: 20px 0;
}

.minecraft-box {
    position: relative;
    width: 120px;
    height: 120px;
    transform-style: preserve-3d;
    animation: rotateBox 3s infinite linear;
    image-rendering: pixelated;
}

.box-face {
    position: absolute;
    border: 2px solid #000000;
    image-rendering: pixelated;
}

.box-top {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #6aa84f 0px, #6aa84f 10px, #7f6000 10px, #7f6000 20px),
        repeating-linear-gradient(90deg, #6aa84f 0px, #6aa84f 10px, #7f6000 10px, #7f6000 20px);
    transform: rotateX(90deg) translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

.box-front {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #93c47d 0px, #93c47d 10px, #6aa84f 10px, #6aa84f 20px),
        repeating-linear-gradient(90deg, #93c47d 0px, #93c47d 10px, #6aa84f 10px, #6aa84f 20px);
    transform: translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

.box-right {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #7f6000 0px, #7f6000 10px, #6aa84f 10px, #6aa84f 20px),
        repeating-linear-gradient(90deg, #7f6000 0px, #7f6000 10px, #6aa84f 10px, #6aa84f 20px);
    transform: rotateY(90deg) translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

.box-bottom {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #274e13 0px, #274e13 10px, #38761d 10px, #38761d 20px),
        repeating-linear-gradient(90deg, #274e13 0px, #274e13 10px, #38761d 10px, #38761d 20px);
    transform: rotateX(-90deg) translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

.box-back {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #6aa84f 0px, #6aa84f 10px, #7f6000 10px, #7f6000 20px),
        repeating-linear-gradient(90deg, #6aa84f 0px, #6aa84f 10px, #7f6000 10px, #7f6000 20px);
    transform: rotateY(180deg) translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

.box-left {
    width: 100px;
    height: 100px;
    background: 
        repeating-linear-gradient(0deg, #274e13 0px, #274e13 10px, #38761d 10px, #38761d 20px),
        repeating-linear-gradient(90deg, #274e13 0px, #274e13 10px, #38761d 10px, #38761d 20px);
    transform: rotateY(-90deg) translateZ(50px);
    box-shadow: inset 0 0 0 2px #000000;
}

@keyframes rotateBox {
    0% {
        transform: rotateX(-20deg) rotateY(0deg);
    }
    25% {
        transform: rotateX(-20deg) rotateY(90deg);
    }
    50% {
        transform: rotateX(-20deg) rotateY(180deg);
    }
    75% {
        transform: rotateX(-20deg) rotateY(270deg);
    }
    100% {
        transform: rotateX(-20deg) rotateY(360deg);
    }
}

/* Loading screen specific styles */
.loading-screen {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Payment Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
