/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    background: linear-gradient(135deg, #5a7a5f 0%, #3d5a42 100%);
    color: #4a3428;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #f5ebe0;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(139, 111, 71, 0.3);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 3.2em;
    color: #ffd966;
    text-shadow: 
        3px 3px 0 #8b6914,
        -2px -2px 0 #fff9e6,
        -2px 2px 0 #8b6914,
        2px -2px 0 #8b6914,
        4px 4px 0 #6b5010,
        5px 5px 0 #4a3508,
        6px 6px 15px rgba(0, 0, 0, 0.5);
    font-weight: 900;
    letter-spacing: 2px;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    -webkit-text-stroke: 1px #8b6914;
    paint-order: stroke fill;
}

/* Remove text effects from emojis */
h1::first-letter {
    text-shadow: none;
    -webkit-text-stroke: 0;
    color: inherit;
}

h2, h3 {
    color: #6b4423;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Alliance Management */
.alliance-section {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.alliance-section h2 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0 0 20px 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 800;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alliance-section h2::before {
    content: '📋';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 1;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.alliance-section h2 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.alliance-section h2 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.alliance-section > div {
    padding: 0 20px 20px 20px;
}

.alliance-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.alliance-input input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    border-radius: 15px;
    font-size: 16px;
    background: white;
    font-weight: bold;
    color: #4a3428;
}

.alliance-input input[type="color"] {
    width: 60px;
    height: 42px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* Buttons - Kingshot Style */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 6px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(180deg, #4dd9cc 0%, #2ba89e 100%);
    color: white;
    border-bottom: 4px solid #1d7a72;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #5ee3d7 0%, #3cb9af 100%);
}

.btn-danger {
    background: linear-gradient(180deg, #e85d75 0%, #c74860 100%);
    color: white;
    border-bottom: 4px solid #a03648;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #f26e86 0%, #d85971 100%);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffd666 0%, #f4c542 100%);
    color: #6b4423;
    border-bottom: 4px solid #d4a530;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #ffe077 0%, #ffd653 100%);
}

.alliance-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.alliance-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.alliance-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.alliance-tag .color-box {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.alliance-tag .remove-btn {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: bold;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Castle Visual */
.castle-visual {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 500px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.castle-visual h3 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    width: 100%;
    text-align: left;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 800;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.castle-visual h3::before {
    content: '🏰';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.castle-visual h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.castle-visual h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.castle-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 20px 0;
}

.castle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 105px;
    height: 105px;
    background: #b8860b;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 5px solid #9a7209;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.castle-label {
    transform: rotate(-45deg);
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    max-width: 70px;
    word-wrap: break-word;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    color: white;
}

.castle:hover {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.turret {
    position: absolute;
    width: 70px;
    height: 70px;
    background: #708090;
    border-radius: 50%;
    border: 5px solid #5a6a78;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.turret:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.turret-label {
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    max-width: 50px;
    word-wrap: break-word;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    color: white;
}

.turret-number {
    font-size: 12px;
    opacity: 0.9;
    color: white;
    font-weight: bold;
}

#turret-iv {
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
}

#turret-iii {
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
}

#turret-i {
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
}

#turret-ii {
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
}

/* Timeline */
.timeline-section {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.timeline-section h3 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 800;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-section h3::before {
    content: '⏰';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.timeline-section h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.timeline-section h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.timeline-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.timeline-controls label {
    font-weight: bold;
    color: #6b4423;
}

.timeline-controls select {
    padding: 10px;
    border-radius: 15px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    font-size: 14px;
    background: white;
    font-weight: bold;
    color: #4a3428;
}

/* Alliance Stats */
.alliance-stats {
    background: #ffffff;
    border: 2px solid rgba(139, 111, 71, 0.2);
    border-radius: 15px;
    padding: 15px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    max-height: 200px;
    overflow-y: auto;
    min-width: 280px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-weight: bold;
    color: #6b4423;
}

.stat-value {
    color: #4a3428;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.timeline-grid {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 15px;
    padding: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.timeline-table th {
    background: #f0e8dc;
    color: #5a4a3a;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    border: 1px solid rgba(139, 111, 71, 0.15);
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.timeline-table td {
    border: 1px solid #d4a574;
    padding: 6px 4px;
    text-align: center;
    min-width: 60px;
    min-height: 35px;
    font-size: 12px;
    font-weight: bold;
    position: relative;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-table td:hover {
    background: #fff8f0;
    transform: scale(1.02);
    z-index: 10;
}

.timeline-table .structure-label {
    background: #f0e8dc;
    font-weight: bold;
    text-align: left;
    padding-left: 12px;
    cursor: default;
    color: #5a4a3a;
    border: 1px solid rgba(139, 111, 71, 0.15);
}

.timeline-table .structure-label:hover {
    background: #f0e8dc;
    transform: none;
}

.timeline-cell {
    min-width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Statistics Section */
.statistics-section {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.statistics-section h3 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0 0 20px 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 600;
    position: relative;
}

.statistics-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
}

/* Info Button */
.info-button {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: linear-gradient(180deg, #d4a574 0%, #b8865a 100%);
    color: white;
    border: 2px solid #8b6f47;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    position: relative;
    top: 0;
    margin-left: 8px;
    line-height: 1;
    font-family: 'Arial', sans-serif;
    opacity: 0.9;
    padding: 0;
    flex-shrink: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.info-button:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

.info-button:active {
    transform: scale(0.95);
}

/* Info Modal */
.info-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.info-modal-content {
    background: #f5ebe0;
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(139, 111, 71, 0.3);
}

.info-modal-content h3 {
    background: #d4c4af;
    color: #4a3a2a;
    margin: -25px -25px 15px -25px;
    padding: 15px 15px 15px 60px;
    font-size: 18px;
    text-align: left;
    border-radius: 20px 20px 0 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-weight: 800;
    position: relative;
}

.info-modal-content h3::before {
    content: 'ℹ️';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

/* Specific emojis for each info modal type */
.info-modal-content h3[data-modal="alliances"]::before {
    content: '📋';
}

.info-modal-content h3[data-modal="castle"]::before {
    content: '🏰';
}

.info-modal-content h3[data-modal="timeline"]::before {
    content: '⏰';
}

.info-modal-content h3[data-modal="output"]::before {
    content: '📝';
}

.info-modal-content p {
    color: #4a3428;
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-modal-content ul {
    color: #4a3428;
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-modal-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.info-close-btn {
    width: 100%;
    margin-top: 15px;
}

/* Output Section */
.output-section {
    background: #fff8f0;
    padding: 0;
    border-radius: 20px;
    border: 2px solid rgba(139, 111, 71, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.output-section h2, .output-section h3 {
    background: #d4c4af;
    color: #4a3a2a;
    padding: 15px 15px 15px 60px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-size: 18px;
    border-bottom: 2px solid rgba(139, 111, 71, 0.15);
    font-weight: 800;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.output-section h3::before {
    content: '📝';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-top-left-radius: 18px;
    border-right: 2px solid rgba(139, 111, 71, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.output-section h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.output-section h3 .info-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-parts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.output-part {
    background: #ffffff;
    padding: 18px;
    border-radius: 15px;
    border: 2px solid rgba(139, 111, 71, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.output-part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.output-part-content {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 14px;
    color: #4a3428;
}

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

/* Modal for alliance selection */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #f5ebe0;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(139, 111, 71, 0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
    color: #d4a574;
    text-shadow: 2px 2px 0 #8b6f47;
    font-size: 24px;
}

/* Tips Modal */
.tips-modal-content {
    max-width: 600px;
}

.tips-modal-content h3 {
    color: #d4a574;
    font-size: 26px;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0 #8b6f47;
}

.tips-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tip-step {
    display: flex;
    gap: 15px;
    padding: 18px;
    background: #fff8f0;
    border-radius: 15px;
    border: 2px solid rgba(139, 111, 71, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.tip-number {
    background: linear-gradient(180deg, #4dd9cc 0%, #2ba89e 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #1d7a72;
}

.tip-content h4 {
    margin: 0 0 5px 0;
    color: #6b4423;
    font-size: 16px;
}

.tip-content p {
    margin: 0;
    color: #4a3428;
    font-size: 14px;
    line-height: 1.5;
}

.tips-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #d4a574;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tips-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b4423;
}

.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(180deg, #4dd9cc 0%, #2ba89e 100%);
    color: white;
    border: 3px solid #1d7a72;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: all 0.3s;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.help-button:hover {
    transform: scale(1.1);
    background: linear-gradient(180deg, #5ee3d7 0%, #3cb9af 100%);
}

.modal-alliances {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-alliance-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.modal-alliance-btn:hover {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
    opacity: 0.95;
}

.modal-close {
    margin-top: 20px;
    width: 100%;
}

.time-preview {
    margin-top: 30px;
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

.time-preview label {
    color: #6b4423;
    font-weight: bold;
}

.time-preview input[type="range"] {
    width: 100%;
    max-width: 280px;
    margin: 10px 0;
}

#current-time-display {
    color: #d4a574;
    font-weight: bold;
    text-shadow: 1px 1px 0 #8b6f47;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Remove outer container padding/border for full-width sections */
    body {
        padding: 0;
        background: #f5ebe0;
    }

    .container {
        padding: 0;
        border: none;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }

    h1 {
        font-size: 2em;
        padding: 20px 15px 15px;
        margin-bottom: 0;
        background: #f5ebe0;
    }

    /* Make sections full-width with no gaps */
    .alliance-section,
    .castle-visual,
    .timeline-section,
    .output-section,
    .statistics-section {
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 0;
        box-shadow: none;
    }

    /* Adjust section headers to fill width */
    .alliance-section h2,
    .castle-visual h3,
    .timeline-section h3,
    .output-section h3 {
        padding: 12px 15px 12px 65px;
        border-radius: 0;
    }
    
    /* Adjust white box for mobile - no rounded corner visible */
    .alliance-section h2::before,
    .castle-visual h3::before,
    .timeline-section h3::before,
    .output-section h3::before {
        border-top-left-radius: 0;
        width: 50px;
    }

    /* Remove extra padding from section content */
    .alliance-section > div {
        padding: 15px;
    }

    .timeline-section > div,
    .output-section > div {
        padding: 15px;
    }

    .castle-visual {
        padding: 0;
    }

    .castle-visual > div {
        padding: 15px;
    }

    /* Optimize castle map size - use more screen space */
    .castle-container {
        width: 280px;
        height: 280px;
    }

    .castle {
        width: 110px;
        height: 110px;
    }

    .turret {
        width: 70px;
        height: 70px;
    }

    .turret-label {
        font-size: 10px;
    }

    .turret-number {
        font-size: 12px;
    }

    .castle-label {
        font-size: 11px;
    }

    /* Adjust time preview */
    .time-preview {
        margin-top: 20px;
        padding: 0 15px;
    }

    /* Full-width action buttons */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    /* Alliance stats optimization */
    .alliance-stats {
        font-size: 12px;
        padding: 10px;
        width: 100%;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 11px;
    }

    /* Timeline controls */
    .timeline-controls {
        flex-direction: column;
        align-items: stretch;
    }

    /* Optimize export button for mobile */
    .btn-secondary {
        font-size: 14px;
        padding: 10px 16px;
    }

    /* Modal adjustments */
    .tips-modal-content {
        max-width: 90%;
        max-height: 85vh;
        overflow-y: auto;
    }

    .help-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }

    /* Timeline table adjustments */
    .timeline-table {
        font-size: 12px;
    }

    .timeline-table th,
    .timeline-table td {
        padding: 8px 4px;
    }
}