:root {
    /* Traditional Japanese Colors */
    --primary-color: #F05E1C;
    /* Shu-iro (Vermilion) */
    --secondary-color: #FEE9E1;
    /* Sakura-iro (Cherry Blossom) */
    --accent-color: #B7BA6B;
    /* Matcha-iro */
    --text-color: #2B2B2B;
    /* Sumi-iro */
    --bg-color: #FDFDFD;
    --border-color: #D4A1A1;
}

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

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Seigaiha (Wave) Pattern */
    background-image:
        radial-gradient(circle at 100% 150%, var(--secondary-color) 24%, white 25%, white 28%, var(--secondary-color) 29%, var(--secondary-color) 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 0 150%, var(--secondary-color) 24%, white 25%, white 28%, var(--secondary-color) 29%, var(--secondary-color) 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 50% 100%, white 10%, var(--secondary-color) 11%, var(--secondary-color) 23%, white 24%, white 30%, var(--secondary-color) 31%, var(--secondary-color) 43%, white 44%, white 50%, var(--secondary-color) 51%, var(--secondary-color) 63%, white 64%, white 71%, transparent 71%, transparent),
        radial-gradient(circle at 100% 50%, white 5%, var(--secondary-color) 6%, var(--secondary-color) 15%, white 16%, white 20%, var(--secondary-color) 21%, var(--secondary-color) 30%, white 31%, white 35%, var(--secondary-color) 36%, var(--secondary-color) 45%, white 46%, white 49%, transparent 50%, transparent),
        radial-gradient(circle at 0 50%, white 5%, var(--secondary-color) 6%, var(--secondary-color) 15%, white 16%, white 20%, var(--secondary-color) 21%, var(--secondary-color) 30%, white 31%, white 35%, var(--secondary-color) 36%, var(--secondary-color) 45%, white 46%, white 49%, transparent 50%, transparent);
    background-size: 64px 32px;
    background-color: #FFF5F5;
    /* Fallback */
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(180, 100, 100, 0.2);
    text-align: center;
    max-width: 90%;
    width: 360px;
    border: 8px double var(--primary-color);
    /* Double border for frame effect */
    position: relative;
}

/* Decorative corner accents */
.container::before,
.container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.container::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.container::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px dashed var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.box {
    font-size: 6rem;
    margin: 1rem 0;
    transition: transform 0.3s;
    cursor: pointer;
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.1));
}

.box:hover {
    transform: scale(1.1) rotate(5deg);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0) rotate(-5deg);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0) rotate(5deg);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0) rotate(-5deg);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0) rotate(5deg);
    }
}

.result {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-image: radial-gradient(#B7BA6B 1px, transparent 1px);
    background-size: 10px 10px;
}

.result.hidden {
    visibility: hidden;
    opacity: 0;
}

.result:not(.hidden) {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#fortune-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 1px 1px 0 #fff;
}

#fortune-message {
    font-size: 1rem;
    line-height: 1.6;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 4px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    /* Less rounded, more like a stamp */
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #C04000;
    /* 3D effect */
    margin-top: 10px;
}

button:hover {
    background-color: #FF7030;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #C04000;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #C04000;
}

button:disabled {
    background-color: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}